17 package org.apache.calcite.prepare;
21 import org.apache.calcite.adapter.java.JavaTypeFactory;
22 import org.apache.calcite.rel.type.RelDataType;
23 import org.apache.calcite.sql.SqlIdentifier;
24 import org.apache.calcite.sql.SqlInsert;
25 import org.apache.calcite.sql.SqlNode;
26 import org.apache.calcite.sql.SqlOperatorTable;
27 import org.apache.calcite.sql.validate.SelectScope;
28 import org.apache.calcite.sql.validate.SqlConformance;
29 import org.apache.calcite.sql.validate.SqlValidator.Config;
31 import org.apache.calcite.sql.validate.SqlValidatorScope;
32 import org.apache.calcite.sql.validate.SqlValidatorTable;
34 import java.util.List;
49 super(opTab, catalogReader, typeFactory, config);
54 RelDataType sourceRowType, SqlInsert insert) {
55 final RelDataType superType = super.getLogicalSourceRowType(sourceRowType, insert);
56 return ((JavaTypeFactory)
typeFactory).toSql(superType);
61 RelDataType targetRowType, SqlInsert insert) {
62 final RelDataType superType = super.getLogicalTargetRowType(targetRowType, insert);
63 return ((JavaTypeFactory)
typeFactory).toSql(superType);
69 List<Map.Entry<String, RelDataType>> fieldList,
72 boolean includeSystemVars) {
74 super.addToSelectList(list, aliases, fieldList, exp, scope, includeSystemVars);
79 if (exp instanceof SqlIdentifier) {
80 SqlIdentifier columnId = (SqlIdentifier) exp;
83 if (columnId.names != null && columnId.names.size() == 2) {
84 SqlValidatorTable sqlValidatorTable =
85 scope.fullyQualify(columnId).
namespace.getTable();
86 if (sqlValidatorTable != null) {
89 return table.isSystemColumn(columnId.names.get(1));
98 SqlValidatorTable table,
99 RelDataType sourceRowType,
100 RelDataType targetRowType,
CalciteSqlValidator(SqlOperatorTable opTab, CalciteCatalogReader catalogReader, JavaTypeFactory typeFactory, Config config)
boolean isSystemColumn(final SqlNode exp, final SelectScope scope)
final RelDataTypeFactory typeFactory
void checkTypeAssignment(SqlValidatorScope sourceScope, SqlValidatorTable table, RelDataType sourceRowType, RelDataType targetRowType, SqlNode query)
void addToSelectList(List< SqlNode > list, Set< String > aliases, List< Map.Entry< String, RelDataType >> fieldList, SqlNode exp, SelectScope scope, boolean includeSystemVars)
RelDataType getLogicalSourceRowType(RelDataType sourceRowType, SqlInsert insert)
final SqlValidatorCatalogReader catalogReader
final SqlOperatorTable opTab
RelDataType getLogicalTargetRowType(RelDataType targetRowType, SqlInsert insert)