Skip to content

Commit

Permalink
[VL] Add a test to verify hex function is offloaded (#4469)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohahaha authored Jan 23, 2024
1 parent ecd4a9a commit 6b849a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,10 @@ class VeloxFunctionsValidateSuite extends VeloxWholeStageTransformerSuite {
checkOperatorMatch[ProjectExecTransformer]
}
}

test("Test hex function") {
runQueryAndCompare("SELECT hex(l_partkey), hex(l_shipmode) FROM lineitem limit 1") {
checkOperatorMatch[ProjectExecTransformer]
}
}
}
6 changes: 5 additions & 1 deletion cpp/velox/benchmarks/PlanValidatorUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
#include "benchmarks/common/BenchmarkUtils.h"
#include "compute/VeloxBackend.h"
#include "compute/VeloxRuntime.h"
#include "config/GlutenConfig.h"
#include "memory/VeloxMemoryManager.h"
#include "substrait/SubstraitToVeloxPlanValidator.h"

using namespace gluten;

/// Set spark.gluten.sql.debug=true to get validation plan and dump it into a json file,
/// then use this util debug validate process easilly in native side.
/// then use this util debug validate process easily in native side.
int main(int argc, char** argv) {
if (argc != 2) {
LOG(WARNING) << "PlanValidatorUtil usage: \n"
Expand All @@ -39,6 +40,9 @@ int main(int argc, char** argv) {
std::string msgData = buffer.str();
auto plan = substraitFromJsonToPb("Plan", msgData);

std::unordered_map<std::string, std::string> conf;
conf.insert({kDebugModeEnabled, "true"});
initVeloxBackend(conf);
core::QueryCtx queryCtx;
auto pool = defaultLeafVeloxMemoryPool().get();
core::ExecCtx execCtx(pool, &queryCtx);
Expand Down

0 comments on commit 6b849a5

Please sign in to comment.