OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generate_TableFunctionsFactory_init Namespace Reference

Classes

class  Declaration
 
class  Bracket
 
class  TokenizeException
 
class  ParserException
 
class  TransformerException
 
class  Token
 
class  Tokenize
 
class  AstVisitor
 
class  AstTransformer
 
class  AstPrinter
 
class  AstDebugger
 
class  TemplateTransformer
 
class  FixRowMultiplierPosArgTransformer
 
class  RenameNodesTransformer
 
class  TextEncodingDictTransformer
 
class  FieldAnnotationTransformer
 
class  SupportedAnnotationsTransformer
 
class  RangeAnnotationTransformer
 
class  DeclBracketTransformer
 
class  Node
 
class  IterableNode
 
class  UdtfNode
 
class  ArgNode
 
class  TypeNode
 
class  PrimitiveNode
 
class  ComposedNode
 
class  AnnotationNode
 
class  TemplateNode
 
class  Pipeline
 
class  Parser
 

Functions

def tostring
 
def find_comma
 
def line_is_incomplete
 
def is_identifier_cursor
 
def product_dict
 
def find_signatures
 
def format_function_args
 
def build_template_function_call
 
def build_preflight_function
 
def must_emit_preflight_function
 
def format_annotations
 
def is_template_function
 
def uses_manager
 
def is_cpu_function
 
def is_gpu_function
 
def parse_annotations
 
def add_method
 
def add_methods
 
def call_methods
 

Variables

string separator = '$=>$'
 
tuple Signature = namedtuple('Signature', ['name', 'inputs', 'outputs', 'input_annotations', 'output_annotations', 'function_annotations', 'sizer'])
 
string OutputBufferSizeTypes
 
string SupportedAnnotations
 
string SupportedFunctionAnnotations
 
tuple translate_map
 
list input_files = [os.path.join(os.path.dirname(__file__), 'test_udtf_signatures.hpp')]
 
tuple cpu_output_header = os.path.splitext(output_filename)
 
tuple gpu_output_header = os.path.splitext(output_filename)
 
list canonical_input_files = [input_file[input_file.find("/QueryEngine/") + 1:] for input_file in input_files]
 
list header_includes = ['#include "' + canonical_input_file + '"' for canonical_input_file in canonical_input_files]
 
int ADD_FUNC_CHUNK_SIZE = 100
 
string content
 
string header_content
 
tuple dirname = os.path.dirname(output_filename)
 
tuple f = open(output_filename, 'w')
 

Detailed Description

Given a list of input files, scan for lines containing UDTF
specification statements in the following form:

  UDTF: function_name(<arguments>) -> <output column types> (, <template type specifications>)?

where <arguments> is a comma-separated list of argument types. The
argument types specifications are:

- scalar types:
    Int8, Int16, Int32, Int64, Float, Double, Bool, TextEncodingDict, etc
- column types:
    ColumnInt8, ColumnInt16, ColumnInt32, ColumnInt64, ColumnFloat, ColumnDouble, ColumnBool, etc
- column list types:
    ColumnListInt8, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListFloat, ColumnListDouble, ColumnListBool, etc
- cursor type:
    Cursor<t0, t1, ...>
  where t0, t1 are column or column list types
- output buffer size parameter type:
    RowMultiplier<i>, ConstantParameter<i>, Constant<i>, TableFunctionSpecifiedParameter<i>
  where i is a literal integer.

The output column types is a comma-separated list of column types, see above.

In addition, the following equivalents are suppored:

  Column<T> == ColumnT
  ColumnList<T> == ColumnListT
  Cursor<T, V, ...> == Cursor<ColumnT, ColumnV, ...>
  int8 == int8_t == Int8, etc
  float == Float, double == Double, bool == Bool
  T == ColumnT for output column types
  RowMultiplier == RowMultiplier<i> where i is the one-based position of the sizer argument
  when no sizer argument is provided, Constant<1> is assumed

