|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ebay.erl.mobius.core.function.base.Projectable
com.ebay.erl.mobius.core.function.base.ExtendFunction
com.ebay.erl.mobius.core.model.Column
public class Column
Represents a single column of a Dataset
. An instance of
Column
can be used as projection in the list
,
join
, grouping
, or sorting
jobs.
This product is licensed under the Apache License, Version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0. This product contains portions derived from Apache hadoop which is licensed under the Apache License, Version 2.0, available at http://hadoop.apache.org. © 2007 – 2012 eBay Inc., Evan Chiu, Woody Zhou, Neel Sundaresan
Field Summary | |
---|---|
protected java.lang.String |
columnName
the name of this column |
protected Dataset |
dataset
the Dataset this column belongs to. |
protected java.lang.String |
newName
the new name of this column, specified by user via setNewName(String) |
Fields inherited from class com.ebay.erl.mobius.core.function.base.Projectable |
---|
conf, inputs, outputSchema, reporter, requireDataFromMultiDatasets |
Constructor Summary | |
---|---|
Column(Dataset dataset,
java.lang.String columnName)
Create a column instance that represents a column named columnName in the dataset
. |
Method Summary | |
---|---|
static Column[] |
columns(Dataset dataset,
java.lang.String... columns)
Select multiple columns from a dataset |
boolean |
equals(java.lang.Object obj)
Two columns are equal only if their dataset
are the same (specified by Dataset.equals(Object)),
columnName are the same, and their getOutputName()
also the same. |
Dataset |
getDataset()
Get the Dataset this column belongs to. |
java.lang.String |
getInputColumnName()
Return the original name of this column |
java.lang.String |
getOutputName()
Get the output name of this column, by default, it's the same as it's original name. |
java.lang.String[] |
getOutputSchema()
Always return a size 1 array which contains the result of getOutputName() . |
Tuple |
getResult(Tuple inputRow)
Return a Tuple which contains one single column with the
name of getOutputName() and its value is from the column
named getInputColumnName() in the inputRow . |
int |
hashCode()
|
Column |
setNewName(java.lang.String newName)
Change the output schema name of this column. |
Projectable |
setOutputSchema(java.lang.String... schema)
Deprecated. use setNewName(String) instead. |
static java.lang.String[] |
toSchemaArray(Column... columns)
Get the getOutputName() from the columns
and store then in the returned string array. |
static java.lang.String |
toSchemaString(Column... columns)
Concatenate the getOutputName() from the
columns together and separated by comma. |
java.lang.String |
toString()
|
Methods inherited from class com.ebay.erl.mobius.core.function.base.ExtendFunction |
---|
getNoMatchResult |
Methods inherited from class com.ebay.erl.mobius.core.function.base.Projectable |
---|
calledByCombiner, getConf, getInputColumns, getParticipatedDataset, init, isCombinable, requireDataFromMultiDatasets, setCalledByCombiner, setConf, setReporter, useGroupKeyOnly |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Dataset dataset
Dataset
this column belongs to.
protected java.lang.String columnName
protected java.lang.String newName
setNewName(String)
Constructor Detail |
---|
public Column(Dataset dataset, java.lang.String columnName)
columnName
in the dataset
.
dataset
- a Dataset contains the specified column.columnName
- name of the column
java.lang.IllegalArgumentException
- if the specified columnName
doesn't exist in the dataset
.Method Detail |
---|
public final Projectable setOutputSchema(java.lang.String... schema)
Projectable
setOutputSchema
in class Projectable
public final java.lang.String[] getOutputSchema()
getOutputName()
.
getOutputSchema
in class Projectable
public final Column setNewName(java.lang.String newName)
By default, the output schema of this column is the name specified in the constructor, in the case of select two different columns from two different datasets, and the name of these two columns are the same, one can use this method to change the name of one of the columns to remove ambiguous.
public final Dataset getDataset()
Dataset
this column belongs to.
public java.lang.String toString()
toString
in class Projectable
public int hashCode()
hashCode
in class Projectable
public boolean equals(java.lang.Object obj)
dataset
are the same (specified by Dataset.equals(Object)),
columnName
are the same, and their getOutputName()
also the same.
equals
in class Projectable
public static Column[] columns(Dataset dataset, java.lang.String... columns)
columns
from a dataset
public final java.lang.String getInputColumnName()
public final java.lang.String getOutputName()
public static java.lang.String toSchemaString(Column... columns)
getOutputName()
from the
columns
together and separated by comma.
public static java.lang.String[] toSchemaArray(Column... columns)
getOutputName()
from the columns
and store then in the returned string array.
public Tuple getResult(Tuple inputRow)
Tuple
which contains one single column with the
name of getOutputName()
and its value is from the column
named getInputColumnName()
in the inputRow
.
getResult
in class ExtendFunction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |