OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generate_TableFunctionsFactory_init.Bracket Class Reference

Public Member Functions

def __init__
 
def __repr__
 
def __str__
 
def tostring
 
def normalize
 
def apply_cursor
 
def apply_column
 
def apply_namespace
 
def is_cursor
 
def is_array
 
def is_column_any
 
def is_column_list
 
def is_column
 
def is_any_text_encoding_dict
 
def is_array_text_encoding_dict
 
def is_column_text_encoding_dict
 
def is_column_array_text_encoding_dict
 
def is_column_list_text_encoding_dict
 
def is_output_buffer_sizer
 
def is_row_multiplier
 
def is_arg_sizer
 
def is_user_specified
 
def format_sizer
 
def get_cpp_type
 
def format_cpp_type
 
def parse
 

Public Attributes

 name
 
 args
 

Detailed Description

Holds a `NAME<ARGS>`-like structure.

Definition at line 169 of file generate_TableFunctionsFactory_init.py.

Constructor & Destructor Documentation

def generate_TableFunctionsFactory_init.Bracket.__init__ (   self,
  name,
  args = None 
)

Definition at line 173 of file generate_TableFunctionsFactory_init.py.

174  def __init__(self, name, args=None):
175  assert isinstance(name, str)
176  assert isinstance(args, tuple) or args is None, args
177  self.name = name
178  self.args = args

Member Function Documentation

def generate_TableFunctionsFactory_init.Bracket.__repr__ (   self)

Definition at line 179 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, com.mapd.parser.extension.ddl.heavysql.HeavySqlTypeNameSpec.name, com.mapd.parser.extension.ddl.heavysql.HeavySqlColumn.name, com.mapd.parser.extension.ddl.SqlRenameUser.name, com.mapd.parser.extension.ddl.SqlInsertValues.name, com.mapd.parser.extension.ddl.SqlAlterUser.name, com.mapd.parser.extension.ddl.SqlDropUser.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.Answer.name, com.mapd.parser.extension.ddl.SqlDropDB.name, com.mapd.parser.extension.ddl.SqlCreateUser.name, com.mapd.parser.extension.ddl.SqlCreateDB.name, com.mapd.parser.extension.ddl.SqlInsertIntoTable.name, foreign_storage::ForeignServer.name, com.mapd.parser.extension.ddl.SqlCreateDataframe.name, com.mapd.parser.extension.ddl.SqlCheckConstraint.name, com.mapd.parser.extension.ddl.SqlCreateView.name, com.mapd.parser.extension.ddl.SqlAttributeDefinition.name, com.mapd.parser.extension.ddl.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, generate_TableFunctionsFactory_init.Bracket.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedTableFunction.name, ArrowForeignStorage.name, import_export::Importer::GeoFileLayerInfo.name, heavydb.thrift.ttypes.TDashboardGrantees.name, heavydb.thrift.ttypes.TGeoFileLayerInfo.name, and heavydb.thrift.ttypes.TCustomExpression.name.

180  def __repr__(self):
181  return 'Bracket(%r, args=%r)' % (self.name, self.args)
def generate_TableFunctionsFactory_init.Bracket.__str__ (   self)

Definition at line 182 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, join(), com.mapd.parser.extension.ddl.heavysql.HeavySqlTypeNameSpec.name, com.mapd.parser.extension.ddl.heavysql.HeavySqlColumn.name, com.mapd.parser.extension.ddl.SqlRenameUser.name, com.mapd.parser.extension.ddl.SqlInsertValues.name, com.mapd.parser.extension.ddl.SqlAlterUser.name, com.mapd.parser.extension.ddl.SqlDropUser.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.Answer.name, com.mapd.parser.extension.ddl.SqlDropDB.name, com.mapd.parser.extension.ddl.SqlCreateDB.name, com.mapd.parser.extension.ddl.SqlCreateUser.name, com.mapd.parser.extension.ddl.SqlInsertIntoTable.name, foreign_storage::ForeignServer.name, com.mapd.parser.extension.ddl.SqlCreateDataframe.name, com.mapd.parser.extension.ddl.SqlCheckConstraint.name, com.mapd.parser.extension.ddl.SqlCreateView.name, com.mapd.parser.extension.ddl.SqlAttributeDefinition.name, com.mapd.parser.extension.ddl.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, generate_TableFunctionsFactory_init.Bracket.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedTableFunction.name, ArrowForeignStorage.name, import_export::Importer::GeoFileLayerInfo.name, heavydb.thrift.ttypes.TDashboardGrantees.name, heavydb.thrift.ttypes.TGeoFileLayerInfo.name, and heavydb.thrift.ttypes.TCustomExpression.name.

