OmniSciDB  c1a53651b2
 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 847 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 848 of file HeavyDBSqlOperatorTable.java.

848  {
849  super(name,
850  kind,
851  ReturnTypes.ARG0.andThen(SqlTypeTransforms.TO_NULLABLE)
852  .andThen(SqlTypeTransforms.TO_VARYING),
853  null,
854  OperandTypes.and(
855  OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING),
856  new SameOperandTypeChecker(2) {
857  @Override
858  protected List<Integer> getOperandList(int operandCount) {
859  return ImmutableList.of(0, 1);
860  }
861  }),
862  SqlFunctionCategory.STRING);
863  }
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 866 of file HeavyDBSqlOperatorTable.java.

868  {
869  assert functionQualifier == null;
870  switch (operands.length) {
871  case 1:
872  operands = new SqlNode[] {operands[0], SqlLiteral.createCharString(" ", pos)};
873  break;
874  case 2:
875  if (operands[1] == null) {
876  operands[1] = SqlLiteral.createCharString(" ", pos);
877  }
878  operands = new SqlNode[] {operands[0], operands[1]};
879  break;
880  default:
881  throw new IllegalArgumentException(
882  "Invalid operand count " + Arrays.toString(operands));
883  }
884  return super.createCall(functionQualifier, pos, operands);
885  }
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.LeftRightTrim.requiresCreate ( List< SqlNode >  operands)
inline

Definition at line 888 of file HeavyDBSqlOperatorTable.java.

888  {
889  // if there is only 1 Operand, the code will be creating 'defaults'
890  return (operands.size() == 1);
891  }

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