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

Constructor & Destructor Documentation

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

Definition at line 1365 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1365  {
1366  super("REGEXP_SUBSTR",
1367  SqlKind.OTHER_FUNCTION,
1368  null,
1369  null,
1370  OperandTypes.family(getSignatureFamilies()),
1372  }
tuple STRING
Definition: dtypes.py:31
com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpSubstr.RegexpSubstr ( final String  alias)
inline

Definition at line 1374 of file HeavyDBSqlOperatorTable.java.

1374  {
1375  super(alias,
1376  SqlKind.OTHER_FUNCTION,
1377  null,
1378  null,
1379  OperandTypes.family(getSignatureFamilies()),
1380  SqlFunctionCategory.SYSTEM);
1381  }

Member Function Documentation

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

Definition at line 1396 of file HeavyDBSqlOperatorTable.java.

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

Definition at line 1383 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

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

Definition at line 1439 of file HeavyDBSqlOperatorTable.java.

1439  {
1440  return opBinding.getOperandType(0);
1441  }

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