OmniSciDB  a987f07e93
 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 834 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 835 of file HeavyDBSqlOperatorTable.java.

835  {
836  super(name,
837  kind,
838  ReturnTypes.ARG0.andThen(SqlTypeTransforms.TO_NULLABLE)
839  .andThen(SqlTypeTransforms.TO_VARYING),
840  null,
841  OperandTypes.and(
842  OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING),
843  new SameOperandTypeChecker(2) {
844  @Override
845  protected List<Integer> getOperandList(int operandCount) {
846  return ImmutableList.of(0, 1);
847  }
848  }),
849  SqlFunctionCategory.STRING);
850  }
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 853 of file HeavyDBSqlOperatorTable.java.

855  {
856  assert functionQualifier == null;
857  switch (operands.length) {
858  case 1:
859  operands = new SqlNode[] {operands[0], SqlLiteral.createCharString(" ", pos)};
860  break;
861  case 2:
862  if (operands[1] == null) {
863  operands[1] = SqlLiteral.createCharString(" ", pos);
864  }
865  operands = new SqlNode[] {operands[0], operands[1]};
866  break;
867  default:
868  throw new IllegalArgumentException(
869  "Invalid operand count " + Arrays.toString(operands));
870  }
871  return super.createCall(functionQualifier, pos, operands);
872  }
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.LeftRightTrim.requiresCreate ( List< SqlNode >  operands)
inline

Definition at line 875 of file HeavyDBSqlOperatorTable.java.

875  {
876  // if there is only 1 Operand, the code will be creating 'defaults'
877  return (operands.size() == 1);
878  }

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