org.apache.pig.newplan.logical.relational
Class LogicalSchema

java.lang.Object
  extended by org.apache.pig.newplan.logical.relational.LogicalSchema

public class LogicalSchema
extends Object

Schema, from a logical perspective.


Nested Class Summary
static class LogicalSchema.LogicalFieldSchema
           
 
Constructor Summary
LogicalSchema()
           
 
Method Summary
 void addField(LogicalSchema.LogicalFieldSchema field)
          Add a field to this schema.
 LogicalSchema deepCopy()
           
 int findField(long uid)
          Look for the index of the field that contains the specified uid
 LogicalSchema.LogicalFieldSchema getField(int fieldNum)
          Fetch a field by field number
 LogicalSchema.LogicalFieldSchema getField(String alias)
          Fetch a field by alias
 List<LogicalSchema.LogicalFieldSchema> getFields()
          Get all fields
 boolean isEqual(Object other)
          Two schemas are equal if they are of equal size and their fields schemas considered in order are equal.
 boolean isTwoLevelAccessRequired()
           
static LogicalSchema merge(LogicalSchema s1, LogicalSchema s2)
          Merge two schemas.
 LogicalSchema mergeUid(LogicalSchema uidOnlySchema)
           
 void setTwoLevelAccessRequired(boolean flag)
           
 int size()
          Get the size of the schema.
 String toString()
           
 String toString(boolean verbose)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogicalSchema

public LogicalSchema()
Method Detail

addField

public void addField(LogicalSchema.LogicalFieldSchema field)
Add a field to this schema.

Parameters:
field - to be added to the schema

getField

public LogicalSchema.LogicalFieldSchema getField(String alias)
Fetch a field by alias

Parameters:
alias -
Returns:
field associated with alias, or null if no such field

getField

public LogicalSchema.LogicalFieldSchema getField(int fieldNum)
Fetch a field by field number

Parameters:
fieldNum - field number to fetch
Returns:
field

getFields

public List<LogicalSchema.LogicalFieldSchema> getFields()
Get all fields

Returns:
list of all fields

size

public int size()
Get the size of the schema.

Returns:
size

isEqual

public boolean isEqual(Object other)
Two schemas are equal if they are of equal size and their fields schemas considered in order are equal.


findField

public int findField(long uid)
Look for the index of the field that contains the specified uid

Parameters:
uid - the uid to look for
Returns:
the index of the field, -1 if not found

merge

public static LogicalSchema merge(LogicalSchema s1,
                                  LogicalSchema s2)
                           throws FrontendException
Merge two schemas.

Parameters:
s1 -
s2 -
Returns:
a merged schema, or null if the merge fails
Throws:
FrontendException

toString

public String toString(boolean verbose)

toString

public String toString()
Overrides:
toString in class Object

setTwoLevelAccessRequired

public void setTwoLevelAccessRequired(boolean flag)

isTwoLevelAccessRequired

public boolean isTwoLevelAccessRequired()

mergeUid

public LogicalSchema mergeUid(LogicalSchema uidOnlySchema)
                       throws FrontendException
Throws:
FrontendException

deepCopy

public LogicalSchema deepCopy()


Copyright © ${year} The Apache Software Foundation