OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableFunctionsFactory_declbracket.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 55 of file TableFunctionsFactory_declbracket.py.

Constructor & Destructor Documentation

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

Definition at line 59 of file TableFunctionsFactory_declbracket.py.

59 
60  def __init__(self, name, args=None):
61  assert isinstance(name, str)
62  assert isinstance(args, tuple) or args is None, args
63  self.name = name
64  self.args = args

Member Function Documentation

def TableFunctionsFactory_declbracket.Bracket.__repr__ (   self)

Definition at line 65 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.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.SqlCreateModel.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, TableFunctionsFactory_declbracket.Bracket.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.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.

65 
66  def __repr__(self):
67  return 'Bracket(%r, args=%r)' % (self.name, self.args)
def TableFunctionsFactory_declbracket.Bracket.__str__ (   self)

Definition at line 68 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.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.SqlCreateModel.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, TableFunctionsFactory_declbracket.Bracket.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.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.

68 
69  def __str__(self):
70  if not self.args:
71  return self.name
72  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 TableFunctionsFactory_declbracket.Bracket.apply_column (   self)

Definition at line 106 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.Bracket.is_column(), TableFunctionsFactory_declbracket.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.SqlCreateModel.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, TableFunctionsFactory_declbracket.Bracket.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.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.

107  def apply_column(self):
108  if not self.is_column() and not self.is_column_list():
109  return Bracket('Column' + self.name)
110  return self

+ Here is the call graph for this function:

def TableFunctionsFactory_declbracket.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 93 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.Bracket.is_column().

93 
94  def apply_cursor(self):
95  """Apply cursor to a non-cursor column argument type.
96  TODO: this method is currently unused but we should apply
97  cursor to all input column arguments in order to distingush
98  signatures like:
99  foo(Cursor(Column<int32>, Column<float>)) -> Column<int32>
100  foo(Cursor(Column<int32>), Cursor(Column<float>)) -> Column<int32>
101  that at the moment are treated as the same :(
102  """
103  if self.is_column():
104  return Bracket('Cursor', args=(self,))
105  return self

+ Here is the call graph for this function:

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

Definition at line 111 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.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.SqlCreateModel.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, TableFunctionsFactory_declbracket.Bracket.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.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.

112  def apply_namespace(self, ns='ExtArgumentType'):
113  if self.name == 'Cursor':
114  return Bracket(ns + '::' + self.name, args=tuple(a.apply_namespace(ns=ns) for a in self.args))
115  if not self.name.startswith(ns + '::'):
116  return Bracket(ns + '::' + self.name)
117  return self
def TableFunctionsFactory_declbracket.Bracket.format_cpp_type (   self,
  idx,
  use_generic_arg_name = False,
  real_arg_name = None,
  is_input = True 
)

Definition at line 211 of file TableFunctionsFactory_declbracket.py.

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

212  def format_cpp_type(self, idx, use_generic_arg_name=False, real_arg_name=None, is_input=True):
213  # Arguments that types are derived from arithmetic and bool
214  # types, should be passed by value:
215  pass_by_value_typs =(
216  'bool', 'int8_t', 'int16_t', 'int32_t', 'int64_t', 'float',
217  'double', 'Timestamp', 'DayTimeInterval', 'YearMonthTimeInterval', 'TextEncodingDict')
218  # Arguments that types are of struct type, should be passed by
219  # reference:
220  pass_by_reference_typs =('Column', 'ColumnList', 'TextEncodingNone', 'Array')
221 
222  if use_generic_arg_name:
223  arg_name = 'input' + str(idx) if is_input else 'output' + str(idx)
224  elif real_arg_name is not None:
225  arg_name = real_arg_name
226  else:
227  # in some cases, the real arg name is not specified
228  arg_name = 'input' + str(idx) if is_input else 'output' + str(idx)
229  const = 'const ' if is_input else ''
230  cpp_type = self.get_cpp_type()
231  if any(cpp_type.startswith(t) for t in pass_by_reference_typs):
232  return '%s%s& %s' % (const, cpp_type, arg_name), arg_name
233  elif any(cpp_type.startswith(t) for t in pass_by_value_typs):
234  return '%s %s' % (cpp_type, arg_name), arg_name
235  else:
236  msg =('Argument passing policy for argument `%s` of C++ type `%s` is unspecified.'
237  ' Update pass_by_value_typs or pass_by_reference_typs in'
238  ' Declaration.format_cpp_type to indicate the desired argument'
239  ' passing policy.') %(arg_name, cpp_type)
240  raise NotImplementedError(msg)

+ Here is the call graph for this function:

def TableFunctionsFactory_declbracket.Bracket.format_sizer (   self)

Definition at line 163 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, TableFunctionsFactory_declbracket.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.SqlCreateModel.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, TableFunctionsFactory_declbracket.Bracket.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.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.

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

