OmniSciDB  dfae7c3b14
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)
 

Private Attributes

final boolean isRowUdf
 
final SqlTypeName ret
 
final List< SqlTypeName > outs
 

Detailed Description

Definition at line 1866 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 1867 of file MapDSqlOperatorTable.java.

References com.mapd.parser.server.ExtensionFunction.getSqlOuts(), com.mapd.parser.server.ExtensionFunction.getSqlRet(), com.mapd.parser.server.ExtensionFunction.isRowUdf, and com.mapd.parser.server.ExtensionFunction.toSqlSignature().

1867  {
1868  super(name,
1869  SqlKind.OTHER_FUNCTION,
1870  null,
1871  null,
1872  OperandTypes.family(sig.toSqlSignature()),
1873  sig.isRowUdf() ? SqlFunctionCategory.SYSTEM
1874  : SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION);
1875  isRowUdf = sig.isRowUdf();
1876  if (isRowUdf) {
1877  ret = sig.getSqlRet();
1878  outs = null;
1879  } else {
1880  ret = null;
1881  outs = sig.getSqlOuts();
1882  }
1883  }
name
Definition: setup.py:35
+ 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 1886 of file MapDSqlOperatorTable.java.

1886  {
1887  if (isRowUdf) {
1888  final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
1889  return typeFactory.createTypeWithNullability(
1890  typeFactory.createSqlType(ret), true);
1891  } else {
1892  final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
1893  java.util.List<RelDataType> typeList = new java.util.ArrayList<RelDataType>();
1894  java.util.List<java.lang.String> fieldNameList =
1895  new java.util.ArrayList<java.lang.String>();
1896 
1897  for (int out_idx = 0; out_idx < outs.size(); ++out_idx) {
1898  // TODO: use the argument names of output columns as field names
1899  fieldNameList.add("out" + out_idx);
1900  typeList.add(typeFactory.createSqlType(outs.get(out_idx)));
1901  }
1902  return typeFactory.createStructType(typeList, fieldNameList);
1903  }
1904  }

Member Data Documentation

◆ isRowUdf

final boolean com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.isRowUdf
private

Definition at line 1906 of file MapDSqlOperatorTable.java.

◆ outs

final List<SqlTypeName> com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.outs
private

Definition at line 1908 of file MapDSqlOperatorTable.java.

◆ ret

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

Definition at line 1907 of file MapDSqlOperatorTable.java.


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