OmniSciDB  91042dcc5b
 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 822 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 823 of file generate_TableFunctionsFactory_init.py.

References run_benchmark_import.type.

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

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