OmniSciDB  085a039ca4
 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)
 

Detailed Description

Definition at line 791 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 792 of file HeavyDBSqlOperatorTable.java.

792  {
793  super(name,
794  kind,
795  ReturnTypes.ARG0.andThen(SqlTypeTransforms.TO_NULLABLE)
796  .andThen(SqlTypeTransforms.TO_VARYING),
797  null,
798  OperandTypes.and(
799  OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING),
800  new SameOperandTypeChecker(2) {
801  @Override
802  protected List<Integer> getOperandList(int operandCount) {
803  return ImmutableList.of(0, 1);
804  }
805  }),
806  SqlFunctionCategory.STRING);
807  }
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 810 of file HeavyDBSqlOperatorTable.java.

812  {
813  assert functionQualifier == null;
814  switch (operands.length) {
815  case 1:
816  operands = new SqlNode[] {SqlLiteral.createCharString(" ", pos), operands[0]};
817  break;
818  case 2:
819  if (operands[1] == null) {
820  operands[1] = SqlLiteral.createCharString(" ", pos);
821  }
822  operands = new SqlNode[] {operands[1], operands[0]};
823  break;
824  default:
825  throw new IllegalArgumentException(
826  "Invalid operand count " + Arrays.toString(operands));
827  }
828  return super.createCall(functionQualifier, pos, operands);
829  }

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