Skip to content

Commit

Permalink
fixup! Determine range constraints in Faker connector
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick committed Jan 20, 2025
1 parent 3d035e3 commit 68f71d4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,11 @@ private synchronized TableInfo createTableInfoFromStats(SchemaTableName tableNam
List<ColumnInfo> columns = info.columns();
Map<String, Type> types = columns.stream().collect(toImmutableMap(ColumnInfo::name, ColumnInfo::type));
Long rowCount = null;
for (ComputedStatistics statistic : computedStatistics) {
Optional<ComputedStatistics> optionalStatistic = computedStatistics.stream().reduce((_, _) -> {
throw new IllegalStateException("Found more than one computed statistic");
});
if (optionalStatistic.isPresent()) {
ComputedStatistics statistic = optionalStatistic.get();
if (!statistic.getTableStatistics().get(ROW_COUNT).isNull(0)) {
rowCount = BIGINT.getLong(statistic.getTableStatistics().get(ROW_COUNT), 0);
}
Expand Down

0 comments on commit 68f71d4

Please sign in to comment.