@Test public void buildMapNoKeyColumn() { List<ColumnMetadata> columns = ImmutableList.of(new ColumnMetadata("k1", Schema.STRING, "desc", false, true)); assertThat(TableDiff.buildMap(new Rows(), columns), equalTo(ImmutableMap.of())); assertThat( TableDiff.buildMap(new Rows().add(Row.of("k1", "a")), columns), equalTo(ImmutableMap.of(new LinkedList<>(), ImmutableList.of(Row.of("k1", "a"))))); }
@VisibleForTesting static Map<List<Object>, List<Row>> buildMap(Rows rows, List<ColumnMetadata> metadata) { Map<List<Object>, List<Row>> map = new HashMap<>(); Iterator<Row> iterator = rows.iterator(); while (iterator.hasNext()) { Row row = iterator.next(); map.computeIfAbsent(row.getKey(metadata), k -> new LinkedList<>()).add(row); } return map; }
TableDiff { @VisibleForTesting static Map<List<Object>, List<Row>> buildMap(Rows rows, List<ColumnMetadata> metadata) { Map<List<Object>, List<Row>> map = new HashMap<>(); Iterator<Row> iterator = rows.iterator(); while (iterator.hasNext()) { Row row = iterator.next(); map.computeIfAbsent(row.getKey(metadata), k -> new LinkedList<>()).add(row); } return map; } }
TableDiff { @VisibleForTesting static Map<List<Object>, List<Row>> buildMap(Rows rows, List<ColumnMetadata> metadata) { Map<List<Object>, List<Row>> map = new HashMap<>(); Iterator<Row> iterator = rows.iterator(); while (iterator.hasNext()) { Row row = iterator.next(); map.computeIfAbsent(row.getKey(metadata), k -> new LinkedList<>()).add(row); } return map; } private  TableDiff(); }
TableDiff { @VisibleForTesting static Map<List<Object>, List<Row>> buildMap(Rows rows, List<ColumnMetadata> metadata) { Map<List<Object>, List<Row>> map = new HashMap<>(); Iterator<Row> iterator = rows.iterator(); while (iterator.hasNext()) { Row row = iterator.next(); map.computeIfAbsent(row.getKey(metadata), k -> new LinkedList<>()).add(row); } return map; } private  TableDiff(); static String baseColumnName(String originalColumnName); static String deltaColumnName(String originalColumnName); static TableMetadata diffMetadata(TableMetadata inputMetadata); static TableAnswerElement diffTables(
      TableAnswerElement baseTable, TableAnswerElement deltaTable, boolean includeOneTableKeys); }
TableDiff { @VisibleForTesting static Map<List<Object>, List<Row>> buildMap(Rows rows, List<ColumnMetadata> metadata) { Map<List<Object>, List<Row>> map = new HashMap<>(); Iterator<Row> iterator = rows.iterator(); while (iterator.hasNext()) { Row row = iterator.next(); map.computeIfAbsent(row.getKey(metadata), k -> new LinkedList<>()).add(row); } return map; } private  TableDiff(); static String baseColumnName(String originalColumnName); static String deltaColumnName(String originalColumnName); static TableMetadata diffMetadata(TableMetadata inputMetadata); static TableAnswerElement diffTables(
      TableAnswerElement baseTable, TableAnswerElement deltaTable, boolean includeOneTableKeys); static final String COL_BASE_PREFIX; static final String COL_DELTA_PREFIX; static final String COL_KEY_PRESENCE; static final String COL_KEY_PRESENCE_DESC; static final String COL_KEY_STATUS_BOTH; static final String COL_KEY_STATUS_ONLY_BASE; static final String COL_KEY_STATUS_ONLY_DELTA; }