+ Here is the call graph for this function:

def TableFunctionsFactory_declbracket.Bracket.get_cpp_type (   self)

Definition at line 167 of file TableFunctionsFactory_declbracket.py.

Referenced by TableFunctionsFactory_declbracket.Bracket.format_cpp_type().

168  def get_cpp_type(self):
169  name = self.name.rsplit("::", 1)[-1]
170  clsname = None
171  subclsname = None
172  if name.startswith('ColumnList'):
173  name = name.lstrip('ColumnList')
174  clsname = 'ColumnList'
175  elif name.startswith('Column'):
176  name = name.lstrip('Column')
177  clsname = 'Column'
178  if name.startswith('Array'):
179  name = name.lstrip('Array')
180  if clsname is None:
181  clsname = 'Array'
182  else:
183  subclsname = 'Array'
184 
185  if name.startswith('Bool'):
186  ctype = name.lower()
187  elif name.startswith('Int'):
188  ctype = name.lower() + '_t'
189  elif name in ['Double', 'Float']:
190  ctype = name.lower()
191  elif name == 'TextEncodingDict':
192  ctype = name
193  elif name == 'TextEncodingNone':
194  ctype = name
195  elif name == 'Timestamp':
196  ctype = name
197  elif name == 'DayTimeInterval':
198  ctype = name
199  elif name == 'YearMonthTimeInterval':
200  ctype = name
201  elif name in ['GeoPoint', 'GeoLineString', 'GeoPolygon',
202  'GeoMultiPoint', 'GeoMultiLineString', 'GeoMultiPolygon']:
203  ctype = name
204  else:
205  raise NotImplementedError(self)
206  if clsname is None:
207  return ctype
208  if subclsname is None:
209  return '%s<%s>' % (clsname, ctype)
210  return '%s<%s<%s>>' % (clsname, subclsname, ctype)

+ Here is the caller graph for this function:

def TableFunctionsFactory_declbracket.Bracket.is_any_text_encoding_dict (   self)

Definition at line 133 of file TableFunctionsFactory_declbracket.py.

134  def is_any_text_encoding_dict(self):
135  return self.name.rsplit("::", 1)[-1].endswith('TextEncodingDict')
def TableFunctionsFactory_declbracket.Bracket.is_arg_sizer (   self)

Definition at line 154 of file TableFunctionsFactory_declbracket.py.

Referenced by TableFunctionsFactory_declbracket.Bracket.format_sizer().

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

+ Here is the caller graph for this function:

def TableFunctionsFactory_declbracket.Bracket.is_array (   self)

Definition at line 121 of file TableFunctionsFactory_declbracket.py.

Referenced by TableFunctionsFactory_node.ComposedNode.is_array_text_encoding_dict().

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

+ Here is the caller graph for this function:

def TableFunctionsFactory_declbracket.Bracket.is_array_text_encoding_dict (   self)

Definition at line 136 of file TableFunctionsFactory_declbracket.py.

137  def is_array_text_encoding_dict(self):
138  return self.name.rsplit("::", 1)[-1] == 'ArrayTextEncodingDict'
def TableFunctionsFactory_declbracket.Bracket.is_column (   self)

Definition at line 130 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.Bracket.is_column_list().

Referenced by TableFunctionsFactory_declbracket.Bracket.apply_column(), TableFunctionsFactory_declbracket.Bracket.apply_cursor(), TableFunctionsFactory_node.TypeNode.is_column_any(), TableFunctionsFactory_node.ComposedNode.is_column_array_text_encoding_dict(), TableFunctionsFactory_node.ComposedNode.is_column_of(), and TableFunctionsFactory_node.ComposedNode.is_column_text_encoding_dict().

131  def is_column(self):
132  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 TableFunctionsFactory_declbracket.Bracket.is_column_any (   self)

Definition at line 124 of file TableFunctionsFactory_declbracket.py.

Referenced by TableFunctionsFactory_declbracket.Bracket.normalize().

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

+ Here is the caller graph for this function:

def TableFunctionsFactory_declbracket.Bracket.is_column_array_text_encoding_dict (   self)

Definition at line 142 of file TableFunctionsFactory_declbracket.py.

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

Definition at line 127 of file TableFunctionsFactory_declbracket.py.

Referenced by TableFunctionsFactory_declbracket.Bracket.apply_column(), TableFunctionsFactory_declbracket.Bracket.is_column(), TableFunctionsFactory_node.TypeNode.is_column_any(), TableFunctionsFactory_node.ComposedNode.is_column_list_of(), and TableFunctionsFactory_node.ComposedNode.is_column_list_text_encoding_dict().

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

+ Here is the caller graph for this function:

