Package net.hydromatic.optiq

Examples of net.hydromatic.optiq.QueryableTable


      RelOptSchema schema,
      RelDataType rowType,
      final OptiqSchema.TableEntry tableEntry) {
    Function<Class, Expression> expressionFunction;
    if (tableEntry.getTable() instanceof QueryableTable) {
      final QueryableTable table = (QueryableTable) tableEntry.getTable();
      expressionFunction = new Function<Class, Expression>() {
        public Expression apply(Class clazz) {
          return table.getExpression(tableEntry.schema.plus(),
              tableEntry.name, clazz);
        }
      };
    } else {
      expressionFunction = new Function<Class, Expression>() {
View Full Code Here


        this, elementType);
  }

  private Class deduceElementType() {
    if (table instanceof QueryableTable) {
      final QueryableTable queryableTable = (QueryableTable) table;
      final Type type = queryableTable.getElementType();
      if (type instanceof Class) {
        return (Class) type;
      } else {
        return Object[].class;
      }
View Full Code Here

      return rel;
    }
    if (queryable instanceof AbstractTableQueryable) {
      final AbstractTableQueryable tableQueryable =
          (AbstractTableQueryable) queryable;
      final QueryableTable table = tableQueryable.table;
      final OptiqSchema.TableEntry tableEntry =
          OptiqSchema.from(tableQueryable.schema)
              .add(tableQueryable.tableName, tableQueryable.table);
      final RelOptTableImpl relOptTable =
          RelOptTableImpl.create(null, table.getRowType(translator.typeFactory),
              tableEntry);
      if (table instanceof TranslatableTable) {
        return ((TranslatableTable) table).toRel(translator, relOptTable);
      } else {
        return new TableAccessRel(translator.cluster, relOptTable);
View Full Code Here

      RelOptSchema schema,
      RelDataType rowType,
      final OptiqSchema.TableEntry tableEntry) {
    Function<Class, Expression> expressionFunction;
    if (tableEntry.getTable() instanceof QueryableTable) {
      final QueryableTable table = (QueryableTable) tableEntry.getTable();
      expressionFunction = new Function<Class, Expression>() {
        public Expression apply(Class clazz) {
          return table.getExpression(tableEntry.schema.plus(),
              tableEntry.name, clazz);
        }
      };
    } else {
      expressionFunction = new Function<Class, Expression>() {
View Full Code Here

        this, elementType);
  }

  private Class deduceElementType() {
    if (table instanceof QueryableTable) {
      final QueryableTable queryableTable = (QueryableTable) table;
      final Type type = queryableTable.getElementType();
      if (type instanceof Class) {
        return (Class) type;
      } else {
        return Object[].class;
      }
View Full Code Here

      return rel;
    }
    if (queryable instanceof AbstractTableQueryable) {
      final AbstractTableQueryable tableQueryable =
          (AbstractTableQueryable) queryable;
      final QueryableTable table = tableQueryable.table;
      final OptiqSchema.TableEntry tableEntry =
          OptiqSchema.from(tableQueryable.schema)
              .add(tableQueryable.tableName, tableQueryable.table);
      final RelOptTableImpl relOptTable =
          RelOptTableImpl.create(null, table.getRowType(translator.typeFactory),
              tableEntry);
      if (table instanceof TranslatableTable) {
        return ((TranslatableTable) table).toRel(translator, relOptTable);
      } else {
        return new TableAccessRel(translator.cluster, relOptTable);
View Full Code Here

      return rel;
    }
    if (queryable instanceof AbstractTableQueryable) {
      final AbstractTableQueryable tableQueryable =
          (AbstractTableQueryable) queryable;
      final QueryableTable table = tableQueryable.table;
      final OptiqSchema.TableEntry tableEntry =
          OptiqSchema.from(tableQueryable.schema)
              .add(tableQueryable.tableName, tableQueryable.table);
      final RelOptTableImpl relOptTable =
          RelOptTableImpl.create(null, table.getRowType(translator.typeFactory),
              tableEntry, null);
      if (table instanceof TranslatableTable) {
        return ((TranslatableTable) table).toRel(translator, relOptTable);
      } else {
        return new TableAccessRel(translator.cluster, relOptTable);
View Full Code Here

  public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType,
      final OptiqSchema.TableEntry tableEntry, Double rowCount) {
    Function<Class, Expression> expressionFunction;
    if (tableEntry.getTable() instanceof QueryableTable) {
      final QueryableTable table = (QueryableTable) tableEntry.getTable();
      expressionFunction = new Function<Class, Expression>() {
        public Expression apply(Class clazz) {
          return table.getExpression(tableEntry.schema.plus(),
              tableEntry.name, clazz);
        }
      };
    } else {
      expressionFunction = new Function<Class, Expression>() {
View Full Code Here

        this, elementType);
  }

  private Class deduceElementType() {
    if (table instanceof QueryableTable) {
      final QueryableTable queryableTable = (QueryableTable) table;
      final Type type = queryableTable.getElementType();
      if (type instanceof Class) {
        return (Class) type;
      } else {
        return Object[].class;
      }
View Full Code Here

    //noinspection unchecked
    Enumerable<Row> iterable = rel.getTable().unwrap(Enumerable.class);
    if (iterable != null) {
      return iterable;
    }
    final QueryableTable queryableTable =
        rel.getTable().unwrap(QueryableTable.class);
    if (queryableTable != null) {
      final Type elementType = queryableTable.getElementType();
      SchemaPlus schema = root.getRootSchema();
      for (String name : Util.skipLast(rel.getTable().getQualifiedName())) {
        schema = schema.getSubSchema(name);
      }
      if (elementType instanceof Class) {
View Full Code Here

TOP

Related Classes of net.hydromatic.optiq.QueryableTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.