OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ArrayLength Class Reference
+ Inheritance diagram for com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ArrayLength:
+ Collaboration diagram for com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ArrayLength:

Classes

interface  ArrayLengthErrors
 

Public Member Functions

 ArrayLength ()
 
RelDataType inferReturnType (SqlOperatorBinding opBinding)
 
void validateCall (SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope)
 

Static Public Attributes

static final ArrayLengthErrors _ERRORS
 

Detailed Description

Definition at line 913 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ArrayLength.ArrayLength ( )
inline

Definition at line 914 of file HeavyDBSqlOperatorTable.java.

914  {
915  super("ARRAY_LENGTH",
916  SqlKind.OTHER_FUNCTION,
917  null,
918  null,
919  OperandTypes.ARRAY,
920  SqlFunctionCategory.SYSTEM);
921  }

Member Function Documentation

RelDataType com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ArrayLength.inferReturnType ( SqlOperatorBinding  opBinding)
inline

Definition at line 924 of file HeavyDBSqlOperatorTable.java.

924  {
925  final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
926  return typeFactory.createSqlType(SqlTypeName.INTEGER);
927  }
void com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ArrayLength.validateCall ( SqlCall  call,
SqlValidator  validator,
SqlValidatorScope  scope,
SqlValidatorScope  operandScope 
)
inline

Definition at line 930 of file HeavyDBSqlOperatorTable.java.

933  {
934  for (int i = 0; i < call.operandCount(); ++i) {
935  SqlNode operand = call.operand(i);
936  if (operand instanceof SqlCall) {
937  SqlCall operand_call = (SqlCall) operand;
938  SqlOperator call_oper = operand_call.getOperator();
939  if (call_oper instanceof SqlFunction) {
940  SqlFunction call_func = (SqlFunction) call_oper;
941  if (call_func.getFunctionType()
942  == SqlFunctionCategory.USER_DEFINED_FUNCTION) {
943  // Cannot call ARRAY_LENGTH(UDF_func) as its llvm return type
944  // is different than the one expected by ARRAY_LENGTH
945  // - UDF(...) -> {T*, i64, i8}*
946  // - ARRAY_LENGTH(chunk_iter*) -> i32
947  throw validator.newValidationError(
948  call, _ERRORS.illegalArrayLengthCall(call.toString()));
949  }
950  }
951  }
952  }
953  super.validateCall(call, validator, scope, operandScope);
954  }

Member Data Documentation

final ArrayLengthErrors com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ArrayLength._ERRORS
static
Initial value:
=
Resources.create(ArrayLengthErrors.class)

Definition at line 961 of file HeavyDBSqlOperatorTable.java.


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