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

Member Function Documentation

def generate_TableFunctionsFactory_init.TemplateTransformer.visit_composed_node (   self,
  composed_node 
)

Definition at line 797 of file generate_TableFunctionsFactory_init.py.

798  def visit_composed_node(self, composed_node):
799  typ = composed_node.type
800  typ = self.mapping_dict.get(typ, typ)
801 
802  inner = [i.accept(self) for i in composed_node.inner]
803  return composed_node.copy(typ, inner)
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_primitive_node (   self,
  primitive_node 
)

Definition at line 804 of file generate_TableFunctionsFactory_init.py.

805  def visit_primitive_node(self, primitive_node):
806  typ = primitive_node.type
807  typ = self.mapping_dict.get(typ, typ)
808  return primitive_node.copy(typ)
809 
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_udtf_node (   self,
  udtf_node 
)

Definition at line 773 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.product_dict().

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

+ Here is the call graph for this function:

Member Data Documentation

generate_TableFunctionsFactory_init.TemplateTransformer.mapping_dict

Definition at line 783 of file generate_TableFunctionsFactory_init.py.


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