Skip to content

Commit

Permalink
Fix build failure (facebookincubator#11171)
Browse files Browse the repository at this point in the history
Summary:
Fix CMake failure in velox/exec and velox/tool/trace

Pull Request resolved: facebookincubator#11171

Reviewed By: tanjialiang

Differential Revision: D63943768

Pulled By: xiaoxmeng

fbshipit-source-id: cd07c5f8678f6046f040a4dcfd4a71a774587f5e
  • Loading branch information
duanmeng authored and facebook-github-bot committed Oct 5, 2024
1 parent ddf16c8 commit 96944d5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
4 changes: 1 addition & 3 deletions velox/exec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ velox_link_libraries(
velox_common_base
velox_test_util
velox_arrow_bridge
velox_common_compression
velox_query_trace_exec)
velox_common_compression)

if(${VELOX_BUILD_TESTING})
add_subdirectory(fuzzer)
Expand All @@ -121,4 +120,3 @@ if(${VELOX_ENABLE_BENCHMARKS})
endif()

add_subdirectory(prefixsort)
add_subdirectory(trace)
22 changes: 15 additions & 7 deletions velox/exec/tests/QueryTraceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,24 @@ TEST_F(QueryTracerTest, task) {
const auto expectedResult =
AssertQueryBuilder(planNode).maxDrivers(1).copyResults(pool());

for (const auto* taceTaskRegExp :
{".*", "test_cursor [12345]", "xxx_yyy \\d+"}) {
struct {
std::string taskRegExpr;
uint8_t expectedNumDirs;

std::string debugString() const {
return fmt::format(
"taskRegExpr: {}, expectedNumDirs: ", taskRegExpr, expectedNumDirs);
}
} testSettings[]{{".*", 1}, {"test_cursor .*", 1}, {"xxx_yyy \\d+", 0}};
for (const auto& testData : testSettings) {
const auto outputDir = TempDirectoryPath::create();
const auto expectedQueryConfigs =
std::unordered_map<std::string, std::string>{
{core::QueryConfig::kSpillEnabled, "true"},
{core::QueryConfig::kSpillNumPartitionBits, "17"},
{core::QueryConfig::kQueryTraceEnabled, "true"},
{core::QueryConfig::kQueryTraceDir, outputDir->getPath()},
{core::QueryConfig::kQueryTraceTaskRegExp, taceTaskRegExp},
{core::QueryConfig::kQueryTraceTaskRegExp, testData.taskRegExpr},
{core::QueryConfig::kQueryTraceNodeIds, "1,2"},
{"key1", "value1"},
};
Expand Down Expand Up @@ -315,14 +323,14 @@ TEST_F(QueryTracerTest, task) {
const auto fs = filesystems::getFileSystem(expectedDir, nullptr);
const auto actaulDirs = fs->list(outputDir->getPath());

if (std::strcmp(taceTaskRegExp, "xxx_yyy \\d+") == 0) {
ASSERT_EQ(actaulDirs.size(), 0);
if (testData.taskRegExpr == "xxx_yyy \\d+") {
ASSERT_EQ(actaulDirs.size(), testData.expectedNumDirs);
continue;
}
ASSERT_EQ(actaulDirs.size(), 1);
ASSERT_EQ(actaulDirs.size(), testData.expectedNumDirs);
ASSERT_EQ(actaulDirs.at(0), expectedDir);
const auto taskIds = getTaskIds(outputDir->getPath(), fs);
ASSERT_EQ(taskIds.size(), 1);
ASSERT_EQ(taskIds.size(), testData.expectedNumDirs);
ASSERT_EQ(taskIds.at(0), task->taskId());

std::unordered_map<std::string, std::string> acutalQueryConfigs;
Expand Down
3 changes: 1 addition & 2 deletions velox/tool/trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ velox_add_library(velox_query_trace_replayer_base OperatorReplayerBase.cpp
TableWriterReplayer.cpp)
velox_link_libraries(
velox_query_trace_replayer_base
velox_query_trace_retrieve
velox_aggregates
velox_type
velox_vector
Expand All @@ -38,4 +37,4 @@ target_link_libraries(
velox_exec_test_lib
velox_tpch_connector)

add_subdirectory(test)
add_subdirectory(tests)
2 changes: 0 additions & 2 deletions velox/tool/trace/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ target_link_libraries(
velox_exec
velox_exec_test_lib
velox_memory
velox_query_trace_exec
velox_query_trace_retrieve
velox_query_trace_replayer_base
velox_vector_fuzzer
GTest::gtest_main
Expand Down
8 changes: 8 additions & 0 deletions velox/tool/trace/tests/TableWriterReplayerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,11 @@ TEST_F(TableWriterReplayerTest, partitionWrite) {
}

} // namespace facebook::velox::tool::trace::test

int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
// Signal handler required for ThreadDebugInfoTest
facebook::velox::process::addDefaultFatalSignalHandler();
folly::Init init(&argc, &argv, false);
return RUN_ALL_TESTS();
}

0 comments on commit 96944d5

Please sign in to comment.