183  def __str__(self):
184  if not self.args:
185  return self.name
186  return '%s<%s>' % (self.name, ', '.join(map(str, self.args)))
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.apply_column (   self)

Definition at line 220 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.is_column(), generate_TableFunctionsFactory_init.Bracket.is_column_list(), com.mapd.parser.extension.ddl.heavysql.HeavySqlTypeNameSpec.name, com.mapd.parser.extension.ddl.heavysql.HeavySqlColumn.name, com.mapd.parser.extension.ddl.SqlRenameUser.name, com.mapd.parser.extension.ddl.SqlInsertValues.name, com.mapd.parser.extension.ddl.SqlAlterUser.name, com.mapd.parser.extension.ddl.SqlDropUser.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.Answer.name, com.mapd.parser.extension.ddl.SqlDropDB.name, com.mapd.parser.extension.ddl.SqlCreateDB.name, com.mapd.parser.extension.ddl.SqlCreateUser.name, com.mapd.parser.extension.ddl.SqlInsertIntoTable.name, foreign_storage::ForeignServer.name, com.mapd.parser.extension.ddl.SqlCreateDataframe.name, com.mapd.parser.extension.ddl.SqlCheckConstraint.name, com.mapd.parser.extension.ddl.SqlCreateView.name, com.mapd.parser.extension.ddl.SqlAttributeDefinition.name, com.mapd.parser.extension.ddl.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, generate_TableFunctionsFactory_init.Bracket.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedTableFunction.name, ArrowForeignStorage.name, import_export::Importer::GeoFileLayerInfo.name, heavydb.thrift.ttypes.TDashboardGrantees.name, heavydb.thrift.ttypes.TGeoFileLayerInfo.name, and heavydb.thrift.ttypes.TCustomExpression.name.

221  def apply_column(self):
222  if not self.is_column() and not self.is_column_list():
223  return Bracket('Column' + self.name)
224  return self

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.apply_cursor (   self)
Apply cursor to a non-cursor column argument type.
TODO: this method is currently unused but we should apply
cursor to all input column arguments in order to distingush
signatures like:
  foo(Cursor(Column<int32>, Column<float>)) -> Column<int32>
  foo(Cursor(Column<int32>), Cursor(Column<float>)) -> Column<int32>
