OmniSciDB  04ee39c94c
com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction Class Reference
+ Inheritance diagram for com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction:
+ Collaboration diagram for com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction:

Public Member Functions

RelDataType inferReturnType (SqlOperatorBinding opBinding)
 

Package Functions

 ExtFunction (final String name, final ExtensionFunction sig)
 

Static Private Member Functions

static java.util.List< SqlTypeFamily > toSqlSignature (final ExtensionFunction sig)
 
static boolean isPointerType (final ExtensionFunction.ExtArgumentType type)
 
static SqlTypeName toSqlTypeName (final ExtensionFunction.ExtArgumentType type)
 

Private Attributes

final SqlTypeName ret
 

Detailed Description

Definition at line 1404 of file MapDSqlOperatorTable.java.

Constructor & Destructor Documentation

◆ ExtFunction()

com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.ExtFunction ( final String  name,
final ExtensionFunction  sig 
)
inlinepackage

Definition at line 1405 of file MapDSqlOperatorTable.java.

References com.mapd.parser.server.ExtensionFunction.getRet().

1405  {
1406  super(name,
1407  SqlKind.OTHER_FUNCTION,
1408  null,
1409  null,
1410  OperandTypes.family(toSqlSignature(sig)),
1411  SqlFunctionCategory.SYSTEM);
1412  ret = toSqlTypeName(sig.getRet());
1413  }
static SqlTypeName toSqlTypeName(final ExtensionFunction.ExtArgumentType type)
static java.util.List< SqlTypeFamily > toSqlSignature(final ExtensionFunction sig)
+ Here is the call graph for this function:

Member Function Documentation

◆ inferReturnType()

RelDataType com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.inferReturnType ( SqlOperatorBinding  opBinding)
inline

Definition at line 1438 of file MapDSqlOperatorTable.java.

1438  {
1439  final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
1440  return typeFactory.createTypeWithNullability(typeFactory.createSqlType(ret), true);
1441  }

◆ isPointerType()

static boolean com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.isPointerType ( final ExtensionFunction.ExtArgumentType  type)
inlinestaticprivate

◆ toSqlSignature()

static java.util.List<SqlTypeFamily> com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.toSqlSignature ( final ExtensionFunction  sig)
inlinestaticprivate

Definition at line 1415 of file MapDSqlOperatorTable.java.

References com.mapd.parser.server.ExtensionFunction.getArgs().

1416  {
1417  java.util.List<SqlTypeFamily> sql_sig = new java.util.ArrayList<SqlTypeFamily>();
1418  for (int arg_idx = 0; arg_idx < sig.getArgs().size(); ++arg_idx) {
1419  final ExtensionFunction.ExtArgumentType arg_type = sig.getArgs().get(arg_idx);
1420  sql_sig.add(toSqlTypeName(arg_type).getFamily());
1421  if (isPointerType(arg_type)) {
1422  ++arg_idx;
1423  }
1424  }
1425  return sql_sig;
1426  }
static boolean isPointerType(final ExtensionFunction.ExtArgumentType type)
const std::vector< ExtArgumentType > & getArgs() const
static SqlTypeName toSqlTypeName(final ExtensionFunction.ExtArgumentType type)
+ Here is the call graph for this function:

◆ toSqlTypeName()

static SqlTypeName com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.toSqlTypeName ( final ExtensionFunction.ExtArgumentType  type)
inlinestaticprivate

Definition at line 1443 of file MapDSqlOperatorTable.java.

References Bool, Double, Float, Int16, Int32, Int64, Int8, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, and run-benchmark-import.type.

1444  {
1445  switch (type) {
1446  case Bool:
1447  return SqlTypeName.BOOLEAN;
1448  case Int8:
1449  return SqlTypeName.TINYINT;
1450  case Int16:
1451  return SqlTypeName.SMALLINT;
1452  case Int32:
1453  return SqlTypeName.INTEGER;
1454  case Int64:
1455  return SqlTypeName.BIGINT;
1456  case Float:
1457  return SqlTypeName.FLOAT;
1458  case Double:
1459  return SqlTypeName.DOUBLE;
1460  case PInt8:
1461  case PInt16:
1462  case PInt32:
1463  case PInt64:
1464  case PFloat:
1465  case PDouble:
1466  return SqlTypeName.ARRAY;
1467  }
1468  assert false;
1469  return null;
1470  }

Member Data Documentation

◆ ret

final SqlTypeName com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.ret
private

Definition at line 1472 of file MapDSqlOperatorTable.java.


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