Package ca.uqac.lif.cep.tuples
Class ExpandAsColumns
- All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable,ca.uqac.lif.cep.functions.DuplicableFunction
Transforms a tuple by replacing two key-value pairs by a single
new key-value pair. The new pair is created by
taking the value of a column as the key, and the value of another
column as the value.
For example, with the tuple: {(foo,1), (bar,2), (baz,3)}, using "foo" as the "key" column and "baz" as the value column, the resulting tuple would be: {(1,3), (bar,2)}. The value of foo is the new key, and the value of baz is the new value.
If the value of the "key" pair is not a string, it is converted
into a string by calling its toString() method (since the
key of a tuple is always a string).
- Author:
- Sylvain Hallé
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe name of the column whose value will be used as a column headerprotected StringThe name of the column whose value will be used as a value for the newly created columnFields inherited from class ca.uqac.lif.cep.functions.Function
s_maxInputArity -
Constructor Summary
ConstructorsConstructorDescriptionExpandAsColumns(String col_name, String col_value) Creates a new instance of the function. -
Method Summary
Methods inherited from class ca.uqac.lif.cep.functions.UnaryFunction
evaluate, getInputArity, getInputTypesFor, getOutputArity, getOutputTypeFor, resetMethods inherited from class ca.uqac.lif.cep.functions.Function
duplicate, evaluate, evaluate, evaluateLazy, evaluatePartial, printState, readState
-
Field Details
-
m_columnName
The name of the column whose value will be used as a column header -
m_columnValue
The name of the column whose value will be used as a value for the newly created column
-
-
Constructor Details
-
ExpandAsColumns
Creates a new instance of the function.- Parameters:
col_name- The name of the column whose value will be used as a column headercol_value- The name of the column whose value will be used as a value for the newly created column
-
-
Method Details