Java Code Examples for org.apache.calcite.schema.Schemas#tableExpression()

The following examples show how to use org.apache.calcite.schema.Schemas#tableExpression() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RelOptTableImpl.java    From calcite with Apache License 2.0 6 votes vote down vote up
private static Function<Class, Expression> getClassExpressionFunction(
    final SchemaPlus schema, final String tableName, final Table table) {
  if (table instanceof QueryableTable) {
    final QueryableTable queryableTable = (QueryableTable) table;
    return clazz -> queryableTable.getExpression(schema, tableName, clazz);
  } else if (table instanceof ScannableTable
      || table instanceof FilterableTable
      || table instanceof ProjectableFilterableTable) {
    return clazz -> Schemas.tableExpression(schema, Object[].class, tableName,
        table.getClass());
  } else if (table instanceof StreamableTable) {
    return getClassExpressionFunction(schema, tableName,
        ((StreamableTable) table).stream());
  } else {
    return input -> {
      throw new UnsupportedOperationException();
    };
  }
}
 
Example 2
Source File: ExtensionDdlExecutor.java    From calcite with Apache License 2.0 4 votes vote down vote up
public Expression getExpression(SchemaPlus schema, String tableName,
    Class clazz) {
  return Schemas.tableExpression(schema, getElementType(),
      tableName, clazz);
}
 
Example 3
Source File: ProcessorStatusTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 4
Source File: BulletinTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 5
Source File: ProcessGroupStatusTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 6
Source File: JvmMetricsTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 7
Source File: ConnectionStatusTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 8
Source File: ConnectionStatusPredictionsTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 9
Source File: ProvenanceTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 10
Source File: FlowFileTable.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Expression getExpression(final SchemaPlus schema, final String tableName, final Class clazz) {
    return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 11
Source File: DataTable.java    From marble with Apache License 2.0 4 votes vote down vote up
public Expression getExpression(SchemaPlus schema, String tableName,
    Class clazz) {
  return Schemas.tableExpression(schema, getElementType(),
      tableName, clazz);
}
 
Example 12
Source File: ListTransientTable.java    From calcite with Apache License 2.0 4 votes vote down vote up
public Expression getExpression(SchemaPlus schema, String tableName,
                                Class clazz) {
  return Schemas.tableExpression(schema, elementType, tableName, clazz);
}
 
Example 13
Source File: AbstractQueryableTable.java    From calcite with Apache License 2.0 4 votes vote down vote up
public Expression getExpression(SchemaPlus schema, String tableName,
    Class clazz) {
  return Schemas.tableExpression(schema, elementType, tableName, clazz);
}
 
Example 14
Source File: MutableArrayTable.java    From calcite with Apache License 2.0 4 votes vote down vote up
public Expression getExpression(SchemaPlus schema, String tableName,
    Class clazz) {
  return Schemas.tableExpression(schema, getElementType(),
      tableName, clazz);
}
 
Example 15
Source File: CsvTranslatableTable.java    From calcite with Apache License 2.0 4 votes vote down vote up
public Expression getExpression(SchemaPlus schema, String tableName,
    Class clazz) {
  return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 16
Source File: QuarkTable.java    From quark with Apache License 2.0 4 votes vote down vote up
@Override
public Expression getExpression(SchemaPlus schema, String tableName,
                                Class clazz) {
  return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}
 
Example 17
Source File: QuarkTileTable.java    From quark with Apache License 2.0 4 votes vote down vote up
public Expression getExpression(SchemaPlus schema, String tableName,
                                Class clazz) {
  return Schemas.tableExpression(schema, getElementType(), tableName, clazz);
}