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

Public Member Functions

 LeftRightTrim (final String name, final SqlKind kind)
 
SqlCall createCall (@Nullable SqlLiteral functionQualifier, SqlParserPos pos,@Nullable SqlNode...operands)
 
boolean requiresCreate (List< SqlNode > operands)
 

Detailed Description

Definition at line 1042 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

com.mapd.calcite.parser.HeavyDBSqlOperatorTable.LeftRightTrim.LeftRightTrim ( final String  name,
final SqlKind  kind 
)
inline

Definition at line 1043 of file HeavyDBSqlOperatorTable.java.

1043  {
1044  super(name,
1045  kind,
1046  ReturnTypes.ARG0.andThen(SqlTypeTransforms.TO_NULLABLE)
1047  .andThen(SqlTypeTransforms.TO_VARYING),
1048  null,
1049  OperandTypes.and(
1050  OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING),
1051  new SameOperandTypeChecker(2) {
1052  @Override
1053  protected List<Integer> getOperandList(int operandCount) {
1054  return ImmutableList.of(0, 1);
1055  }
1056  }),
1057  SqlFunctionCategory.STRING);
1058  }
string name
Definition: setup.in.py:72

Member Function Documentation

SqlCall com.mapd.calcite.parser.HeavyDBSqlOperatorTable.LeftRightTrim.createCall ( @Nullable SqlLiteral  functionQualifier,
SqlParserPos  pos,
@Nullable SqlNode...  operands 
)
inline

Definition at line 1061 of file HeavyDBSqlOperatorTable.java.

1063  {
1064  assert functionQualifier == null;
1065  switch (operands.length) {
1066  case 1:
1067  operands = new SqlNode[] {operands[0], SqlLiteral.createCharString(" ", pos)};
1068  break;
1069  case 2:
1070  if (operands[1] == null) {
1071  operands[1] = SqlLiteral.createCharString(" ", pos);
1072  }
1073  operands = new SqlNode[] {operands[0], operands[1]};
1074  break;
1075  default:
1076  throw new IllegalArgumentException(
1077  "Invalid operand count " + Arrays.toString(operands));
1078  }
1079  return super.createCall(functionQualifier, pos, operands);
1080  }
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.LeftRightTrim.requiresCreate ( List< SqlNode >  operands)
inline

Definition at line 1083 of file HeavyDBSqlOperatorTable.java.

1083  {
1084  // if there is only 1 Operand, the code will be creating 'defaults'
1085  return (operands.size() == 1);
1086  }

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