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

Public Member Functions

def visit_udtf_node
 
- Public Member Functions inherited from TableFunctionsFactory_transformers.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 TableFunctionsFactory_transformers.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 252 of file TableFunctionsFactory_transformers.py.

Member Function Documentation

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

Definition at line 253 of file TableFunctionsFactory_transformers.py.

References run_benchmark_import.type.

254  def visit_udtf_node(self, udtf_node):
255  """
256  * Add default_input_id to Column(List)<TextEncodingDict> without one
257  """
258  udtf_node = super(type(self), self).visit_udtf_node(udtf_node)
259  # add default input_id
260  default_input_id = None
261  for idx, t in enumerate(udtf_node.inputs):
262 
263  if not isinstance(t.type, tf_node.ComposedNode):
264  continue
265  if default_input_id is not None:
266  pass
267  elif t.type.is_column_text_encoding_dict() or t.type.is_column_array_text_encoding_dict():
268  default_input_id = tf_node.AnnotationNode('input_id', 'args<%s>' % (idx,))
269  elif t.type.is_column_list_text_encoding_dict():
270  default_input_id = tf_node.AnnotationNode('input_id', 'args<%s, 0>' % (idx,))
271 
272  for t in udtf_node.outputs:
273  if isinstance(t.type, tf_node.ComposedNode) and t.type.is_any_text_encoding_dict():
274  for a in t.annotations:
275  if a.key == 'input_id':
276  break
277  else:
278  if default_input_id is None:
279  raise TypeError('Cannot parse line "%s".\n'
280  'Missing TextEncodingDict input?' %
281  (udtf_node.line))
282  t.annotations.append(default_input_id)
283 
284  return udtf_node
285 

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