Skip to content

Commit

Permalink
Handle group by all null columns
Browse files Browse the repository at this point in the history
The metadata holds the init values in the case a column is
all nulls, we need to account for it. Fixes heavyai#145.
  • Loading branch information
asuhan committed Jan 19, 2016
1 parent e371a50 commit e184933
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion QueryEngine/ExpressionRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,12 @@ ExpressionRange getExpressionRange(const Analyzer::ColumnVar* col_expr,
}
const auto min_val = extract_min_stat(min_it->second.chunkStats, col_ti);
const auto max_val = extract_max_stat(max_it->second.chunkStats, col_ti);
CHECK_GE(max_val, min_val);
if (max_val < min_val) {
CHECK_LT(max_val, 0);
CHECK_GT(min_val, 0);
CHECK_EQ(-(min_val + 1), max_val);
return ExpressionRange::makeIntRange(0, -1, 0, has_nulls);
}
return ExpressionRange::makeIntRange(min_val, max_val, 0, has_nulls);
}
default:
Expand Down

0 comments on commit e184933

Please sign in to comment.