Argument types can be annotated using `|' (bar) symbol after an
argument type specification. An annotation is specified by a label and
a value separated by `=' (equal) symbol. Multiple annotations can be
specified by using `|` (bar) symbol as the annotations separator.
Supported annotation labels are:

- name: to specify argument name
- input_id: to specify the dict id mapping for output TextEncodingDict columns.

If argument type follows an identifier, it will be mapped to name
annotations. For example, the following argument type specifications
are equivalent:

  Int8 a
  Int8 | name=a

Template type specifications is a comma separated list of template
type assignments where values are lists of argument type names. For
instance:

  T = [Int8, Int16, Int32, Float], V = [Float, Double]

Function Documentation

def generate_TableFunctionsFactory_init.add_method (   i,
  chunk 
)

Definition at line 2005 of file generate_TableFunctionsFactory_init.py.

References join().

Referenced by add_methods().

2006 def add_method(i, chunk):
2007  return '''
2008  NO_OPT_ATTRIBUTE void add_table_functions_%d() const {
2009  %s
2010  }
2011 ''' % (i, '\n '.join(chunk))
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.add_methods (   add_stmts)

Definition at line 2012 of file generate_TableFunctionsFactory_init.py.

References add_method().

2013 def add_methods(add_stmts):
2014  chunks = [ add_stmts[n:n+ADD_FUNC_CHUNK_SIZE] for n in range(0, len(add_stmts), ADD_FUNC_CHUNK_SIZE) ]
2015  return [ add_method(i,chunk) for i,chunk in enumerate(chunks) ]

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.build_preflight_function (   fn_name,
  sizer,
  input_types,
  output_types,
  uses_manager 
)

Definition at line 1770 of file generate_TableFunctionsFactory_init.py.

References format_function_args().

Referenced by parse_annotations().

1771 def build_preflight_function(fn_name, sizer, input_types, output_types, uses_manager):
1772 
1773  def format_error_msg(err_msg, uses_manager):
1774  if uses_manager:
1775  return " return mgr.error_message(%s);\n" % (err_msg,)
1776  else:
1777  return " return table_function_error(%s);\n" % (err_msg,)
1778 
1779  cpp_args, _ = format_function_args(input_types,
1780  output_types,
1781  uses_manager,
1782  use_generic_arg_name=False,
1783  emit_output_args=False)
1784 
1785  if uses_manager:
1786  fn = "EXTENSION_NOINLINE int32_t\n"
1787  fn += "%s(%s) {\n" % (fn_name.lower() + "__preflight", cpp_args)
1788  else:
1789  fn = "EXTENSION_NOINLINE int32_t\n"
1790  fn += "%s(%s) {\n" % (fn_name.lower() + "__preflight", cpp_args)
1791 
1792  for typ in input_types:
1793  if isinstance(typ, Declaration):
1794  ann = typ.annotations
1795  for key, value in ann:
1796  if key == 'require':
1797  err_msg = '"Constraint `%s` is not satisfied."' % (value[1:-1])
1798 
1799  fn += " if (!(%s)) {\n" % (value[1:-1].replace('\\', ''),)
1800  fn += format_error_msg(err_msg, uses_manager)
1801  fn += " }\n"
1802 
1803  if sizer.is_arg_sizer():
1804  precomputed_nrows = str(sizer.args[0])
1805  if '"' in precomputed_nrows:
1806  precomputed_nrows = precomputed_nrows[1:-1]
1807  # check to see if the precomputed number of rows > 0
1808  err_msg = '"Output size expression `%s` evaluated in a negative value."' % (precomputed_nrows)
1809  fn += " auto _output_size = %s;\n" % (precomputed_nrows)
1810  fn += " if (_output_size < 0) {\n"
1811  fn += format_error_msg(err_msg, uses_manager)
1812  fn += " }\n"
1813  fn += " return _output_size;\n"
1814  else:
1815  fn += " return 0;\n"
1816  fn += "}\n\n"
1817 
1818  return fn
1819 

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.build_template_function_call (   caller,
  called,
  input_types,
  output_types,
  uses_manager 
)

