OmniSciDB  cde582ebc3
 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 824 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 825 of file generate_TableFunctionsFactory_init.py.

References run_benchmark_import.type.

826  def visit_udtf_node(self, udtf_node):
827  """
828  * Add default_input_id to Column(List)<TextEncodingDict> without one
829  """
830  udtf_node = super(type(self), self).visit_udtf_node(udtf_node)
831 
832  # add default input_id
833  default_input_id = None
834  for idx, t in enumerate(udtf_node.inputs):
835 
836  if not isinstance(t.type, ComposedNode):
837  continue
838  if default_input_id is not None:
839  pass
840  elif t.type.is_column_text_encoding_dict():
841  default_input_id = AnnotationNode('input_id', 'args<%s>' % (idx,))
842  elif t.type.is_column_list_text_encoding_dict():
843  default_input_id = AnnotationNode('input_id', 'args<%s, 0>' % (idx,))
844 
845  for t in udtf_node.outputs:
846  if isinstance(t.type, ComposedNode) and t.type.is_any_text_encoding_dict():
847  for a in t.annotations:
848  if a.key == 'input_id':
849  break
850  else:
851  if default_input_id is None:
852  raise TypeError('Cannot parse line "%s".\n'
853  'Missing TextEncodingDict input?' %
854  (udtf_node.line))
855  t.annotations.append(default_input_id)
856 
857  return udtf_node
858 

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