Java Code Examples for org.apache.calcite.adapter.java.JavaTypeFactory#getJavaClass()
The following examples show how to use
org.apache.calcite.adapter.java.JavaTypeFactory#getJavaClass() .
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: PhysTypeImpl.java From calcite with Apache License 2.0 | 5 votes |
/** Creates a PhysTypeImpl. */ PhysTypeImpl( JavaTypeFactory typeFactory, RelDataType rowType, Type javaRowClass, JavaRowFormat format) { this.typeFactory = typeFactory; this.rowType = rowType; this.javaRowClass = javaRowClass; this.format = format; for (RelDataTypeField field : rowType.getFieldList()) { Type fieldType = typeFactory.getJavaClass(field.getType()); fieldClasses.add(fieldType instanceof Class ? (Class) fieldType : Object[].class); } }
Example 2
Source File: ViewTableMacro.java From calcite with Apache License 2.0 | 5 votes |
/** 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); }
Example 3
Source File: ViewTableMacro.java From calcite with Apache License 2.0 | 5 votes |
/** 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); }
Example 4
Source File: MockCatalogReader.java From calcite with Apache License 2.0 | 5 votes |
@Override 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 MockModifiableViewTable(elementType, RelDataTypeImpl.proto(parsed.rowType), viewSql, schemaPath, viewPath, parsed.table, Schemas.path(schema.root(), parsed.tablePath), parsed.constraint, parsed.columnMapping); }
Example 5
Source File: EnumUtils.java From calcite with Apache License 2.0 | 4 votes |
static Type javaClass( JavaTypeFactory typeFactory, RelDataType type) { final Type clazz = typeFactory.getJavaClass(type); return clazz instanceof Class ? clazz : Object[].class; }