OmniSciDB  a5dc49c757
 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 1294 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 1295 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1295  {
1296  super("REGEXP_REPLACE",
1297  SqlKind.OTHER_FUNCTION,
1298  null,
1299  null,
1300  OperandTypes.family(getSignatureFamilies()),
1302  }
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 1317 of file HeavyDBSqlOperatorTable.java.

1319  {
1320  assert functionQualifier == null;
1321  final int num_operands = operands.length;
1322  if (num_operands < 2 || num_operands > 6) {
1323  throw new IllegalArgumentException(
1324  "Invalid operand count " + Arrays.toString(operands));
1325  }
1326  SqlNode[] new_operands = new SqlNode[6];
1327  // operand string
1328  new_operands[0] = operands[0];
1329  // pattern
1330  new_operands[1] = operands[1];
1331  // replacement
1332  if (num_operands < 3 || operands[2] == null) {
1333  new_operands[2] = SqlLiteral.createCharString("", pos);
1334  } else {
1335  new_operands[2] = operands[2];
1336  }
1337  // position
1338  if (num_operands < 4 || operands[3] == null) {
1339  new_operands[3] = SqlLiteral.createExactNumeric("1", pos);
1340  } else {
1341  new_operands[3] = operands[3];
1342  }
1343  // occurrence
1344  if (num_operands < 5 || operands[4] == null) {
1345  new_operands[4] = SqlLiteral.createExactNumeric("0", pos);
1346  } else {
1347  new_operands[4] = operands[4];
1348  }
1349  // parameters
1350  if (num_operands < 6 || operands[5] == null) {
1351  new_operands[5] = SqlLiteral.createCharString("c", pos);
1352  } else {
1353  new_operands[5] = operands[5];
1354  }
1355  return super.createCall(functionQualifier, pos, new_operands);
1356  }
static java.util.List<SqlTypeFamily> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpReplace.getSignatureFamilies ( )
inlinestaticprivate

Definition at line 1304 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1304  {
1305  java.util.ArrayList<SqlTypeFamily> families =
1306  new java.util.ArrayList<SqlTypeFamily>();
1307  families.add(SqlTypeFamily.STRING);
1308  families.add(SqlTypeFamily.STRING);
1309  families.add(SqlTypeFamily.STRING);
1310  families.add(SqlTypeFamily.INTEGER);
1311  families.add(SqlTypeFamily.INTEGER);
1312  families.add(SqlTypeFamily.STRING);
1313  return families;
1314  }
tuple STRING
Definition: dtypes.py:31
RelDataType com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpReplace.inferReturnType ( SqlOperatorBinding  opBinding)
inline

Definition at line 1359 of file HeavyDBSqlOperatorTable.java.

1359  {
1360  return opBinding.getOperandType(0);
1361  }

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