use of org.apache.calcite.adapter.java.JavaTypeFactory in project calcite by apache.
the class SqlOperatorBindingTest method setUp.
@Before
public void setUp() {
JavaTypeFactory typeFactory = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
integerDataType = typeFactory.createSqlType(SqlTypeName.INTEGER);
integerType = SqlTypeUtil.convertTypeToSpec(integerDataType);
rexBuilder = new RexBuilder(typeFactory);
}
use of org.apache.calcite.adapter.java.JavaTypeFactory in project calcite by apache.
the class ViewTableMacro method viewTable.
/**
* Allows a sub-class to return an extension of {@link ViewTable} by
* overriding this method.
*/
protected ViewTable viewTable(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, List<String> viewPath) {
final JavaTypeFactory typeFactory = (JavaTypeFactory) parsed.typeFactory;
final Type elementType = typeFactory.getJavaClass(parsed.rowType);
return new ViewTable(elementType, RelDataTypeImpl.proto(parsed.rowType), viewSql, schemaPath, viewPath);
}
use of org.apache.calcite.adapter.java.JavaTypeFactory in project calcite by apache.
the class ViewTableMacro method modifiableViewTable.
/**
* Allows a sub-class to return an extension of {@link ModifiableViewTable}
* by overriding this method.
*/
protected ModifiableViewTable modifiableViewTable(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, List<String> viewPath, CalciteSchema schema) {
final JavaTypeFactory typeFactory = (JavaTypeFactory) parsed.typeFactory;
final Type elementType = typeFactory.getJavaClass(parsed.rowType);
return new ModifiableViewTable(elementType, RelDataTypeImpl.proto(parsed.rowType), viewSql, schemaPath, viewPath, parsed.table, Schemas.path(schema.root(), parsed.tablePath), parsed.constraint, parsed.columnMapping);
}
Aggregations