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

Public Member Functions

 RegexpCount ()
 
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 1450 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 1451 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1451  {
1452  super("REGEXP_COUNT",
1453  SqlKind.OTHER_FUNCTION,
1454  null,
1455  null,
1456  OperandTypes.family(getSignatureFamilies()),
1458  }
tuple STRING
Definition: dtypes.py:31

Member Function Documentation

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

Definition at line 1471 of file HeavyDBSqlOperatorTable.java.

1473  {
1474  assert functionQualifier == null;
1475  final int num_operands = operands.length;
1476  if (num_operands < 2 || num_operands > 4) {
1477  throw new IllegalArgumentException(
1478  "Invalid operand count " + Arrays.toString(operands));
1479  }
1480  SqlNode[] new_operands = new SqlNode[4];
1481  // operand string
1482  new_operands[0] = operands[0];
1483  // pattern
1484  new_operands[1] = operands[1];
1485  // position
1486  if (num_operands < 3 || operands[2] == null) {
1487  new_operands[2] = SqlLiteral.createExactNumeric("1", pos);
1488  } else {
1489  new_operands[2] = operands[2];
1490  }
1491  // parameters
1492  if (num_operands < 4 || operands[3] == null) {
1493  new_operands[3] = SqlLiteral.createCharString("c", pos);
1494  } else {
1495  new_operands[3] = operands[3];
1496  }
1497  return super.createCall(functionQualifier, pos, new_operands);
1498  }
static java.util.List<SqlTypeFamily> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpCount.getSignatureFamilies ( )
inlinestaticprivate

Definition at line 1460 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1460  {
1461  java.util.ArrayList<SqlTypeFamily> families =
1462  new java.util.ArrayList<SqlTypeFamily>();
1463  families.add(SqlTypeFamily.STRING);
1464  families.add(SqlTypeFamily.STRING);
1465  families.add(SqlTypeFamily.INTEGER);
1466  families.add(SqlTypeFamily.STRING);
1467  return families;
1468  }
tuple STRING
Definition: dtypes.py:31
RelDataType com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpCount.inferReturnType ( SqlOperatorBinding  opBinding)
inline

Definition at line 1501 of file HeavyDBSqlOperatorTable.java.

1501  {
1502  final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
1503  RelDataType dataType = typeFactory.createSqlType(SqlTypeName.BIGINT);
1504  return typeFactory.createTypeWithNullability(dataType, true);
1505  }

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