OmniSciDB  b28c0d5765
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.parser.extension.ddl.SqlLeadLag Class Reference
+ Inheritance diagram for com.mapd.parser.extension.ddl.SqlLeadLag:
+ Collaboration diagram for com.mapd.parser.extension.ddl.SqlLeadLag:

Public Member Functions

 SqlLeadLag (String functionName, SqlKind kind)
 
boolean allowsFraming ()
 
boolean allowsNullTreatment ()
 

Static Private Member Functions

static RelDataType transformType (SqlOperatorBinding binding, RelDataType type)
 

Static Private Attributes

static final
SqlSingleOperandTypeChecker 
OPERAND_TYPES
 
static final SqlReturnTypeInference RETURN_TYPE
 

Detailed Description

Definition at line 33 of file SqlLeadLag.java.

Constructor & Destructor Documentation

com.mapd.parser.extension.ddl.SqlLeadLag.SqlLeadLag ( String  functionName,
SqlKind  kind 
)
inline

Definition at line 51 of file SqlLeadLag.java.

References com.mapd.parser.extension.ddl.SqlLeadLag.OPERAND_TYPES, and com.mapd.parser.extension.ddl.SqlLeadLag.RETURN_TYPE.

51  {
52  super(functionName,
53  null,
54  kind,
56  null,
58  SqlFunctionCategory.NUMERIC,
59  false,
60  true,
61  Optionality.FORBIDDEN);
62  Preconditions.checkArgument(kind == SqlKind.LEAD || kind == SqlKind.LAG);
63  }
static final SqlSingleOperandTypeChecker OPERAND_TYPES
Definition: SqlLeadLag.java:34
static final SqlReturnTypeInference RETURN_TYPE
Definition: SqlLeadLag.java:48

Member Function Documentation

boolean com.mapd.parser.extension.ddl.SqlLeadLag.allowsFraming ( )
inline

Definition at line 77 of file SqlLeadLag.java.

77  {
78  return true;
79  }
boolean com.mapd.parser.extension.ddl.SqlLeadLag.allowsNullTreatment ( )
inline

Definition at line 82 of file SqlLeadLag.java.

82  {
83  return true;
84  }
static RelDataType com.mapd.parser.extension.ddl.SqlLeadLag.transformType ( SqlOperatorBinding  binding,
RelDataType  type 
)
inlinestaticprivate

Definition at line 66 of file SqlLeadLag.java.

References shared.transform().

66  {
67  SqlTypeTransform transform =
68  binding.getOperandCount() < 3 || binding.getOperandType(2).isNullable()
69  ? SqlTypeTransforms.FORCE_NULLABLE
70  : SqlTypeTransforms.TO_NOT_NULLABLE;
71  return transform.transformType(binding, type);
72  }
OUTPUT transform(INPUT const &input, FUNC const &func)
Definition: misc.h:320

+ Here is the call graph for this function:

Member Data Documentation

final SqlSingleOperandTypeChecker com.mapd.parser.extension.ddl.SqlLeadLag.OPERAND_TYPES
staticprivate
Initial value:
=
OperandTypes.or(OperandTypes.ANY,
OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC),
OperandTypes.and(OperandTypes.family(SqlTypeFamily.ANY,
SqlTypeFamily.NUMERIC,
SqlTypeFamily.ANY),
new SameOperandTypeChecker(3) {
@Override
protected List<Integer> getOperandList(int operandCount) {
return ImmutableList.of(0, 2);
}
}))

Definition at line 34 of file SqlLeadLag.java.

Referenced by com.mapd.parser.extension.ddl.SqlLeadLag.SqlLeadLag().

final SqlReturnTypeInference com.mapd.parser.extension.ddl.SqlLeadLag.RETURN_TYPE
staticprivate
Initial value:
=
ReturnTypes.ARG0.andThen(SqlLeadLag::transformType)

Definition at line 48 of file SqlLeadLag.java.

Referenced by com.mapd.parser.extension.ddl.SqlLeadLag.SqlLeadLag().


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