that at the moment are treated as the same :(

Definition at line 207 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.is_column().

208  def apply_cursor(self):
209  """Apply cursor to a non-cursor column argument type.
210  TODO: this method is currently unused but we should apply
211  cursor to all input column arguments in order to distingush
212  signatures like:
213  foo(Cursor(Column<int32>, Column<float>)) -> Column<int32>
214  foo(Cursor(Column<int32>), Cursor(Column<float>)) -> Column<int32>
215  that at the moment are treated as the same :(
216  """
217  if self.is_column():
218  return Bracket('Cursor', args=(self,))
219  return self

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.apply_namespace (   self,
  ns = 'ExtArgumentType' 
)

Definition at line 225 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, com.mapd.parser.extension.ddl.heavysql.HeavySqlTypeNameSpec.name, com.mapd.parser.extension.ddl.heavysql.HeavySqlColumn.name, com.mapd.parser.extension.ddl.SqlRenameUser.name, com.mapd.parser.extension.ddl.SqlInsertValues.name, com.mapd.parser.extension.ddl.SqlAlterUser.name, com.mapd.parser.extension.ddl.SqlDropUser.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.Answer.name, com.mapd.parser.extension.ddl.SqlDropDB.name, com.mapd.parser.extension.ddl.SqlCreateUser.name, com.mapd.parser.extension.ddl.SqlCreateDB.name, com.mapd.parser.extension.ddl.SqlInsertIntoTable.name, foreign_storage::ForeignServer.name, com.mapd.parser.extension.ddl.SqlCreateDataframe.name, com.mapd.parser.extension.ddl.SqlCheckConstraint.name, com.mapd.parser.extension.ddl.SqlCreateView.name, com.mapd.parser.extension.ddl.SqlAttributeDefinition.name, com.mapd.parser.extension.ddl.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, generate_TableFunctionsFactory_init.Bracket.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedTableFunction.name, ArrowForeignStorage.name, import_export::Importer::GeoFileLayerInfo.name, heavydb.thrift.ttypes.TDashboardGrantees.name, heavydb.thrift.ttypes.TGeoFileLayerInfo.name, and heavydb.thrift.ttypes.TCustomExpression.name.

226  def apply_namespace(self, ns='ExtArgumentType'):
227  if self.name == 'Cursor':
228  return Bracket(ns + '::' + self.name, args=tuple(a.apply_namespace(ns=ns) for a in self.args))
229  if not self.name.startswith(ns + '::'):
230  return Bracket(ns + '::' + self.name)
231  return self
def generate_TableFunctionsFactory_init.Bracket.format_cpp_type (   self,
  idx,
  use_generic_arg_name = False,
  real_arg_name = None,
  is_input = True 
)

Definition at line 318 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Declaration.get_cpp_type(), and generate_TableFunctionsFactory_init.Bracket.get_cpp_type().

319  def format_cpp_type(self, idx, use_generic_arg_name=False, real_arg_name=None, is_input=True):
320  col_typs = ('Column', 'ColumnList')
321  literal_ref_typs = ('TextEncodingNone',)
322  if use_generic_arg_name:
323  arg_name = 'input' + str(idx) if is_input else 'output' + str(idx)
324  elif real_arg_name is not None:
325  arg_name = real_arg_name
326  else:
327  # in some cases, the real arg name is not specified
328  arg_name = 'input' + str(idx) if is_input else 'output' + str(idx)
329  const = 'const ' if is_input else ''
330  cpp_type = self.get_cpp_type()
331  if any(cpp_type.startswith(t) for t in col_typs + literal_ref_typs):
332  return '%s%s& %s' % (const, cpp_type, arg_name), arg_name
333  else:
334  return '%s %s' % (cpp_type, arg_name), arg_name

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.format_sizer (   self)

Definition at line 277 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, generate_TableFunctionsFactory_init.Bracket.is_arg_sizer(), com.mapd.parser.extension.ddl.heavysql.HeavySqlTypeNameSpec.name, com.mapd.parser.extension.ddl.heavysql.HeavySqlColumn.name, com.mapd.parser.extension.ddl.SqlRenameUser.name, com.mapd.parser.extension.ddl.SqlInsertValues.name, com.mapd.parser.extension.ddl.SqlAlterUser.name, com.mapd.parser.extension.ddl.SqlDropUser.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.Answer.name, com.mapd.parser.extension.ddl.SqlDropDB.name, com.mapd.parser.extension.ddl.SqlCreateDB.name, com.mapd.parser.extension.ddl.SqlCreateUser.name, com.mapd.parser.extension.ddl.SqlInsertIntoTable.name, foreign_storage::ForeignServer.name, com.mapd.parser.extension.ddl.SqlCreateDataframe.name, com.mapd.parser.extension.ddl.SqlCheckConstraint.name, com.mapd.parser.extension.ddl.SqlCreateView.name, com.mapd.parser.extension.ddl.SqlAttributeDefinition.name, com.mapd.parser.extension.ddl.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, generate_TableFunctionsFactory_init.Bracket.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedTableFunction.name, ArrowForeignStorage.name, import_export::Importer::GeoFileLayerInfo.name, heavydb.thrift.ttypes.TDashboardGrantees.name, heavydb.thrift.ttypes.TGeoFileLayerInfo.name, and heavydb.thrift.ttypes.TCustomExpression.name.

278  def format_sizer(self):
279  val = 0 if self.is_arg_sizer() else self.args[0]
280  return 'TableFunctionOutputRowSizer{OutputBufferSizeType::%s, %s}' % (self.name, val)

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.get_cpp_type (   self)

Definition at line 281 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.format_cpp_type().

282  def get_cpp_type(self):
283  name = self.name.rsplit("::", 1)[-1]
284  clsname = None
285  subclsname = None
286  if name.startswith('ColumnList'):
287  name = name.lstrip('ColumnList')
288  clsname = 'ColumnList'
289  elif name.startswith('Column'):
290  name = name.lstrip('Column')
291  clsname = 'Column'
292  if name.startswith('Array'):
293  name = name.lstrip('Array')
294  if clsname is None:
295  clsname = 'Array'
296  else:
297  subclsname = 'Array'
298 
299  if name.startswith('Bool'):
300  ctype = name.lower()
301  elif name.startswith('Int'):
302  ctype = name.lower() + '_t'
303  elif name in ['Double', 'Float']:
304  ctype = name.lower()
305  elif name == 'TextEncodingDict':
306  ctype = name
307  elif name == 'TextEncodingNone':
308  ctype = name
309  elif name == 'Timestamp':
310  ctype = name
311  else:
312  raise NotImplementedError(self)
313  if clsname is None:
314  return ctype
315  if subclsname is None:
316  return '%s<%s>' % (clsname, ctype)
317  return '%s<%s<%s>>' % (clsname, subclsname, ctype)

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_any_text_encoding_dict (   self)

Definition at line 247 of file generate_TableFunctionsFactory_init.py.

248  def is_any_text_encoding_dict(self):
249  return self.name.rsplit("::", 1)[-1].endswith('TextEncodingDict')
def generate_TableFunctionsFactory_init.Bracket.is_arg_sizer (   self)

Definition at line 268 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.format_sizer().

269  def is_arg_sizer(self):
270  return self.name.rsplit("::", 1)[-1] == 'kPreFlightParameter'

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_array (   self)

Definition at line 235 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.ComposedNode.is_array_text_encoding_dict().

236  def is_array(self):
237  return self.name.rsplit("::", 1)[-1].startswith('Array')

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_array_text_encoding_dict (   self)

Definition at line 250 of file generate_TableFunctionsFactory_init.py.

251  def is_array_text_encoding_dict(self):
252  return self.name.rsplit("::", 1)[-1] == 'ArrayTextEncodingDict'
def generate_TableFunctionsFactory_init.Bracket.is_column (   self)

Definition at line 244 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.is_column_list().

Referenced by generate_TableFunctionsFactory_init.Bracket.apply_column(), generate_TableFunctionsFactory_init.Bracket.apply_cursor(), generate_TableFunctionsFactory_init.TypeNode.is_column_any(), generate_TableFunctionsFactory_init.ComposedNode.is_column_array_text_encoding_dict(), and generate_TableFunctionsFactory_init.ComposedNode.is_column_text_encoding_dict().

245  def is_column(self):
246  return self.name.rsplit("::", 1)[-1].startswith('Column') and not self.is_column_list()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_column_any (   self)

Definition at line 238 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.normalize().

239  def is_column_any(self):
240  return self.name.rsplit("::", 1)[-1].startswith('Column')

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_column_array_text_encoding_dict (   self)

Definition at line 256 of file generate_TableFunctionsFactory_init.py.

258  return self.name.rsplit("::", 1)[-1] == 'ColumnArrayTextEncodingDict'
def generate_TableFunctionsFactory_init.Bracket.is_column_list (   self)

Definition at line 241 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.apply_column(), generate_TableFunctionsFactory_init.Bracket.is_column(), generate_TableFunctionsFactory_init.TypeNode.is_column_any(), and generate_TableFunctionsFactory_init.ComposedNode.is_column_list_text_encoding_dict().

242  def is_column_list(self):
243  return self.name.rsplit("::", 1)[-1].startswith('ColumnList')

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_column_list_text_encoding_dict (   self)

Definition at line 259 of file generate_TableFunctionsFactory_init.py.

261  return self.name.rsplit("::", 1)[-1] == 'ColumnListTextEncodingDict'
def generate_TableFunctionsFactory_init.Bracket.is_column_text_encoding_dict (   self)

Definition at line 253 of file generate_TableFunctionsFactory_init.py.

255  return self.name.rsplit("::", 1)[-1] == 'ColumnTextEncodingDict'
def generate_TableFunctionsFactory_init.Bracket.is_cursor (   self)

Definition at line 232 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.ComposedNode.cursor_length().

233  def is_cursor(self):
234  return self.name.rsplit("::", 1)[-1] == 'Cursor'

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_output_buffer_sizer (   self)

Definition at line 262 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.is_user_specified().

263  def is_output_buffer_sizer(self):
264  return self.name.rsplit("::", 1)[-1] in OutputBufferSizeTypes

+ Here is the caller graph for this function:

def generate_TableFunctionsFactory_init.Bracket.is_row_multiplier (   self)

Definition at line 265 of file generate_TableFunctionsFactory_init.py.

266  def is_row_multiplier(self):
267  return self.name.rsplit("::", 1)[-1] == 'kUserSpecifiedRowMultiplier'
def generate_TableFunctionsFactory_init.Bracket.is_user_specified (   self)

Definition at line 271 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.is_output_buffer_sizer().

272  def is_user_specified(self):
273  # Return True if given argument cannot specified by user
274  if self.is_output_buffer_sizer():
275  return self.name.rsplit("::", 1)[-1] not in ('kConstant', 'kTableFunctionSpecifiedParameter', 'kPreFlightParameter')
276  return True

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.normalize (   self,
  kind = 'input' 
)
Normalize bracket for given kind

Definition at line 192 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, generate_TableFunctionsFactory_init.Bracket.is_column_any(), join(), com.mapd.parser.extension.ddl.heavysql.HeavySqlTypeNameSpec.name, com.mapd.parser.extension.ddl.heavysql.HeavySqlColumn.name, com.mapd.parser.extension.ddl.SqlRenameUser.name, com.mapd.parser.extension.ddl.SqlInsertValues.name, com.mapd.parser.extension.ddl.SqlAlterUser.name, com.mapd.parser.extension.ddl.SqlDropUser.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.Answer.name, com.mapd.parser.extension.ddl.SqlDropDB.name, com.mapd.parser.extension.ddl.SqlCreateDB.name, com.mapd.parser.extension.ddl.SqlCreateUser.name, com.mapd.parser.extension.ddl.SqlInsertIntoTable.name, foreign_storage::ForeignServer.name, com.mapd.parser.extension.ddl.SqlCreateDataframe.name, com.mapd.parser.extension.ddl.SqlCheckConstraint.name, com.mapd.parser.extension.ddl.SqlCreateView.name, com.mapd.parser.extension.ddl.SqlAttributeDefinition.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, generate_TableFunctionsFactory_init.Bracket.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedTableFunction.name, ArrowForeignStorage.name, import_export::Importer::GeoFileLayerInfo.name, heavydb.thrift.ttypes.TDashboardGrantees.name, heavydb.thrift.ttypes.TGeoFileLayerInfo.name, and heavydb.thrift.ttypes.TCustomExpression.name.

193  def normalize(self, kind='input'):
194  """Normalize bracket for given kind
195  """
196  assert kind in ['input', 'output'], kind
197  if self.is_column_any() and self.args:
198  return Bracket(self.name + ''.join(map(str, self.args)))
199  if kind == 'input':
200  if self.name == 'Cursor':
201  args = [(a if a.is_column_any() else Bracket('Column', args=(a,))).normalize(kind=kind) for a in self.args]
202  return Bracket(self.name, tuple(args))
203  if kind == 'output':
204  if not self.is_column_any():
205  return Bracket('Column', args=(self,)).normalize(kind=kind)
206  return self
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.parse (   cls,
  typ 
)
typ is a string in format NAME<ARGS> or NAME

Returns Bracket instance.

Definition at line 336 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.find_comma(), and strip().

337  def parse(cls, typ):
338  """typ is a string in format NAME<ARGS> or NAME
339 
340  Returns Bracket instance.
341  """
342  i = typ.find('<')
343  if i == -1:
344  name = typ.strip()
345  args = None
346  else:
347  assert typ.endswith('>'), typ
348  name = typ[:i].strip()
349  args = []
350  rest = typ[i + 1:-1].strip()
351  while rest:
352  i = find_comma(rest)
353  if i == -1:
354  a, rest = rest, ''
355  else:
356  a, rest = rest[:i].rstrip(), rest[i + 1:].lstrip()
357  args.append(cls.parse(a))
358  args = tuple(args)
359 
360  name = translate_map.get(name, name)
361  return cls(name, args)
362 
std::string strip(std::string_view str)
trim any whitespace from the left and right ends of a string

+ Here is the call graph for this function:

def generate_TableFunctionsFactory_init.Bracket.tostring (   self)

Definition at line 187 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, join(), com.mapd.parser.extension.ddl.heavysql.HeavySqlTypeNameSpec.name, com.mapd.parser.extension.ddl.heavysql.HeavySqlColumn.name, com.mapd.parser.extension.ddl.SqlRenameUser.name, com.mapd.parser.extension.ddl.SqlInsertValues.name, com.mapd.parser.extension.ddl.SqlAlterUser.name, com.mapd.parser.extension.ddl.SqlDropUser.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.Answer.name, com.mapd.parser.extension.ddl.SqlDropDB.name, com.mapd.parser.extension.ddl.SqlCreateDB.name, com.mapd.parser.extension.ddl.SqlCreateUser.name, com.mapd.parser.extension.ddl.SqlInsertIntoTable.name, foreign_storage::ForeignServer.name, com.mapd.parser.extension.ddl.SqlCreateDataframe.name, com.mapd.parser.extension.ddl.SqlCheckConstraint.name, com.mapd.parser.extension.ddl.SqlCreateView.name, com.mapd.parser.extension.ddl.SqlAttributeDefinition.name, com.mapd.parser.extension.ddl.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, generate_TableFunctionsFactory_init.Bracket.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedTableFunction.name, ArrowForeignStorage.name, import_export::Importer::GeoFileLayerInfo.name, heavydb.thrift.ttypes.TDashboardGrantees.name, heavydb.thrift.ttypes.TGeoFileLayerInfo.name, and heavydb.thrift.ttypes.TCustomExpression.name.

188  def tostring(self):
189  if not self.args:
190  return self.name
191  return '%s<%s>' % (self.name, ', '.join(map(tostring, self.args)))
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

Member Data Documentation

generate_TableFunctionsFactory_init.Bracket.args

Definition at line 177 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.__repr__(), generate_TableFunctionsFactory_init.Bracket.__str__(), generate_TableFunctionsFactory_init.Bracket.apply_namespace(), generate_TableFunctionsFactory_init.Bracket.format_sizer(), generate_TableFunctionsFactory_init.Bracket.normalize(), and generate_TableFunctionsFactory_init.Bracket.tostring().

generate_TableFunctionsFactory_init.Bracket.name

Definition at line 176 of file generate_TableFunctionsFactory_init.py.

Referenced by generate_TableFunctionsFactory_init.Bracket.__repr__(), generate_TableFunctionsFactory_init.Bracket.__str__(), generate_TableFunctionsFactory_init.UdtfNode.__str__(), generate_TableFunctionsFactory_init.Bracket.apply_column(), generate_TableFunctionsFactory_init.Bracket.apply_namespace(), generate_TableFunctionsFactory_init.Bracket.format_sizer(), generate_TableFunctionsFactory_init.Bracket.normalize(), and generate_TableFunctionsFactory_init.Bracket.tostring().


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