OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
org.apache.calcite.prepare.CalciteSqlValidator Class Reference
+ Inheritance diagram for org.apache.calcite.prepare.CalciteSqlValidator:
+ Collaboration diagram for org.apache.calcite.prepare.CalciteSqlValidator:

Protected Member Functions

RelDataType getLogicalSourceRowType (RelDataType sourceRowType, SqlInsert insert)
 
RelDataType getLogicalTargetRowType (RelDataType targetRowType, SqlInsert insert)
 
void addToSelectList (List< SqlNode > list, Set< String > aliases, List< Map.Entry< String, RelDataType >> fieldList, SqlNode exp, SelectScope scope, boolean includeSystemVars)
 
void checkTypeAssignment (SqlValidatorScope sourceScope, SqlValidatorTable table, RelDataType sourceRowType, RelDataType targetRowType, SqlNode query)
 

Package Functions

 CalciteSqlValidator (SqlOperatorTable opTab, CalciteCatalogReader catalogReader, JavaTypeFactory typeFactory, Config config)
 

Private Member Functions

boolean isSystemColumn (final SqlNode exp, final SelectScope scope)
 

Detailed Description

Based on CalciteSqlValidator in calcite-core with the addition of an addToSelectList() method override, which fixes the omission of system column checks when adding columns from an expanded star selection into the select list.

Definition at line 44 of file CalciteSqlValidator.java.

Constructor & Destructor Documentation

org.apache.calcite.prepare.CalciteSqlValidator.CalciteSqlValidator ( SqlOperatorTable  opTab,
CalciteCatalogReader  catalogReader,
JavaTypeFactory  typeFactory,
Config  config 
)
inlinepackage

Definition at line 45 of file CalciteSqlValidator.java.

48  {
49  super(opTab, catalogReader, typeFactory, config);
50  }

Member Function Documentation

void org.apache.calcite.prepare.CalciteSqlValidator.addToSelectList ( List< SqlNode >  list,
Set< String >  aliases,
List< Map.Entry< String, RelDataType >>  fieldList,
SqlNode  exp,
SelectScope  scope,
boolean  includeSystemVars 
)
inlineprotected

Definition at line 67 of file CalciteSqlValidator.java.

References org.apache.calcite.prepare.CalciteSqlValidator.isSystemColumn().

72  {
73  if (includeSystemVars || !isSystemColumn(exp, scope)) {
74  super.addToSelectList(list, aliases, fieldList, exp, scope, includeSystemVars);
75  }
76  }
boolean isSystemColumn(final SqlNode exp, final SelectScope scope)

+ Here is the call graph for this function:

void org.apache.calcite.prepare.CalciteSqlValidator.checkTypeAssignment ( SqlValidatorScope  sourceScope,
SqlValidatorTable  table,
RelDataType  sourceRowType,
RelDataType  targetRowType,
SqlNode  query 
)
inlineprotected

Definition at line 96 of file CalciteSqlValidator.java.

100  {
101  // disabling assignment checking in calcite and instead letting omni-sci server
102  // handle
103  }
RelDataType org.apache.calcite.prepare.CalciteSqlValidator.getLogicalSourceRowType ( RelDataType  sourceRowType,
SqlInsert  insert 
)
inlineprotected

Definition at line 53 of file CalciteSqlValidator.java.

54  {
55  final RelDataType superType = super.getLogicalSourceRowType(sourceRowType, insert);
56  return ((JavaTypeFactory) typeFactory).toSql(superType);
57  }
RelDataType org.apache.calcite.prepare.CalciteSqlValidator.getLogicalTargetRowType ( RelDataType  targetRowType,
SqlInsert  insert 
)
inlineprotected

Definition at line 60 of file CalciteSqlValidator.java.

61  {
62  final RelDataType superType = super.getLogicalTargetRowType(targetRowType, insert);
63  return ((JavaTypeFactory) typeFactory).toSql(superType);
64  }
boolean org.apache.calcite.prepare.CalciteSqlValidator.isSystemColumn ( final SqlNode  exp,
final SelectScope  scope 
)
inlineprivate

Definition at line 78 of file CalciteSqlValidator.java.

Referenced by org.apache.calcite.prepare.CalciteSqlValidator.addToSelectList().

78  {
79  if (exp instanceof SqlIdentifier) {
80  SqlIdentifier columnId = (SqlIdentifier) exp;
81  // Expects columnId.names[0] to be table name and columnId.names[1] to be column
82  // name
83  if (columnId.names != null && columnId.names.size() == 2) {
84  SqlValidatorTable sqlValidatorTable =
85  scope.fullyQualify(columnId).namespace.getTable();
86  if (sqlValidatorTable != null) {
87  MapDTable table = (MapDTable) sqlValidatorTable.unwrap(MapDTable.class);
88  return table.isSystemColumn(columnId.names.get(1));
89  }
90  }
91  }
92  return false;
93  }

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: