DataFrameJoiner { public Table fullOuter(Table... tables) { return fullOuter(false, tables); } DataFrameJoiner(Table table, String... joinColumnNames); Table inner(Table... tables); Table inner(boolean allowDuplicateColumnNames, Table... tables); Table inner(Table table2, String col2Name); Table inner(Table table2, String[] col2Names); Table inner(Table table2, String col2Name, boolean allowDuplicateColumnNames); Table inner(Table table2, boolean allowDuplicateColumnNames, String... col2Names); Table fullOuter(Table... tables); Table fullOuter(boolean allowDuplicateColumnNames, Table... tables); Table fullOuter(Table table2, String col2Name); Table leftOuter(Table... tables); Table leftOuter(boolean allowDuplicateColumnNames, Table... tables); Table leftOuter(Table table2, String[] col2Names); Table leftOuter(Table table2, String col2Name); Table leftOuter(Table table2, boolean allowDuplicateColumnNames, String... col2Names); Table rightOuter(Table... tables); Table rightOuter(boolean allowDuplicateColumnNames, Table... tables); Table rightOuter(Table table2, String col2Name); Table rightOuter(Table table2, String[] col2Names); Table rightOuter(Table table2, boolean allowDuplicateColumnNames, String... col2Names);  }
@Test public void fullOuterJoinJustTable() { Table joined = ANIMAL_FEED.joinOn("Animal").fullOuter(ANIMAL_NAMES); assertEquals(3, joined.columnCount()); assertEquals(8, joined.rowCount()); assertEquals(8, joined.column("Animal").size()); assertEquals(0, joined.column("Animal").countMissing()); assertEquals(8, joined.column("Name").size()); assertEquals(2, joined.column("Name").countMissing()); assertEquals(8, joined.column("Feed").size()); assertEquals(2, joined.column("Feed").countMissing()); }
@Test public void fullOuterJoin() { Table joined = ANIMAL_FEED.joinOn("Animal").fullOuter(ANIMAL_NAMES, "Animal"); assertEquals(3, joined.columnCount()); assertEquals(8, joined.rowCount()); assertEquals(8, joined.column("Animal").size()); assertEquals(0, joined.column("Animal").countMissing()); assertEquals(8, joined.column("Name").size()); assertEquals(2, joined.column("Name").countMissing()); assertEquals(8, joined.column("Feed").size()); assertEquals(2, joined.column("Feed").countMissing()); }
@Test public void fullOuterJoinColTwoOnlyJoinKeys() { Table joined = ANIMAL_FEED.joinOn("Animal").fullOuter(ANIMAL_NAMES.select("Animal")); assertEquals(2, joined.columnCount()); assertEquals(8, joined.rowCount()); }
@Test public void fullOuterJoinNew() { Table joined = ANIMAL_FEED.joinOn("Animal").fullOuter(true, ANIMAL_NAMES); assertEquals(3, joined.columnCount()); assertEquals(8, joined.rowCount()); assertEquals(8, joined.column("Animal").size()); assertEquals(0, joined.column("Animal").countMissing()); assertEquals(8, joined.column("Name").size()); assertEquals(2, joined.column("Name").countMissing()); assertEquals(8, joined.column("Feed").size()); assertEquals(2, joined.column("Feed").countMissing()); }
@Test public void fullJoinHouseBoatOnBedroomsOwner() { Table table1 = createHOUSE(); Table table2 = createBOAT(); Table joined = table1.joinOn("Bedrooms", "Owner").fullOuter(true, table2); assertEquals(6, joined.columnCount()); assertEquals(7, joined.rowCount()); assertEquals(7, joined.column("Style").size()); assertEquals(3, joined.column("Style").countMissing()); assertEquals(7, joined.column("Bedrooms").size()); assertEquals(0, joined.column("Bedrooms").countMissing()); assertEquals(7, joined.column("BuildDate").size()); assertEquals(3, joined.column("BuildDate").countMissing()); assertEquals(7, joined.column("Owner").size()); assertEquals(0, joined.column("Owner").countMissing()); assertEquals(7, joined.column("Type").size()); assertEquals(2, joined.column("Type").countMissing()); assertEquals(7, joined.column("SoldDate").size()); assertEquals(2, joined.column("SoldDate").countMissing()); }
@Test public void fullJoinHouse10Boat10OnBedroomsOwner() { Table table1 = createHOUSE10(); Table table2 = createBOAT10(); Table joined = table1.joinOn("Bedrooms", "Owner").fullOuter(true, table2); assertEquals(6, joined.columnCount()); assertEquals(11, joined.rowCount()); assertEquals(11, joined.column("Bedrooms").size()); assertEquals(0, joined.column("Bedrooms").countMissing()); assertEquals(11, joined.column("Bedrooms").size()); assertEquals(0, joined.column("Bedrooms").countMissing()); assertEquals(11, joined.column("BuildDate").size()); assertEquals(3, joined.column("BuildDate").countMissing()); assertEquals(11, joined.column("Owner").size()); assertEquals(0, joined.column("Owner").countMissing()); assertEquals(11, joined.column("Type").size()); assertEquals(3, joined.column("Type").countMissing()); assertEquals(11, joined.column("SoldDate").size()); assertEquals(3, joined.column("SoldDate").countMissing()); }
@Test public void fullJoinBnBBoat10OnBedroomsOwner() { Table table1 = createBEDANDBREAKFAST(); Table table2 = createBOAT10(); Table joined = table1.joinOn("Bedrooms", "SoldDate").fullOuter(true, table2); assertEquals(6, joined.columnCount()); assertEquals(11, joined.rowCount()); assertEquals(11, joined.column("Design").size()); assertEquals(6, joined.column("Design").countMissing()); assertEquals(11, joined.column("Bedrooms").size()); assertEquals(0, joined.column("Bedrooms").countMissing()); assertEquals(11, joined.column("SoldDate").size()); assertEquals(0, joined.column("SoldDate").countMissing()); assertEquals(11, joined.column("Owner").size()); assertEquals(6, joined.column("Owner").countMissing()); assertEquals(11, joined.column("Type").size()); assertEquals(3, joined.column("Type").countMissing()); assertEquals(11, joined.column("T2.Owner").size()); assertEquals(3, joined.column("T2.Owner").countMissing()); }
@Test public void fullOuterJoinFootballSoccerOnPlayTime() { Table table1 = createFOOTBALLSCHEDULE(); Table table2 = createSOCCERSCHEDULE(); Table joined = table1.joinOn("PlayTime").fullOuter(true, table2); assertEquals(8, joined.columnCount()); assertEquals(5, joined.rowCount()); }
@Test public void fullOuterJoinFootballSoccerOnPlayDateTimeSeasonRevenue() { Table table1 = createFOOTBALLSCHEDULEDateTime(); Table table2 = createSOCCERSCHEDULEDateTime(); Table joined = table1.joinOn("PlayDateTime", "SeasonRevenue").fullOuter(true, table2); assertEquals(9, joined.columnCount()); assertEquals(6, joined.rowCount()); assertEquals(6, joined.column("TeamName").size()); assertEquals(2, joined.column("TeamName").countMissing()); assertEquals(6, joined.column("PlayDateTime").size()); assertEquals(0, joined.column("PlayDateTime").countMissing()); assertEquals(6, joined.column("Location").size()); assertEquals(2, joined.column("Location").countMissing()); assertEquals(6, joined.column("HomeGame").size()); assertEquals(2, joined.column("HomeGame").countMissing()); assertEquals(6, joined.column("SeasonRevenue").size()); assertEquals(0, joined.column("SeasonRevenue").countMissing()); assertEquals(6, joined.column("Mascot").size()); assertEquals(2, joined.column("Mascot").countMissing()); assertEquals(6, joined.column("Place").size()); assertEquals(2, joined.column("Place").countMissing()); }
@Test public void fullOuterJoinFootballSoccerOnPlayDateTimeAllTimeRevenue() { Table table1 = createFOOTBALLSCHEDULEDateTime(); Table table2 = createSOCCERSCHEDULEDateTime(); Table joined = table1.joinOn("AllTimeRevenue").fullOuter(true, table2); assertEquals(10, joined.columnCount()); assertEquals(5, joined.rowCount()); assertEquals(5, joined.column("TeamName").size()); assertEquals(1, joined.column("TeamName").countMissing()); assertEquals(5, joined.column("PlayDateTime").size()); assertEquals(1, joined.column("PlayDateTime").countMissing()); assertEquals(5, joined.column("Location").size()); assertEquals(1, joined.column("Location").countMissing()); assertEquals(5, joined.column("HomeGame").size()); assertEquals(1, joined.column("HomeGame").countMissing()); assertEquals(5, joined.column("SeasonRevenue").size()); assertEquals(1, joined.column("SeasonRevenue").countMissing()); assertEquals(5, joined.column("AllTimeRevenue").size()); assertEquals(0, joined.column("AllTimeRevenue").countMissing()); assertEquals(5, joined.column("Mascot").size()); assertEquals(1, joined.column("Mascot").countMissing()); assertEquals(5, joined.column("T2.PlayDateTime").size()); assertEquals(1, joined.column("T2.PlayDateTime").countMissing()); assertEquals(5, joined.column("Place").size()); assertEquals(1, joined.column("Place").countMissing()); assertEquals(5, joined.column("T2.SeasonRevenue").size()); assertEquals(1, joined.column("T2.SeasonRevenue").countMissing()); }
@Test public void fullOuterJoinFootballBaseballBoolean() { Table table1 = createFOOTBALLSCHEDULE(); Table table2 = createBASEBALLSCHEDULEDateTime(); Table joined = table1.joinOn("HomeGame").fullOuter(true, table2); assertEquals(10, joined.columnCount()); assertEquals(8, joined.rowCount()); }