Package com.illumon.iris.db.v2
Class TreeTableOrphanPromoter
java.lang.Object
com.illumon.iris.db.v2.TreeTableOrphanPromoter
public class TreeTableOrphanPromoter extends Object implements com.fishlib.base.Function.Unary<Table,Table>
Identify orphan rows in a table destined for conversion into a tree table, and mask their parent column value to null, so that they show up at the top level of the hierarchy.
This is useful if your data contains values which you can not identify as top-level rows; or if you would like to filter your tree table source, excluding parents which do not meet your filter criteria, but do not want to orphan the matches.
This class should be used by calling promoteOrphans(Table, String, String)
method.
-
Method Details
-
call
-
promoteOrphans
Convert a table with orphans to one without.- Parameters:
table
- the input table to operate onidColumn
- the column containing each row's unique IDparentColumn
- the column containing the parent for this row; null for top-level rows- Returns:
- a table where parentColumn is null if the original parent did not appear in the IDs
-