Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion velox/functions/lib/aggregates/AverageAggregateBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ namespace facebook::velox::functions::aggregate {
void checkAvgIntermediateType(const TypePtr& type) {
VELOX_USER_CHECK(
type->isRow() || type->isVarbinary(),
"Input type for final average must be row type or varbinary type.");
"Input type for final average must be row type or varbinary type, find {}",
type->toString());
if (type->kind() == TypeKind::VARBINARY) {
return;
}
Expand Down
8 changes: 5 additions & 3 deletions velox/functions/lib/aggregates/DecimalAggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DecimalAggregate : public exec::Aggregate {
}

int32_t accumulatorAlignmentSize() const override {
return static_cast<int32_t>(sizeof(int128_t));
return alignof(LongDecimalWithOverflowState);
}

void addRawInput(
Expand Down Expand Up @@ -275,7 +275,9 @@ class DecimalAggregate : public exec::Aggregate {
}

virtual TResultType computeFinalValue(
LongDecimalWithOverflowState* accumulator) = 0;
LongDecimalWithOverflowState* accumulator) {
return 0;
};

void extractValues(char** groups, int32_t numGroups, VectorPtr* result)
override {
Expand Down Expand Up @@ -327,11 +329,11 @@ class DecimalAggregate : public exec::Aggregate {
}
}

private:
inline LongDecimalWithOverflowState* decimalAccumulator(char* group) {
return exec::Aggregate::value<LongDecimalWithOverflowState>(group);
}

private:
DecodedVector decodedRaw_;
DecodedVector decodedPartial_;
};
Expand Down
Loading