File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -253,12 +253,17 @@ TypePtr SwitchExpr::resolveType(const std::vector<TypePtr>& argTypes) {
253
253
if (hasElse) {
254
254
auto & elseClauseType = argTypes.back ();
255
255
256
- VELOX_CHECK (
256
+ if (elseClauseType->isDecimal ()) {
257
+ // Regard decimals as the same type regardless of precision and scale.
258
+ VELOX_CHECK (expressionType->isDecimal ());
259
+ } else {
260
+ VELOX_CHECK (
257
261
*elseClauseType == *expressionType,
258
262
" Else clause of a SWITCH statement must have the same type as 'then' clauses. "
259
263
" Expected {}, but got {}." ,
260
264
expressionType->toString (),
261
265
elseClauseType->toString ());
266
+ }
262
267
}
263
268
264
269
return expressionType;
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ exec::AggregateRegistrationResult registerAverage(const std::string& name) {
143
143
} // namespace
144
144
145
145
void registerAverageAggregate (const std::string& prefix) {
146
- registerAverage (prefix + kAvg );
146
+ // registerAverage(prefix + kAvg);
147
147
}
148
148
149
149
} // namespace facebook::velox::aggregate::prestosql
Original file line number Diff line number Diff line change @@ -32,6 +32,6 @@ void registerAggregateFunctions(const std::string& prefix) {
32
32
registerBitwiseXorAggregate (prefix);
33
33
registerBloomFilterAggAggregate (prefix + " bloom_filter_agg" );
34
34
registerAverage (prefix + " avg" );
35
- registerDecimalSumAggregate (prefix + " sum " );
35
+ registerDecimalSumAggregate (prefix + " decimal_sum " );
36
36
}
37
37
} // namespace facebook::velox::functions::aggregate::sparksql
You can’t perform that action at this time.
0 commit comments