OmniSciDB  72c90bc290
 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 908 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 909 of file HeavyDBSqlOperatorTable.java.

909  {
910  super("ARRAY_LENGTH",
911  SqlKind.OTHER_FUNCTION,
912  null,
913  null,
914  OperandTypes.ARRAY,
915  SqlFunctionCategory.SYSTEM);
916  }

Member Function Documentation

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

Definition at line 919 of file HeavyDBSqlOperatorTable.java.

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

Definition at line 925 of file HeavyDBSqlOperatorTable.java.

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

Member Data Documentation

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

Definition at line 956 of file HeavyDBSqlOperatorTable.java.


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