OmniSciDB  72c90bc290
 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 5917 of file SqlValidatorImpl.java.

Constructor & Destructor Documentation

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

Definition at line 5920 of file SqlValidatorImpl.java.

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

5920  {
5921  super(scope);
5922  this.validator = validator;
5923  }

Member Function Documentation

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

Definition at line 5970 of file SqlValidatorImpl.java.

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

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

+ Here is the caller graph for this function:

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

Definition at line 5925 of file SqlValidatorImpl.java.

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

5925  {
5926  // First check for builtin functions which don't have
5927  // parentheses, like "LOCALTIME".
5928  final SqlCall call = validator.makeNullaryCall(id);
5929  if (call != null) {
5930  return call.accept(this);
5931  }
5932  final SqlIdentifier fqId = getScope().fullyQualify(id).identifier;
5933  SqlNode expandedExpr = expandDynamicStar(id, fqId);
5934  validator.setOriginal(expandedExpr, id);
5935  return expandedExpr;
5936  }
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 5938 of file SqlValidatorImpl.java.

References run_benchmark_import.result.

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

Member Data Documentation


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