org.apache.pig.newplan.logical
Class Util

java.lang.Object
  extended by org.apache.pig.newplan.logical.Util

public class Util
extends Object


Constructor Summary
Util()
           
 
Method Summary
static LOForEach addForEachAfter(LogicalPlan plan, LogicalRelationalOperator op, int branch, Set<Integer> columnsToDrop)
           
static Schema fixSchemaAddTupleInBag(Schema sch)
          If schema argument has fields where a bag does not contain a tuple schema, it inserts a tuple schema.
static
<C extends LogicalRelationalOperator>
LinkedList<C>
getLogicalRelationalOperators(LogicalPlan plan, Class<C> opClass)
          Returns a LinkedList of operators contained within the physical plan which implement the supplied class, in dependency order.
static Schema.FieldSchema translateFieldSchema(LogicalSchema.LogicalFieldSchema fs)
           
static LogicalSchema.LogicalFieldSchema translateFieldSchema(Schema.FieldSchema fs)
           
static Schema translateSchema(LogicalSchema schema)
          This function translates the new LogicalSchema into old Schema format required by PhysicalOperators
static LogicalSchema translateSchema(Schema schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

translateSchema

public static LogicalSchema translateSchema(Schema schema)

translateFieldSchema

public static LogicalSchema.LogicalFieldSchema translateFieldSchema(Schema.FieldSchema fs)

translateSchema

public static Schema translateSchema(LogicalSchema schema)
This function translates the new LogicalSchema into old Schema format required by PhysicalOperators

Parameters:
schema - LogicalSchema to be converted to Schema
Returns:
Schema that is converted from LogicalSchema
Throws:
FrontendException

fixSchemaAddTupleInBag

public static Schema fixSchemaAddTupleInBag(Schema sch)
                                     throws FrontendException
If schema argument has fields where a bag does not contain a tuple schema, it inserts a tuple schema. It does so for all inner levels. eg bag({int}) => bag({(int)})

Parameters:
sch -
Returns:
modified schema
Throws:
FrontendException

translateFieldSchema

public static Schema.FieldSchema translateFieldSchema(LogicalSchema.LogicalFieldSchema fs)

addForEachAfter

public static LOForEach addForEachAfter(LogicalPlan plan,
                                        LogicalRelationalOperator op,
                                        int branch,
                                        Set<Integer> columnsToDrop)
                                 throws FrontendException
Throws:
FrontendException

getLogicalRelationalOperators

public static <C extends LogicalRelationalOperator> LinkedList<C> getLogicalRelationalOperators(LogicalPlan plan,
                                                                                                Class<C> opClass)
                                                                                     throws FrontendException
Returns a LinkedList of operators contained within the physical plan which implement the supplied class, in dependency order. Returns an empty LinkedList of no such operators exist.

Parameters:
plan -
opClass -
Returns:
a LinkedList of operators contained within the plan which implement the supplied class; empty if no such ops exist.
Throws:
FrontendException


Copyright © 2007-2012 The Apache Software Foundation