Definition at line 1756 of file generate_TableFunctionsFactory_init.py.

References format_function_args().

Referenced by parse_annotations().

1757 def build_template_function_call(caller, called, input_types, output_types, uses_manager):
1758  cpp_args, name_args = format_function_args(input_types,
1759  output_types,
1760  uses_manager,
1761  use_generic_arg_name=True,
1762  emit_output_args=True)
1763 
1764  template = ("EXTENSION_NOINLINE int32_t\n"
1765  "%s(%s) {\n"
1766  " return %s(%s);\n"
1767  "}\n") % (caller, cpp_args, called, name_args)
1768  return template
1769 

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.call_methods (   add_stmts)

Definition at line 2016 of file generate_TableFunctionsFactory_init.py.

2017 def call_methods(add_stmts):
2018  quot, rem = divmod(len(add_stmts), ADD_FUNC_CHUNK_SIZE)
2019  return [ 'add_table_functions_%d();' % (i) for i in range(quot + int(0 < rem)) ]
def generate_TableFunctionsFactory_init.find_comma (   line)

Definition at line 367 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.parse().

368 def find_comma(line):
369  d = 0
370  for i, c in enumerate(line):
371  if c in '<([{':
372  d += 1
373  elif c in '>)]{':
374  d -= 1
375  elif d == 0 and c == ',':
376  return i
377  return -1
378 

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.find_signatures (   input_file)
Returns a list of parsed UDTF signatures.

Definition at line 1660 of file generate_TableFunctionsFactory_init.py.

References join(), line_is_incomplete(), heavyai.open(), split(), and run_benchmark_import.type.

Referenced by parse_annotations().

