OmniSciDB  c1a53651b2
 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 1169 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 1170 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1170  {
1171  super("REGEXP_SUBSTR",
1172  SqlKind.OTHER_FUNCTION,
1173  null,
1174  null,
1175  OperandTypes.family(getSignatureFamilies()),
1177  }
tuple STRING
Definition: dtypes.py:31
com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpSubstr.RegexpSubstr ( final String  alias)
inline

Definition at line 1179 of file HeavyDBSqlOperatorTable.java.

1179  {
1180  super(alias,
1181  SqlKind.OTHER_FUNCTION,
1182  null,
1183  null,
1184  OperandTypes.family(getSignatureFamilies()),
1185  SqlFunctionCategory.SYSTEM);
1186  }

Member Function Documentation

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

Definition at line 1201 of file HeavyDBSqlOperatorTable.java.

1203  {
1204  assert functionQualifier == null;
1205  final int num_operands = operands.length;
1206  if (num_operands < 2 || num_operands > 6) {
1207  throw new IllegalArgumentException(
1208  "Invalid operand count " + Arrays.toString(operands));
1209  }
1210  SqlNode[] new_operands = new SqlNode[6];
1211 
1212  // operand string (required)
1213  new_operands[0] = operands[0];
1214  // pattern (required)
1215  new_operands[1] = operands[1];
1216  // start position
1217  if (num_operands < 3 || operands[2] == null) {
1218  new_operands[2] = SqlLiteral.createExactNumeric("1", pos);
1219  } else {
1220  new_operands[2] = operands[2];
1221  }
1222  // match occurrence
1223  if (num_operands < 4 || operands[3] == null) {
1224  new_operands[3] = SqlLiteral.createExactNumeric("1", pos);
1225  } else {
1226  new_operands[3] = operands[3];
1227  }
1228  // regex params (default 'c' = case sensitive)
1229  if (num_operands < 5 || operands[4] == null) {
1230  new_operands[4] = SqlLiteral.createCharString("c", pos);
1231  } else {
1232  new_operands[4] = operands[4];
1233  }
1234  // Sub-match occurrence, valid with regex param 'e'
1235  if (num_operands < 6 || operands[5] == null) {
1236  new_operands[5] = SqlLiteral.createExactNumeric("1", pos);
1237  } else {
1238  new_operands[5] = operands[5];
1239  }
1240  return super.createCall(functionQualifier, pos, new_operands);
1241  }
static java.util.List<SqlTypeFamily> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpSubstr.getSignatureFamilies ( )
inlinestaticprivate

Definition at line 1188 of file HeavyDBSqlOperatorTable.java.

References heavydb.dtypes.STRING.

1188  {
1189  java.util.ArrayList<SqlTypeFamily> families =
1190  new java.util.ArrayList<SqlTypeFamily>();
1191  families.add(SqlTypeFamily.STRING);
1192  families.add(SqlTypeFamily.STRING);
1193  families.add(SqlTypeFamily.INTEGER);
1194  families.add(SqlTypeFamily.INTEGER);
1195  families.add(SqlTypeFamily.STRING);
1196  families.add(SqlTypeFamily.INTEGER);
1197  return families;
1198  }
tuple STRING
Definition: dtypes.py:31
RelDataType com.mapd.calcite.parser.HeavyDBSqlOperatorTable.RegexpSubstr.inferReturnType ( SqlOperatorBinding  opBinding)
inline

Definition at line 1244 of file HeavyDBSqlOperatorTable.java.

1244  {
1245  return opBinding.getOperandType(0);
1246  }

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