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

Public Member Functions

 RegexpReplace ()
 
SqlCall createCall (@Nullable SqlLiteral functionQualifier, SqlParserPos pos,@Nullable SqlNode...operands)
 
RelDataType inferReturnType (SqlOperatorBinding opBinding)
 

Static Private Member Functions

static java.util.List
< SqlTypeFamily > 
getSignatureFamilies ()
 

Detailed Description

Definition at line 1025 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpReplace.RegexpReplace ( )
inline

Definition at line 1026 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1026  {
1027  super("REGEXP_REPLACE",
1028  SqlKind.OTHER_FUNCTION,
1029  null,
1030  null,
1031  OperandTypes.family(getSignatureFamilies()),
1033  }
tuple STRING
Definition: dtypes.py:31

Member Function Documentation

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

Definition at line 1048 of file HeavyDBSqlOperatorTable.java.

1050  {
1051  assert functionQualifier == null;
1052  final int num_operands = operands.length;
1053  if (num_operands < 2 || num_operands > 6) {
1054  throw new IllegalArgumentException(
1055  "Invalid operand count " + Arrays.toString(operands));
1056  }
1057  SqlNode[] new_operands = new SqlNode[6];
1058  // operand string
1059  new_operands[0] = operands[0];
1060  // pattern
1061  new_operands[1] = operands[1];
1062  // replacement
1063  if (num_operands < 3 || operands[2] == null) {
1064  new_operands[2] = SqlLiteral.createCharString("", pos);
1065  } else {
1066  new_operands[2] = operands[2];
1067  }
1068  // position
1069  if (num_operands < 4 || operands[3] == null) {
1070  new_operands[3] = SqlLiteral.createExactNumeric("1", pos);
1071  } else {
1072  new_operands[3] = operands[3];
1073  }
1074  // occurrence
1075  if (num_operands < 5 || operands[4] == null) {
1076  new_operands[4] = SqlLiteral.createExactNumeric("0", pos);
1077  } else {
1078  new_operands[4] = operands[4];
1079  }
1080  // parameters
1081  if (num_operands < 6 || operands[5] == null) {
1082  new_operands[5] = SqlLiteral.createCharString("c", pos);
1083  } else {
1084  new_operands[5] = operands[5];
1085  }
1086  return super.createCall(functionQualifier, pos, new_operands);
1087  }
static java.util.List<SqlTypeFamily> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpReplace.getSignatureFamilies ( )
inlinestaticprivate

Definition at line 1035 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1035  {
1036  java.util.ArrayList<SqlTypeFamily> families =
1037  new java.util.ArrayList<SqlTypeFamily>();
1038  families.add(SqlTypeFamily.STRING);
1039  families.add(SqlTypeFamily.STRING);
1040  families.add(SqlTypeFamily.STRING);
1041  families.add(SqlTypeFamily.INTEGER);
1042  families.add(SqlTypeFamily.INTEGER);
1043  families.add(SqlTypeFamily.STRING);
1044  return families;
1045  }
tuple STRING
Definition: dtypes.py:31
RelDataType com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpReplace.inferReturnType ( SqlOperatorBinding  opBinding)
inline

Definition at line 1090 of file HeavyDBSqlOperatorTable.java.

1090  {
1091  return opBinding.getOperandType(0);
1092  }

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