OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
org.apache.calcite.sql.validate.SqlValidatorImpl.Expander Class Reference
+ Inheritance diagram for org.apache.calcite.sql.validate.SqlValidatorImpl.Expander:
+ Collaboration diagram for org.apache.calcite.sql.validate.SqlValidatorImpl.Expander:

Public Member Functions

SqlNode visit (SqlIdentifier id)
 

Protected Member Functions

SqlNode visitScoped (SqlCall call)
 
SqlNode expandDynamicStar (SqlIdentifier id, SqlIdentifier fqId)
 

Protected Attributes

final SqlValidatorImpl validator
 

Package Functions

 Expander (SqlValidatorImpl validator, SqlValidatorScope scope)
 

Detailed Description

Converts an expression into canonical form by fully-qualifying any identifiers.

Definition at line 5914 of file SqlValidatorImpl.java.

Constructor & Destructor Documentation

org.apache.calcite.sql.validate.SqlValidatorImpl.Expander.Expander ( SqlValidatorImpl  validator,
SqlValidatorScope  scope 
)
inlinepackage

Definition at line 5917 of file SqlValidatorImpl.java.

References org.apache.calcite.sql.validate.SqlValidatorImpl.Expander.validator.

5917  {
5918  super(scope);
5919  this.validator = validator;
5920  }

Member Function Documentation

SqlNode org.apache.calcite.sql.validate.SqlValidatorImpl.Expander.expandDynamicStar ( SqlIdentifier  id,
SqlIdentifier  fqId 
)
inlineprotected

Definition at line 5967 of file SqlValidatorImpl.java.

Referenced by org.apache.calcite.sql.validate.SqlValidatorImpl.Expander.visit(), and org.apache.calcite.sql.validate.SqlValidatorImpl.ExtendedExpander.visit().

5967  {
5968  if (DynamicRecordType.isDynamicStarColName(Util.last(fqId.names))
5969  && !DynamicRecordType.isDynamicStarColName(Util.last(id.names))) {
5970  // Convert a column ref into ITEM(*, 'col_name')
5971  // for a dynamic star field in dynTable's rowType.
5972  SqlNode[] inputs = new SqlNode[2];
5973  inputs[0] = fqId;
5974  inputs[1] = SqlLiteral.createCharString(
5975  Util.last(id.names),
5976  id.getParserPosition());
5977  return new SqlBasicCall(
5978  SqlStdOperatorTable.ITEM,
5979  inputs,
5980  id.getParserPosition());
5981  }
5982  return fqId;
5983  }

+ Here is the caller graph for this function:

SqlNode org.apache.calcite.sql.validate.SqlValidatorImpl.Expander.visit ( SqlIdentifier  id)
inline

Definition at line 5922 of file SqlValidatorImpl.java.

References org.apache.calcite.sql.validate.SqlValidatorImpl.Expander.expandDynamicStar().

5922  {
5923  // First check for builtin functions which don't have
5924  // parentheses, like "LOCALTIME".
5925  final SqlCall call = validator.makeNullaryCall(id);
5926  if (call != null) {
5927  return call.accept(this);
5928  }
5929  final SqlIdentifier fqId = getScope().fullyQualify(id).identifier;
5930  SqlNode expandedExpr = expandDynamicStar(id, fqId);
5931  validator.setOriginal(expandedExpr, id);
5932  return expandedExpr;
5933  }
SqlNode expandDynamicStar(SqlIdentifier id, SqlIdentifier fqId)

+ Here is the call graph for this function:

SqlNode org.apache.calcite.sql.validate.SqlValidatorImpl.Expander.visitScoped ( SqlCall  call)
inlineprotected

Definition at line 5935 of file SqlValidatorImpl.java.

References run_benchmark_import.result.

5935  {
5936  switch (call.getKind()) {
5937  case SCALAR_QUERY:
5938  case CURRENT_VALUE:
5939  case NEXT_VALUE:
5940  case WITH:
5941  return call;
5942  }
5943  // Only visits arguments which are expressions. We don't want to
5944  // qualify non-expressions such as 'x' in 'empno * 5 AS x'.
5945 
5946  // ArgHandler<SqlNode> argHandler = // HEAVY.AI original
5947  // new CallCopyingArgHandler(call, false); // HEAVY.AI original
5948 
5949  // // HEAVY.AI new
5950  // Allow the operator to decide if it needs to be recreated // HEAVY.AI new
5951  // Useful for UDFs that are supplying default arguements that do // HEAVY.AI new
5952  // not already exist // HEAVY.AI new
5953  // // HEAVY.AI new
5954  // Only Heavy.AI Operators (UDFs) have the fn requiresCreate() overloaded // HEAVY.AI new
5955  // // HEAVY.AI new
5956  boolean bCreate = call.getOperator().requiresCreate(call.getOperandList()); // HEAVY.AI new
5957  ArgHandler<SqlNode> argHandler = // HEAVY.AI new
5958  new CallCopyingArgHandler(call, bCreate); // HEAVY.AI new
5959 
5960 
5961  call.getOperator().acceptCall(this, call, true, argHandler);
5962  final SqlNode result = argHandler.result();
5963  validator.setOriginal(result, call);
5964  return result;
5965  }

Member Data Documentation


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