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

Public Member Functions

def visit_udtf_node
 
def visit_composed_node
 
def visit_primitive_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
 

Public Attributes

 mapping_dict
 

Detailed Description

Expand template definition into multiple inputs

Definition at line 774 of file generate_TableFunctionsFactory_init.py.

Member Function Documentation

def generate_TableFunctionsFactory_init.TemplateTransformer.visit_composed_node (   self,
  composed_node 
)

Definition at line 801 of file generate_TableFunctionsFactory_init.py.

802  def visit_composed_node(self, composed_node):
803  typ = composed_node.type
804  typ = self.mapping_dict.get(typ, typ)
805 
806  inner = [i.accept(self) for i in composed_node.inner]
807  return composed_node.copy(typ, inner)
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_primitive_node (   self,
  primitive_node 
)

Definition at line 808 of file generate_TableFunctionsFactory_init.py.

809  def visit_primitive_node(self, primitive_node):
810  typ = primitive_node.type
811  typ = self.mapping_dict.get(typ, typ)
812  return primitive_node.copy(typ)
813 
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_udtf_node (   self,
  udtf_node 
)

Definition at line 777 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.product_dict().

778  def visit_udtf_node(self, udtf_node):
779  if not udtf_node.templates:
780  return udtf_node
781 
782  udtfs = dict()
783 
784  d = dict([(node.key, node.types) for node in udtf_node.templates])
785  name = udtf_node.name
786 
787  for product in product_dict(**d):
788  self.mapping_dict = product
789  inputs = [input_arg.accept(self) for input_arg in udtf_node.inputs]
790  outputs = [output_arg.accept(self) for output_arg in udtf_node.outputs]
791  udtf = UdtfNode(name, inputs, outputs, udtf_node.annotations, None, udtf_node.sizer, udtf_node.line)
792  udtfs[str(udtf)] = udtf
793  self.mapping_dict = {}
794 
795  udtfs = list(udtfs.values())
796 
797  if len(udtfs) == 1:
798  return udtfs[0]
799 
800  return udtfs

+ Here is the call graph for this function:

Member Data Documentation

generate_TableFunctionsFactory_init.TemplateTransformer.mapping_dict

Definition at line 787 of file generate_TableFunctionsFactory_init.py.


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