org.apache.hadoop.zebra.types
Class Projection

java.lang.Object
  extended by org.apache.hadoop.zebra.types.Projection

public class Projection
extends Object

Projection for Table and Column Group


Field Summary
static String source_table_vcolumn_name
           
 
Constructor Summary
Projection(Schema s)
          ctor for full projection
Projection(Schema s, String projection)
          ctor for partial projection
 
Method Summary
static int getColumnIndex(String projection, String colname)
          Get a column's index in a projection.
 Schema.ColumnSchema getColumnSchema(int i)
          Get a particular projected column's schema
 int getNumColumns()
          Get number of columns in the projection
static int getNumColumns(String projection)
          Get number of columns from a projection string
 Schema getProjectionSchema()
           
static String getProjectionStr(String[] names)
          Get a projection string from a series of column names
 Schema getSchema()
          accessor to the projected schema including invalid columns
static Integer[] getVirtualColumnIndices(String projection)
          Get the indices of all virtual columns
static boolean isVirtualColumn(String name)
          if a column name is on a virtual column
static Schema toSchema(String projection)
          Get schema from a projection string: all map keys are lost
 String toString()
          Get the string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source_table_vcolumn_name

public static final String source_table_vcolumn_name
See Also:
Constant Field Values
Constructor Detail

Projection

public Projection(Schema s)
ctor for full projection


Projection

public Projection(Schema s,
                  String projection)
           throws ParseException
ctor for partial projection

Throws:
ParseException
Method Detail

isVirtualColumn

public static boolean isVirtualColumn(String name)
if a column name is on a virtual column


getVirtualColumnIndices

public static Integer[] getVirtualColumnIndices(String projection)
Get the indices of all virtual columns


getSchema

public Schema getSchema()
accessor to the projected schema including invalid columns


getProjectionSchema

public Schema getProjectionSchema()

getColumnSchema

public Schema.ColumnSchema getColumnSchema(int i)
Get a particular projected column's schema


toString

public String toString()
Get the string representation

Overrides:
toString in class Object

getNumColumns

public int getNumColumns()
Get number of columns in the projection


getNumColumns

public static int getNumColumns(String projection)
Get number of columns from a projection string


getProjectionStr

public static String getProjectionStr(String[] names)
Get a projection string from a series of column names


toSchema

public static Schema toSchema(String projection)
                       throws ParseException
Get schema from a projection string: all map keys are lost

Throws:
ParseException

getColumnIndex

public static int getColumnIndex(String projection,
                                 String colname)
Get a column's index in a projection.

Parameters:
projection -
colname -
Returns:
-1 if the column is not found in projection


Copyright © ${year} The Apache Software Foundation