use of io.airlift.tpch.NationGenerator in project hetu-core by openlookeng.
the class TestOrcAcidPageSource method assertRead.
private static void assertRead(Map<NationColumn, Integer> columns, OptionalLong nationKeyPredicate, Optional<DeleteDeltaLocations> deleteDeltaLocations, LongPredicate deletedRows) {
TupleDomain<HiveColumnHandle> tupleDomain = TupleDomain.all();
if (nationKeyPredicate.isPresent()) {
tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(toHiveColumnHandle(NATION_KEY, ALL_COLUMNS.get(NATION_KEY)), Domain.singleValue(BIGINT, nationKeyPredicate.getAsLong())));
}
List<Nation> actual = readFile(columns, tupleDomain, deleteDeltaLocations);
List<Nation> expected = new ArrayList<>();
for (Nation nation : ImmutableList.copyOf(new NationGenerator().iterator())) {
if (nationKeyPredicate.isPresent() && nationKeyPredicate.getAsLong() != nation.getNationKey()) {
continue;
}
if (deletedRows.test(nation.getNationKey())) {
continue;
}
expected.addAll(nCopies(1000, nation));
}
assertEqualsByColumns(columns.keySet(), actual, expected);
}
use of io.airlift.tpch.NationGenerator in project boostkit-bigdata by kunpengcompute.
the class TestOrcAcidPageSource method assertRead.
private static void assertRead(Map<NationColumn, Integer> columns, OptionalLong nationKeyPredicate, Optional<DeleteDeltaLocations> deleteDeltaLocations, LongPredicate deletedRows) {
TupleDomain<HiveColumnHandle> tupleDomain = TupleDomain.all();
if (nationKeyPredicate.isPresent()) {
tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(toHiveColumnHandle(NATION_KEY, ALL_COLUMNS.get(NATION_KEY)), Domain.singleValue(BIGINT, nationKeyPredicate.getAsLong())));
}
List<Nation> actual = readFile(columns, tupleDomain, deleteDeltaLocations);
List<Nation> expected = new ArrayList<>();
for (Nation nation : ImmutableList.copyOf(new NationGenerator().iterator())) {
if (nationKeyPredicate.isPresent() && nationKeyPredicate.getAsLong() != nation.getNationKey()) {
continue;
}
if (deletedRows.test(nation.getNationKey())) {
continue;
}
expected.addAll(nCopies(1000, nation));
}
assertEqualsByColumns(columns.keySet(), actual, expected);
}
Aggregations