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

Public Member Functions

 RegexpSubstr ()
 
 RegexpSubstr (final String alias)
 
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 1359 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 1360 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1360  {
1361  super("REGEXP_SUBSTR",
1362  SqlKind.OTHER_FUNCTION,
1363  null,
1364  null,
1365  OperandTypes.family(getSignatureFamilies()),
1367  }
tuple STRING
Definition: dtypes.py:31
com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpSubstr.RegexpSubstr ( final String  alias)
inline

Definition at line 1369 of file HeavyDBSqlOperatorTable.java.

1369  {
1370  super(alias,
1371  SqlKind.OTHER_FUNCTION,
1372  null,
1373  null,
1374  OperandTypes.family(getSignatureFamilies()),
1375  SqlFunctionCategory.SYSTEM);
1376  }

Member Function Documentation

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

Definition at line 1391 of file HeavyDBSqlOperatorTable.java.

1393  {
1394  assert functionQualifier == null;
1395  final int num_operands = operands.length;
1396  if (num_operands < 2 || num_operands > 6) {
1397  throw new IllegalArgumentException(
1398  "Invalid operand count " + Arrays.toString(operands));
1399  }
1400  SqlNode[] new_operands = new SqlNode[6];
1401 
1402  // operand string (required)
1403  new_operands[0] = operands[0];
1404  // pattern (required)
1405  new_operands[1] = operands[1];
1406  // start position
1407  if (num_operands < 3 || operands[2] == null) {
1408  new_operands[2] = SqlLiteral.createExactNumeric("1", pos);
1409  } else {
1410  new_operands[2] = operands[2];
1411  }
1412  // match occurrence
1413  if (num_operands < 4 || operands[3] == null) {
1414  new_operands[3] = SqlLiteral.createExactNumeric("1", pos);
1415  } else {
1416  new_operands[3] = operands[3];
1417  }
1418  // regex params (default 'c' = case sensitive)
1419  if (num_operands < 5 || operands[4] == null) {
1420  new_operands[4] = SqlLiteral.createCharString("c", pos);
1421  } else {
1422  new_operands[4] = operands[4];
1423  }
1424  // Sub-match occurrence, valid with regex param 'e'
1425  if (num_operands < 6 || operands[5] == null) {
1426  new_operands[5] = SqlLiteral.createExactNumeric("1", pos);
1427  } else {
1428  new_operands[5] = operands[5];
1429  }
1430  return super.createCall(functionQualifier, pos, new_operands);
1431  }
static java.util.List<SqlTypeFamily> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpSubstr.getSignatureFamilies ( )
inlinestaticprivate

Definition at line 1378 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1378  {
1379  java.util.ArrayList<SqlTypeFamily> families =
1380  new java.util.ArrayList<SqlTypeFamily>();
1381  families.add(SqlTypeFamily.STRING);
1382  families.add(SqlTypeFamily.STRING);
1383  families.add(SqlTypeFamily.INTEGER);
1384  families.add(SqlTypeFamily.INTEGER);
1385  families.add(SqlTypeFamily.STRING);
1386  families.add(SqlTypeFamily.INTEGER);
1387  return families;
1388  }
tuple STRING
Definition: dtypes.py:31
RelDataType com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpSubstr.inferReturnType ( SqlOperatorBinding  opBinding)
inline

Definition at line 1434 of file HeavyDBSqlOperatorTable.java.

1434  {
1435  return opBinding.getOperandType(0);
1436  }

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