Skip to content
Merged
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: 1 addition & 2 deletions cpp/velox/compute/VeloxBackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ void VeloxBackend::init(
velox::parquet::registerParquetReaderFactory();
velox::parquet::registerParquetWriterFactory();
velox::orc::registerOrcReaderFactory();
velox::exec::ExprToSubfieldFilterParser::registerParserFactory(
[]() { return std::make_shared<SparkExprToSubfieldFilterParser>(); });
velox::exec::ExprToSubfieldFilterParser::registerParser(std::make_unique<SparkExprToSubfieldFilterParser>());

// Register Velox functions
registerAllFunctions();
Expand Down
26 changes: 26 additions & 0 deletions cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,32 @@ namespace gluten {

using namespace facebook::velox;

std::pair<common::Subfield, std::unique_ptr<common::Filter>> SparkExprToSubfieldFilterParser::toSubfieldFilter(
const core::TypedExprPtr& expr,
core::ExpressionEvaluator* evaluator) {
if (expr->isCallKind(); auto* call = expr->asUnchecked<core::CallTypedExpr>()) {
if (call->name() == "or") {
auto left = toSubfieldFilter(call->inputs()[0], evaluator);
auto right = toSubfieldFilter(call->inputs()[1], evaluator);
VELOX_CHECK(left.first == right.first);
return {std::move(left.first), makeOrFilter(std::move(left.second), std::move(right.second))};
}
common::Subfield subfield;
std::unique_ptr<common::Filter> filter;
if (call->name() == "not") {
if (auto* inner = call->inputs()[0]->asUnchecked<core::CallTypedExpr>()) {
filter = leafCallToSubfieldFilter(*inner, subfield, evaluator, true);
}
} else {
filter = leafCallToSubfieldFilter(*call, subfield, evaluator, false);
}
if (filter) {
return std::make_pair(std::move(subfield), std::move(filter));
}
}
VELOX_UNSUPPORTED("Unsupported expression for range filter: {}", expr->toString());
}

std::unique_ptr<common::Filter> SparkExprToSubfieldFilterParser::leafCallToSubfieldFilter(
const core::CallTypedExpr& call,
common::Subfield& subfield,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ namespace gluten {
/// 2) The supported functions vary.
class SparkExprToSubfieldFilterParser : public facebook::velox::exec::ExprToSubfieldFilterParser {
public:
std::pair<facebook::velox::common::Subfield, std::unique_ptr<facebook::velox::common::Filter>> toSubfieldFilter(
const facebook::velox::core::TypedExprPtr& expr,
facebook::velox::core::ExpressionEvaluator* evaluator) override;

std::unique_ptr<facebook::velox::common::Filter> leafCallToSubfieldFilter(
const facebook::velox::core::CallTypedExpr& call,
facebook::velox::common::Subfield& subfield,
Expand Down
4 changes: 2 additions & 2 deletions ep/build-velox/src/get-velox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ set -exu

CURRENT_DIR=$(cd "$(dirname "$BASH_SOURCE")"; pwd)
VELOX_REPO=https://github.com/oap-project/velox.git
VELOX_BRANCH=2025_11_04
VELOX_BRANCH=2025_11_05
VELOX_HOME=""
RUN_SETUP_SCRIPT=ON
VELOX_ENHANCED_REPO=https://github.com/IBM/velox.git
VELOX_ENHANCED_BRANCH=ibm-2025_11_04
VELOX_ENHANCED_BRANCH=ibm-2025_11_05
ENABLE_ENHANCED_FEATURES=OFF

# Developer use only for testing Velox PR.
Expand Down