OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 2016 of file MapDSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 2017 of file MapDSqlOperatorTable.java.

References com.mapd.parser.server.ExtensionFunction.isRowUdf, com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.isRowUdf, com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.outs, com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.ret, and com.mapd.parser.server.ExtensionFunction.toSqlSignature().

2017  {
2018  super(name,
2019  SqlKind.OTHER_FUNCTION,
2020  null,
2021  null,
2022  OperandTypes.family(sig.toSqlSignature()),
2023  sig.isRowUdf() ? SqlFunctionCategory.SYSTEM
2024  : SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION);
2025  isRowUdf = sig.isRowUdf();
2026  if (isRowUdf) {
2027  ret = sig.getSqlRet();
2028  outs = null;
2029  } else {
2030  ret = null;
2031  outs = sig.getSqlOuts();
2032  }
2033  }
string name
Definition: setup.py:35

+ Here is the call graph for this function:

Member Function Documentation

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

Definition at line 2036 of file MapDSqlOperatorTable.java.

References com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.isRowUdf, and com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.ret.

2036  {
2037  if (isRowUdf) {
2038  final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
2039  return typeFactory.createTypeWithNullability(
2040  typeFactory.createSqlType(ret), true);
2041  } else {
2042  final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
2043  java.util.List<RelDataType> typeList = new java.util.ArrayList<RelDataType>();
2044  java.util.List<java.lang.String> fieldNameList =
2045  new java.util.ArrayList<java.lang.String>();
2046 
2047  for (int out_idx = 0; out_idx < outs.size(); ++out_idx) {
2048  // TODO: use the argument names of output columns as field names
2049  fieldNameList.add("out" + out_idx);
2050  typeList.add(typeFactory.createSqlType(outs.get(out_idx)));
2051  }
2052  return typeFactory.createStructType(typeList, fieldNameList);
2053  }
2054  }

Member Data Documentation

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

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