OmniSciDB  f17484ade4
 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 906 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 907 of file HeavyDBSqlOperatorTable.java.

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

Member Function Documentation

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

Definition at line 917 of file HeavyDBSqlOperatorTable.java.

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

Definition at line 923 of file HeavyDBSqlOperatorTable.java.

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

Member Data Documentation

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

Definition at line 954 of file HeavyDBSqlOperatorTable.java.


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