Skip to content

Commit

Permalink
[fix](nerieds) set row count to colStats if colStats.isUnknown (#37522)
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly authored and dataroaring committed Jul 16, 2024
1 parent 5e35d95 commit d643e85
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ private Statistics computeOlapScan(LogicalOlapScan olapScan) {
for (SlotReference slot : outputSlotReferences) {
ColumnStatistic cache = getColumnStatsFromTableCache(olapScan, slot);
ColumnStatisticBuilder colStatsBuilder = new ColumnStatisticBuilder(cache);
if (cache.isUnKnown) {
colStatsBuilder.setCount(rowCount);
}
adjustColStats(olapScan, slot, colStatsBuilder);
builder.putColumnStatistics(slot, colStatsBuilder.build());
rowCount = Math.max(rowCount, colStatsBuilder.getCount());
Expand Down Expand Up @@ -1051,6 +1054,9 @@ private Statistics computeCatalogRelation(CatalogRelation catalogRelation) {
for (SlotReference slot : slotSet) {
ColumnStatistic cache = getColumnStatsFromTableCache(catalogRelation, slot);
ColumnStatisticBuilder colStatsBuilder = new ColumnStatisticBuilder(cache);
if (cache.isUnKnown) {
colStatsBuilder.setCount(rowCount);
}
adjustColStats(catalogRelation, slot, colStatsBuilder);
rowCount = Math.max(rowCount, colStatsBuilder.getCount());
builder.putColumnStatistics(slot, colStatsBuilder.build());
Expand Down

0 comments on commit d643e85

Please sign in to comment.