OmniSciDB  ca0c39ec8f
 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 836 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 837 of file generate_TableFunctionsFactory_init.py.

References run_benchmark_import.type.

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

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