|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.data.join.JoinedTable
public class JoinedTable
Creates new table by appending all columns from right table to the left table. This, of course, only if both table agree on the row keys.
What is worth to notice about the order: Ideally, the order in both tables is the same. If that is not the case, the order of the left table is the one that counts, followed by the ones that are in the right table but not in the left one.
If any table contains row keys that the other does not, the columns provided
by the respectively other table are filled with missing cells. If the column
type is one of DoubleCell
,
IntCell
or
StringCell
, the singleton instances of
missing cells (No, it is not missing, but declared as having a missing
value). Otherwise, this implementation will throw an exception during the
iteration, saying that it cannot instantiate a missing cell. (If it could do
so, it would still violate the column type given in table spec.)
Field Summary | |
---|---|
static String |
METHOD_APPEND_SUFFIX
Method on how to treat duplicate column names: append suffix. |
static String |
METHOD_FAIL
Method on how to treat duplicate column names: fail execution. |
static String |
METHOD_FILTER
Method on how to treat duplicate column names: filter. |
Constructor Summary | |
---|---|
JoinedTable(DataTable left,
DataTable right)
Creates new table with the left part defined by left and
the appended right part given by right . |
|
JoinedTable(DataTable left,
DataTable right,
String duplicateMethod,
String suffix,
boolean inMemory)
Creates a new table with the left part defined by left and
the appended right part given by right . |
Method Summary | |
---|---|
static DataCell[] |
createMissingCells(DataTableSpec spec)
Fills an array with missing values according to the spec. |
static DataTableSpec |
createSpec(DataTableSpec left,
DataTableSpec right)
Creates a new DataTableSpec as an result of merging a left
and a right table. |
static DataTableSpec |
createSpec(DataTableSpec left,
DataTableSpec right,
String duplicateMethod,
String suffix)
Creates a new DataTableSpec as an result of merging a left
and a right table. |
DataTableSpec |
getDataTableSpec()
Returns the DataTableSpec object of this table which gives
information about the structure of this data table. |
protected DataTable |
getLeftTable()
Get reference to underlying left table. |
protected DataTable |
getRightTable()
Get reference to underlying right table. |
(package private) boolean |
isPrintedErrorOnMissing()
Requested by iterated. |
(package private) boolean |
isPrintedErrorOnSorting()
Requested by iterated. |
RowIterator |
iterator()
Returns a row iterator which returns each row one-by-one from the table. |
(package private) void |
setPrintedErrorOnMissing(boolean printedErrorOnMissing)
|
(package private) void |
setPrintedErrorOnSorting(boolean printedErrorOnSorting)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String METHOD_FAIL
public static final String METHOD_FILTER
public static final String METHOD_APPEND_SUFFIX
Constructor Detail |
---|
public JoinedTable(DataTable left, DataTable right)
left
and
the appended right part given by right
. If duplicate
column names occur, an exception is thrown
left
- the left part of the this tableright
- and the corresponding right part
IllegalArgumentException
- if the tables contain the same column
identifier
NullPointerException
- if either table is null
IllegalArgumentException
- if duplicate column names existpublic JoinedTable(DataTable left, DataTable right, String duplicateMethod, String suffix, boolean inMemory)
left
and
the appended right part given by right
. Duplicate column
names are treated as given by the duplicateMethod
argument, i.e.
METHOD_FAIL
throw exceptionMETHOD_FILTER
ignore duplicates in the right columnMETHOD_APPEND_SUFFIX
append a suffix given by the
suffix
argument to occuring duplicates
left
- the left part of the this tableright
- and the corresponding right partduplicateMethod
- the method on how to treat duplicatessuffix
- the suffix that is used when the method is
METHOD_APPEND_SUFFIX
. In case of another any other
method this argument is ignored.inMemory
- true
if the tables should be joined in
memory (faster but may need much memory)
IllegalArgumentException
- in case of duplicate column names and no
special treatment is requested
NullPointerException
- if either table is null
Method Detail |
---|
public DataTableSpec getDataTableSpec()
DataTableSpec
object of this table which gives
information about the structure of this data table.
getDataTableSpec
in interface DataTable
public RowIterator iterator()
iterator
in interface Iterable<DataRow>
iterator
in interface DataTable
DataRow
protected DataTable getLeftTable()
protected DataTable getRightTable()
public static final DataTableSpec createSpec(DataTableSpec left, DataTableSpec right)
left
and a right
table. The method fails with an exception when
there are duplicate column names
left
- the left part of the this tableright
- the corresponding right part
IllegalArgumentException
- in case of duplicate column names and no
special treatment is requested
NullPointerException
- if either table is null
public static final DataTableSpec createSpec(DataTableSpec left, DataTableSpec right, String duplicateMethod, String suffix)
left
and a right
table. Duplicate of column names are treated
as given by the duplicateMethod
argument, i.e.
METHOD_FAIL
throw exceptionMETHOD_FILTER
ignore duplicates in the right columnMETHOD_APPEND_SUFFIX
append a suffix given by the
suffix
argument to occuring duplicates
left
- the left part of the this tableright
- and the corresponding right partduplicateMethod
- the method on how to treat duplicatessuffix
- the suffix that is used when the method is
METHOD_APPEND_SUFFIX
. In case of another any other
method this argument is ignored.
IllegalArgumentException
- in case of duplicate column names and no
special treatment is requested
NullPointerException
- if either table is null
boolean isPrintedErrorOnMissing()
void setPrintedErrorOnMissing(boolean printedErrorOnMissing)
printedErrorOnMissing
- the printedErrorOnMissing to setboolean isPrintedErrorOnSorting()
void setPrintedErrorOnSorting(boolean printedErrorOnSorting)
printedErrorOnSorting
- the printedErrorOnSorting to setpublic static DataCell[] createMissingCells(DataTableSpec spec)
spec
- the spec of the table
IllegalStateException
- if no missing cell can be instantiated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |