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

Public Member Functions

SqlReturnTypeInference getRowTypeInference ()
 
Set< RelColumnMapping > getColumnMappings ()
 

Package Functions

 ExtTableFunction (final String name, final ExtensionFunction sig)
 

Private Attributes

final List< SqlTypeName > outs
 
final List< String > arg_names
 
final List< String > out_names
 
final Map< String, String > options
 

Detailed Description

Definition at line 1929 of file MapDSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 1930 of file MapDSqlOperatorTable.java.

References com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.arg_names, com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.options, com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.out_names, com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.outs, and com.mapd.parser.server.ExtensionFunction.toSqlSignature().

1930  {
1931  super(name,
1932  SqlKind.OTHER_FUNCTION,
1933  ReturnTypes.CURSOR,
1934  null,
1935  OperandTypes.family(sig.toSqlSignature()),
1936  SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION);
1937  outs = sig.getSqlOuts();
1938  out_names = sig.getOutNames();
1939  arg_names = sig.getArgNames();
1940  options = sig.getOptions();
1941  }
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

Member Function Documentation

Set<RelColumnMapping> com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.getColumnMappings ( )
inline

Definition at line 1953 of file MapDSqlOperatorTable.java.

References Integer, and com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.options.

1953  {
1954  Set<RelColumnMapping> s = new HashSet<RelColumnMapping>();
1955  if (Integer.valueOf(options.getOrDefault("filter_table_function_transpose", "0"))
1956  == 1) {
1957  for (int arg_idx = 0; arg_idx < arg_names.size(); ++arg_idx) {
1958  String arg_name = arg_names.get(arg_idx);
1959  String[] fields;
1960  int start = arg_name.indexOf("[");
1961  if (start != -1) {
1962  int end = arg_name.lastIndexOf("]");
1963  fields = arg_name.substring(start, end).replaceAll("\\s+", "").split(",", 0);
1964  } else {
1965  fields = new String[] {arg_name};
1966  }
1967  for (int field_idx = 0; field_idx < fields.length; ++field_idx) {
1968  int out_idx = out_names.indexOf(fields[field_idx]);
1969  if (out_idx >= 0) {
1970  s.add(new RelColumnMapping(out_idx, arg_idx, field_idx, false));
1971  }
1972  }
1973  }
1974  }
1975  return s;
1976  }
SqlReturnTypeInference com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.getRowTypeInference ( )
inline

Definition at line 1944 of file MapDSqlOperatorTable.java.

References com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.outs.

1944  {
1945  return opBinding -> {
1946  FieldInfoBuilder ret = opBinding.getTypeFactory().builder();
1947  for (int out_idx = 0; out_idx < outs.size(); ++out_idx) {
1948  ret = ret.add(out_names.get(out_idx), outs.get(out_idx));
1949  }
1950  return ret.build();
1951  };
1952  }

Member Data Documentation

final List<String> com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.arg_names
private
final Map<String, String> com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.options
private
final List<String> com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.out_names
private
final List<SqlTypeName> com.mapd.calcite.parser.MapDSqlOperatorTable.ExtTableFunction.outs
private

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