def TableFunctionsFactory_declbracket.Bracket.is_column_list_text_encoding_dict (   self)

Definition at line 145 of file TableFunctionsFactory_declbracket.py.

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

Definition at line 139 of file TableFunctionsFactory_declbracket.py.

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

Definition at line 118 of file TableFunctionsFactory_declbracket.py.

Referenced by TableFunctionsFactory_node.ComposedNode.cursor_length().

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

+ Here is the caller graph for this function:

def TableFunctionsFactory_declbracket.Bracket.is_output_buffer_sizer (   self)

Definition at line 148 of file TableFunctionsFactory_declbracket.py.

Referenced by TableFunctionsFactory_declbracket.Bracket.is_user_specified().

149  def is_output_buffer_sizer(self):
150  return self.name.rsplit("::", 1)[-1] in util.OutputBufferSizeTypes

+ Here is the caller graph for this function:

def TableFunctionsFactory_declbracket.Bracket.is_row_multiplier (   self)

Definition at line 151 of file TableFunctionsFactory_declbracket.py.

152  def is_row_multiplier(self):
153  return self.name.rsplit("::", 1)[-1] == 'kUserSpecifiedRowMultiplier'
def TableFunctionsFactory_declbracket.Bracket.is_user_specified (   self)

Definition at line 157 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.Bracket.is_output_buffer_sizer().

158  def is_user_specified(self):
159  # Return True if given argument cannot specified by user
160  if self.is_output_buffer_sizer():
161  return self.name.rsplit("::", 1)[-1] not in ('kConstant', 'kTableFunctionSpecifiedParameter', 'kPreFlightParameter')
162  return True

+ Here is the call graph for this function:

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

Definition at line 78 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.Bracket.args, com.mapd.parser.server.ExtensionFunction.args, TableFunctionsFactory_declbracket.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.SqlCreateTable.name, com.mapd.parser.extension.ddl.SqlCreateModel.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, TableFunctionsFactory_declbracket.Bracket.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.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.

78 
79  def normalize(self, kind='input'):
80  """Normalize bracket for given kind
81  """
82  assert kind in ['input', 'output'], kind
83  if self.is_column_any() and self.args:
84  return Bracket(self.name + ''.join(map(str, self.args)))
85  if kind == 'input':
86  if self.name == 'Cursor':
87  args = [(a if a.is_column_any() else Bracket('Column', args=(a,))).normalize(kind=kind) for a in self.args]
88  return Bracket(self.name, tuple(args))
89  if kind == 'output':
90  if not self.is_column_any():
91  return Bracket('Column', args=(self,)).normalize(kind=kind)
92  return self
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

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

Definition at line 242 of file TableFunctionsFactory_declbracket.py.

References strip().

243  def parse(cls, typ):
244  """typ is a string in format NAME<ARGS> or NAME
245  Returns Bracket instance.
246  """
247  i = typ.find('<')
248  if i == -1:
249  name = typ.strip()
250  args = None
251  else:
252  assert typ.endswith('>'), typ
253  name = typ[:i].strip()
254  args = []
255  rest = typ[i + 1:-1].strip()
256  while rest:
257  i = util.find_comma(rest)
258  if i == -1:
259  a, rest = rest, ''
260  else:
261  a, rest = rest[:i].rstrip(), rest[i + 1:].lstrip()
262  args.append(cls.parse(a))
263  args = tuple(args)
264 
265  name = util.translate_map.get(name, name)
266  return cls(name, args)
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 TableFunctionsFactory_declbracket.Bracket.tostring (   self)

Definition at line 73 of file TableFunctionsFactory_declbracket.py.

References TableFunctionsFactory_declbracket.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.SqlCreateModel.name, com.mapd.parser.extension.ddl.SqlKeyConstraint.name, com.mapd.parser.extension.ddl.SqlColumnDeclaration.name, Catalog_Namespace::CustomExpression.name, TableFunctionsFactory_declbracket.Bracket.name, org.apache.calcite.sql.SqlOperator.name, import_export::RasterImporter::ImportBandInfo.name, benchmarks.StringDictionaryBenchmark.name, benchmarks.TPC_DS_10GB.name, CodeGenerator::NullCheckCodegen.name, Function::NamedArg.name, heavydb.extension_functions.ttypes.TUserDefinedFunction.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.

73 
74  def tostring(self):
75  if not self.args:
76  return self.name
77  return '%s<%s>' % (self.name, ', '.join(map(util.tostring, self.args)))
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

Member Data Documentation

TableFunctionsFactory_declbracket.Bracket.args

Definition at line 63 of file TableFunctionsFactory_declbracket.py.

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

TableFunctionsFactory_declbracket.Bracket.name

Definition at line 62 of file TableFunctionsFactory_declbracket.py.

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


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