Skip to content

Commit

Permalink
[BugFix] Fix applying runtime filter of decimal type on ORC (#34687)
Browse files Browse the repository at this point in the history
Signed-off-by: Letian Jiang <letian.jiang@outlook.com>
(cherry picked from commit d92f2a8)
  • Loading branch information
letian-jiang authored and wanpengfei-git committed Nov 10, 2023
1 parent 2a208e1 commit 155e2f8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion be/src/formats/orc/orc_chunk_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,17 @@ Status OrcChunkReader::_add_conjunct(const Expr* conjunct, std::unique_ptr<orc::
ADD_RF_TO_BUILDER \
}

#define ADD_RF_DECIMAL128_TYPE(xtype) \
case xtype: { \
auto* xrf = dynamic_cast<const RuntimeBloomFilter<xtype>*>(rf); \
if (xrf == nullptr) return false; \
auto lower = orc::Literal(orc::Int128(xrf->min_value() >> 64, xrf->min_value()), slot->type().precision, \
slot->type().scale); \
auto upper = orc::Literal(orc::Int128(xrf->max_value() >> 64, xrf->max_value()), slot->type().precision, \
slot->type().scale); \
ADD_RF_TO_BUILDER \
}

bool OrcChunkReader::_add_runtime_filter(const SlotDescriptor* slot, const JoinRuntimeFilter* rf,
std::unique_ptr<orc::SearchArgumentBuilder>& builder) {
LogicalType ltype = slot->type().type;
Expand All @@ -1091,7 +1102,7 @@ bool OrcChunkReader::_add_runtime_filter(const SlotDescriptor* slot, const JoinR
ADD_RF_DECIMALV2_TYPE(LogicalType::TYPE_DECIMALV2);
ADD_RF_DECIMALV3_TYPE(LogicalType::TYPE_DECIMAL32);
ADD_RF_DECIMALV3_TYPE(LogicalType::TYPE_DECIMAL64);
ADD_RF_DECIMALV3_TYPE(LogicalType::TYPE_DECIMAL128);
ADD_RF_DECIMAL128_TYPE(LogicalType::TYPE_DECIMAL128);
default:;
}
return false;
Expand Down

0 comments on commit 155e2f8

Please sign in to comment.