1661 def find_signatures(input_file):
1662  """Returns a list of parsed UDTF signatures."""
1663  signatures = []
1664 
1665  last_line = None
1666  for line in open(input_file).readlines():
1667  line = line.strip()
1668  if last_line is not None:
1669  line = last_line + ' ' + line
1670  last_line = None
1671  if not line.startswith('UDTF:'):
1672  continue
1673  if line_is_incomplete(line):
1674  last_line = line
1675  continue
1676  last_line = None
1677  line = line[5:].lstrip()
1678  i = line.find('(')
1679  j = line.find(')')
1680  if i == -1 or j == -1:
1681  sys.stderr.write('Invalid UDTF specification: `%s`. Skipping.\n' % (line))
1682  continue
1683 
1684  expected_result = None
1685  if separator in line:
1686  line, expected_result = line.split(separator, 1)
1687  expected_result = expected_result.strip().split(separator)
1688  expected_result = list(map(lambda s: s.strip(), expected_result))
1689 
1690  ast = Parser(line).parse()
1691 
1692  if expected_result is not None:
1693  # Template transformer expands templates into multiple lines
1694  try:
1695  result = Pipeline(TemplateTransformer,
1696  FieldAnnotationTransformer,
1697  TextEncodingDictTransformer,
1698  SupportedAnnotationsTransformer,
1699  RangeAnnotationTransformer,
1700  FixRowMultiplierPosArgTransformer,
1701  RenameNodesTransformer,
1702  AstPrinter)(ast)
1703  except TransformerException as msg:
1704  result = ['%s: %s' % (type(msg).__name__, msg)]
1705  assert len(result) == len(expected_result), "\n\tresult: %s \n!= \n\texpected: %s" % (
1706  '\n\t\t '.join(result),
1707  '\n\t\t '.join(expected_result)
1708  )
1709  assert set(result) == set(expected_result), "\n\tresult: %s != \n\texpected: %s" % (
1710  '\n\t\t '.join(result),
1711  '\n\t\t '.join(expected_result),
1712  )
1713 
1714  else:
1715  signature = Pipeline(TemplateTransformer,
1716  FieldAnnotationTransformer,
1717  TextEncodingDictTransformer,
1718  SupportedAnnotationsTransformer,
1719  RangeAnnotationTransformer,
1720  FixRowMultiplierPosArgTransformer,
1721  RenameNodesTransformer,
1722  DeclBracketTransformer)(ast)
1723 
1724  signatures.extend(signature)
1725 
1726  return signatures
1727 
std::string join(T const &container, std::string const &delim)
std::vector< std::string > split(std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
split apart a string into a vector of substrings
int open(const char *path, int flags, int mode)
Definition: heavyai_fs.cpp:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.format_annotations (   annotations_)

Definition at line 1830 of file generate_TableFunctionsFactory_init.py.

References join().

Referenced by parse_annotations().

1831 def format_annotations(annotations_):
1832  def fmt(k, v):
1833  # type(v) is not always 'str'
1834  if k == 'require':
1835  return v[1:-1]
1836  return v
1837 
1838  s = "std::vector<std::map<std::string, std::string>>{"
1839  s += ', '.join(('{' + ', '.join('{"%s", "%s"}' % (k, fmt(k, v)) for k, v in a) + '}') for a in annotations_)
1840  s += "}"
1841  return s
1842 
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.format_function_args (   input_types,
  output_types,
  uses_manager,
  use_generic_arg_name,
  emit_output_args 
)

Definition at line 1728 of file generate_TableFunctionsFactory_init.py.

References join().

Referenced by build_preflight_function(), and build_template_function_call().

1729 def format_function_args(input_types, output_types, uses_manager, use_generic_arg_name, emit_output_args):
1730  cpp_args = []
1731  name_args = []
1732 
1733  if uses_manager:
1734  cpp_args.append('TableFunctionManager& mgr')
1735  name_args.append('mgr')
1736 
1737  for idx, typ in enumerate(input_types):
1738  cpp_arg, name = typ.format_cpp_type(idx,
1739  use_generic_arg_name=use_generic_arg_name,
1740  is_input=True)
1741  cpp_args.append(cpp_arg)
1742  name_args.append(name)
1743 
1744  if emit_output_args:
1745  for idx, typ in enumerate(output_types):
1746  cpp_arg, name = typ.format_cpp_type(idx,
1747  use_generic_arg_name=use_generic_arg_name,
1748  is_input=False)
1749  cpp_args.append(cpp_arg)
1750  name_args.append(name)
1751 
1752  cpp_args = ', '.join(cpp_args)
1753  name_args = ', '.join(name_args)
1754  return cpp_args, name_args
1755 
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.is_cpu_function (   sig)

Definition at line 1852 of file generate_TableFunctionsFactory_init.py.

References uses_manager().

Referenced by parse_annotations().

1853 def is_cpu_function(sig):
1854  # Any function that does not have _gpu_ suffix is a cpu function.
1855  i = sig.name.rfind('_gpu_')
1856  if i >= 0 and '__' in sig.name[:i + 1]:
1857  if uses_manager(sig):
1858  raise ValueError('Table function {} with gpu execution target cannot have TableFunctionManager argument'.format(sig.name))
1859  return False
1860  return True
1861 

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.is_gpu_function (   sig)

Definition at line 1862 of file generate_TableFunctionsFactory_init.py.

References uses_manager().

Referenced by parse_annotations().

1863 def is_gpu_function(sig):
1864  # A function with TableFunctionManager argument is a cpu-only function
1865  if uses_manager(sig):
1866  return False
1867  # Any function that does not have _cpu_ suffix is a gpu function.
1868  i = sig.name.rfind('_cpu_')
1869  return not (i >= 0 and '__' in sig.name[:i + 1])
1870 

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.is_identifier_cursor (   identifier)

Definition at line 385 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Parser.parse_composed().

386 def is_identifier_cursor(identifier):
387  return identifier.lower() == 'cursor'
388 
389 
390 # fmt: on
391 

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.is_template_function (   sig)

Definition at line 1843 of file generate_TableFunctionsFactory_init.py.

Referenced by parse_annotations().

1844 def is_template_function(sig):
1845  i = sig.name.rfind('_template')
1846  return i >= 0 and '__' in sig.name[:i + 1]
1847 

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.line_is_incomplete (   line)

Definition at line 379 of file generate_TableFunctionsFactory_init.py.

Referenced by find_signatures().

380 def line_is_incomplete(line):
381  # TODO: try to parse the line to be certain about completeness.
382  # `$=>$' is used to separate the UDTF signature and the expected result
383  return line.endswith(',') or line.endswith('->') or line.endswith(separator) or line.endswith('|')
384 

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.must_emit_preflight_function (   sig,
  sizer 
)

Definition at line 1820 of file generate_TableFunctionsFactory_init.py.

Referenced by parse_annotations().

1821 def must_emit_preflight_function(sig, sizer):
1822  if sizer.is_arg_sizer():
1823  return True
1824  for arg_annotations in sig.input_annotations:
1825  d = dict(arg_annotations)
1826  if 'require' in d.keys():
1827  return True
1828  return False
1829 

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.parse_annotations (   input_files)

Definition at line 1871 of file generate_TableFunctionsFactory_init.py.

References build_preflight_function(), build_template_function_call(), find_signatures(), format_annotations(), is_cpu_function(), is_gpu_function(), is_template_function(), join(), and must_emit_preflight_function().

1872 def parse_annotations(input_files):
1873 
1874  counter = 0
1875 
1876  add_stmts = []
1877  cpu_template_functions = []
1878  gpu_template_functions = []
1879  cpu_function_address_expressions = []
1880  gpu_function_address_expressions = []
1881  cond_fns = []
1882 
1883  for input_file in input_files:
1884  for sig in find_signatures(input_file):
1885 
1886  # Compute sql_types, input_types, and sizer
1887  sql_types_ = []
1888  input_types_ = []
1889  input_annotations = []
1890 
1891  sizer = None
1892  if sig.sizer is not None:
1893  expr = sig.sizer.value
1894  sizer = Bracket('kPreFlightParameter', (expr,))
1895 
1896  uses_manager = False
1897  for i, (t, annot) in enumerate(zip(sig.inputs, sig.input_annotations)):
1898  if t.is_output_buffer_sizer():
1899  if t.is_user_specified():
1900  sql_types_.append(Bracket.parse('int32').normalize(kind='input'))
1901  input_types_.append(sql_types_[-1])
1902  input_annotations.append(annot)
1903  assert sizer is None # exactly one sizer argument is allowed
1904  assert len(t.args) == 1, t
1905  sizer = t
1906  elif t.name == 'Cursor':
1907  for t_ in t.args:
1908  input_types_.append(t_)
1909  input_annotations.append(annot)
1910  sql_types_.append(Bracket('Cursor', args=()))
1911  elif t.name == 'TableFunctionManager':
1912  if i != 0:
1913  raise ValueError('{} must appear as a first argument of {}, but found it at position {}.'.format(t, sig.name, i))
1914  uses_manager = True
1915  else:
1916  input_types_.append(t)
1917  input_annotations.append(annot)
1918  if t.is_column_any():
1919  # XXX: let Bracket handle mapping of column to cursor(column)
1920  sql_types_.append(Bracket('Cursor', args=()))
1921  else:
1922  sql_types_.append(t)
1923 
1924  if sizer is None:
1925  name = 'kTableFunctionSpecifiedParameter'
1926  idx = 1 # this sizer is not actually materialized in the UDTF
1927  sizer = Bracket(name, (idx,))
1928 
1929  assert sizer is not None
1930  ns_output_types = tuple([a.apply_namespace(ns='ExtArgumentType') for a in sig.outputs])
1931  ns_input_types = tuple([t.apply_namespace(ns='ExtArgumentType') for t in input_types_])
1932  ns_sql_types = tuple([t.apply_namespace(ns='ExtArgumentType') for t in sql_types_])
1933 
1934  sig.function_annotations.append(('uses_manager', str(uses_manager).lower()))
1935 
1936  input_types = 'std::vector<ExtArgumentType>{%s}' % (', '.join(map(tostring, ns_input_types)))
1937  output_types = 'std::vector<ExtArgumentType>{%s}' % (', '.join(map(tostring, ns_output_types)))
1938  sql_types = 'std::vector<ExtArgumentType>{%s}' % (', '.join(map(tostring, ns_sql_types)))
1939  annotations = format_annotations(input_annotations + sig.output_annotations + [sig.function_annotations])
1940 
1941  # Notice that input_types and sig.input_types, (and
1942  # similarly, input_annotations and sig.input_annotations)
1943  # have different lengths when the sizer argument is
1944  # Constant or TableFunctionSpecifiedParameter. That is,
1945  # input_types contains all the user-specified arguments
1946  # while sig.input_types contains all arguments of the
1947  # implementation of an UDTF.
1948 
1949  if must_emit_preflight_function(sig, sizer):
1950  fn_name = '%s_%s' % (sig.name, str(counter)) if is_template_function(sig) else sig.name
1951  check_fn = build_preflight_function(fn_name, sizer, input_types_, sig.outputs, uses_manager)
1952  cond_fns.append(check_fn)
1953 
1954  if is_template_function(sig):
1955  name = sig.name + '_' + str(counter)
1956  counter += 1
1957  t = build_template_function_call(name, sig.name, input_types_, sig.outputs, uses_manager)
1958  address_expression = ('avoid_opt_address(reinterpret_cast<void*>(%s))' % name)
1959  if is_cpu_function(sig):
1960  cpu_template_functions.append(t)
1961  cpu_function_address_expressions.append(address_expression)
1962  if is_gpu_function(sig):
1963  gpu_template_functions.append(t)
1964  gpu_function_address_expressions.append(address_expression)
1965  add = ('TableFunctionsFactory::add("%s", %s, %s, %s, %s, %s, /*is_runtime:*/false);'
1966  % (name, sizer.format_sizer(), input_types, output_types, sql_types, annotations))
1967  add_stmts.append(add)
1968 
1969  else:
1970  add = ('TableFunctionsFactory::add("%s", %s, %s, %s, %s, %s, /*is_runtime:*/false);'
1971  % (sig.name, sizer.format_sizer(), input_types, output_types, sql_types, annotations))
1972  add_stmts.append(add)
1973  address_expression = ('avoid_opt_address(reinterpret_cast<void*>(%s))' % sig.name)
1974 
1975  if is_cpu_function(sig):
1976  cpu_function_address_expressions.append(address_expression)
1977  if is_gpu_function(sig):
1978  gpu_function_address_expressions.append(address_expression)
1979 
1980  return add_stmts, cpu_template_functions, gpu_template_functions, cpu_function_address_expressions, gpu_function_address_expressions, cond_fns
1981 
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.product_dict (   kwargs)

Definition at line 767 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.TemplateTransformer.visit_udtf_node().

768 def product_dict(**kwargs):
769  keys = kwargs.keys()
770  vals = kwargs.values()
771  for instance in itertools.product(*vals):
772  yield dict(zip(keys, instance))
773 

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.tostring (   obj)

Definition at line 165 of file generate_TableFunctionsFactory_init.py.

166 def tostring(obj):
167  return obj.tostring()
168 
def generate_TableFunctionsFactory_init.uses_manager (   sig)

Definition at line 1848 of file generate_TableFunctionsFactory_init.py.

Referenced by table_functions::TableFunctionsFactory.add(), is_cpu_function(), is_gpu_function(), com.mapd.parser.server.ExtensionFunctionSignatureParser.toSignature(), and ExtensionFunction.usesManager().

1849 def uses_manager(sig):
1850  return sig.inputs and sig.inputs[0].name == 'TableFunctionManager'
1851 

+ Here is the caller graph for this function:

Variable Documentation

int generate_TableFunctionsFactory_init.ADD_FUNC_CHUNK_SIZE = 100

Definition at line 2003 of file generate_TableFunctionsFactory_init.py.

list generate_TableFunctionsFactory_init.canonical_input_files = [input_file[input_file.find("/QueryEngine/") + 1:] for input_file in input_files]

Definition at line 1999 of file generate_TableFunctionsFactory_init.py.

string generate_TableFunctionsFactory_init.content

Definition at line 2020 of file generate_TableFunctionsFactory_init.py.

tuple generate_TableFunctionsFactory_init.cpu_output_header = os.path.splitext(output_filename)

Definition at line 1993 of file generate_TableFunctionsFactory_init.py.

tuple generate_TableFunctionsFactory_init.dirname = os.path.dirname(output_filename)

Definition at line 2117 of file generate_TableFunctionsFactory_init.py.

tuple generate_TableFunctionsFactory_init.f = open(output_filename, 'w')

Definition at line 2127 of file generate_TableFunctionsFactory_init.py.

tuple generate_TableFunctionsFactory_init.gpu_output_header = os.path.splitext(output_filename)

Definition at line 1994 of file generate_TableFunctionsFactory_init.py.

string generate_TableFunctionsFactory_init.header_content
Initial value:
1 = '''
2 /*
3  This file is generated by %s. Do no edit!
4 */
5 %s
6 
7 %s
8 '''

Definition at line 2108 of file generate_TableFunctionsFactory_init.py.

list generate_TableFunctionsFactory_init.header_includes = ['#include "' + canonical_input_file + '"' for canonical_input_file in canonical_input_files]

Definition at line 2000 of file generate_TableFunctionsFactory_init.py.

list generate_TableFunctionsFactory_init.input_files = [os.path.join(os.path.dirname(__file__), 'test_udtf_signatures.hpp')]

Definition at line 1984 of file generate_TableFunctionsFactory_init.py.

string generate_TableFunctionsFactory_init.OutputBufferSizeTypes
Initial value:
1 = '''
2 kConstant, kUserSpecifiedConstantParameter, kUserSpecifiedRowMultiplier, kTableFunctionSpecifiedParameter, kPreFlightParameter
3 '''

Definition at line 82 of file generate_TableFunctionsFactory_init.py.

string generate_TableFunctionsFactory_init.separator = '$=>$'

Definition at line 78 of file generate_TableFunctionsFactory_init.py.

Referenced by foreign_storage::anonymous_namespace{AbstractFileStorageDataWrapper.cpp}.append_file_path(), ai.heavy.jdbc.HeavyAIEscapeFunctions.appendCall(), foreign_storage::AbstractFileStorageDataWrapper.getFullFilePath(), import_export.import_thread_shapefile(), and pop_n_rows_from_merged_heaps_gpu().

tuple generate_TableFunctionsFactory_init.Signature = namedtuple('Signature', ['name', 'inputs', 'outputs', 'input_annotations', 'output_annotations', 'function_annotations', 'sizer'])

Definition at line 80 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.DeclBracketTransformer.visit_udtf_node().

string generate_TableFunctionsFactory_init.SupportedAnnotations
Initial value:
1 = '''
2 input_id, name, fields, require, range
3 '''

Definition at line 86 of file generate_TableFunctionsFactory_init.py.

string generate_TableFunctionsFactory_init.SupportedFunctionAnnotations
Initial value:
1 = '''
2 filter_table_function_transpose, uses_manager
3 '''

Definition at line 91 of file generate_TableFunctionsFactory_init.py.

tuple generate_TableFunctionsFactory_init.translate_map
Initial value:
1 = dict(
2  Constant='kConstant',
3  PreFlight='kPreFlightParameter',
4  ConstantParameter='kUserSpecifiedConstantParameter',
5  RowMultiplier='kUserSpecifiedRowMultiplier',
6  UserSpecifiedConstantParameter='kUserSpecifiedConstantParameter',
7  UserSpecifiedRowMultiplier='kUserSpecifiedRowMultiplier',
8  TableFunctionSpecifiedParameter='kTableFunctionSpecifiedParameter',
9  short='Int16',
10  int='Int32',
11  long='Int64',
12 )

Definition at line 95 of file generate_TableFunctionsFactory_init.py.