OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generate_TableFunctionsFactory_init.TextEncodingDictTransformer Class Reference
+ Inheritance diagram for generate_TableFunctionsFactory_init.TextEncodingDictTransformer:
+ Collaboration diagram for generate_TableFunctionsFactory_init.TextEncodingDictTransformer:

Public Member Functions

def visit_udtf_node
 
- Public Member Functions inherited from generate_TableFunctionsFactory_init.AstTransformer
def visit_udtf_node
 
def visit_composed_node
 
def visit_arg_node
 
def visit_primitive_node
 
def visit_template_node
 
def visit_annotation_node
 
- Public Member Functions inherited from generate_TableFunctionsFactory_init.AstVisitor
def visit_udtf_node
 
def visit_composed_node
 
def visit_arg_node
 
def visit_primitive_node
 
def visit_annotation_node
 
def visit_template_node
 

Detailed Description

Definition at line 840 of file generate_TableFunctionsFactory_init.py.

Member Function Documentation

def generate_TableFunctionsFactory_init.TextEncodingDictTransformer.visit_udtf_node (   self,
  udtf_node 
)
* Add default_input_id to Column(List)<TextEncodingDict> without one

Definition at line 841 of file generate_TableFunctionsFactory_init.py.

References run_benchmark_import.type.

842  def visit_udtf_node(self, udtf_node):
843  """
844  * Add default_input_id to Column(List)<TextEncodingDict> without one
845  """
846  udtf_node = super(type(self), self).visit_udtf_node(udtf_node)
847  # add default input_id
848  default_input_id = None
849  for idx, t in enumerate(udtf_node.inputs):
850 
851  if not isinstance(t.type, ComposedNode):
852  continue
853  if default_input_id is not None:
854  pass
855  elif t.type.is_column_text_encoding_dict() or t.type.is_column_array_text_encoding_dict():
856  default_input_id = AnnotationNode('input_id', 'args<%s>' % (idx,))
857  elif t.type.is_column_list_text_encoding_dict():
858  default_input_id = AnnotationNode('input_id', 'args<%s, 0>' % (idx,))
859 
860  for t in udtf_node.outputs:
861  if isinstance(t.type, ComposedNode) and t.type.is_any_text_encoding_dict():
862  for a in t.annotations:
863  if a.key == 'input_id':
864  break
865  else:
866  if default_input_id is None:
867  raise TypeError('Cannot parse line "%s".\n'
868  'Missing TextEncodingDict input?' %
869  (udtf_node.line))
870  t.annotations.append(default_input_id)
871 
872  return udtf_node
873 

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