From fb700fe59921fade17d45a06c6f89d6130649b26 Mon Sep 17 00:00:00 2001 From: Rui Mo Date: Fri, 21 Feb 2025 11:15:56 +0000 Subject: [PATCH] Remove table scan test --- velox/exec/tests/TableScanTest.cpp | 121 ------------------------ velox/exec/tests/data/long_decimal.orc | Bin 485 -> 0 bytes velox/exec/tests/data/short_decimal.orc | Bin 429 -> 0 bytes 3 files changed, 121 deletions(-) delete mode 100644 velox/exec/tests/data/long_decimal.orc delete mode 100644 velox/exec/tests/data/short_decimal.orc diff --git a/velox/exec/tests/TableScanTest.cpp b/velox/exec/tests/TableScanTest.cpp index 6a727e123b00..f8a7ab7081fe 100644 --- a/velox/exec/tests/TableScanTest.cpp +++ b/velox/exec/tests/TableScanTest.cpp @@ -34,7 +34,6 @@ #include "velox/connectors/hive/HivePartitionFunction.h" #include "velox/dwio/common/CacheInputStream.h" #include "velox/dwio/common/tests/utils/DataFiles.h" -#include "velox/dwio/orc/reader/OrcReader.h" #include "velox/exec/Cursor.h" #include "velox/exec/Exchange.h" #include "velox/exec/OutputBufferManager.h" @@ -47,7 +46,6 @@ #include "velox/exec/tests/utils/TempDirectoryPath.h" #include "velox/expression/ExprToSubfieldFilter.h" #include "velox/functions/lib/IsNull.h" -#include "velox/type/Timestamp.h" #include "velox/type/Type.h" #include "velox/type/tests/SubfieldFiltersBuilder.h" @@ -80,7 +78,6 @@ class TableScanTest : public virtual HiveConnectorTestBase { HiveConnectorTestBase::SetUp(); exec::ExchangeSource::factories().clear(); exec::ExchangeSource::registerFactory(createLocalExchangeSource); - orc::registerOrcReaderFactory(); } static void SetUpTestCase() { @@ -1858,124 +1855,6 @@ TEST_F(TableScanTest, validFileNoData) { assertQuery(op, split, ""); } -TEST_F(TableScanTest, shortDecimalFilter) { - functions::registerIsNotNullFunction("isnotnull"); - - std::vector> values = { - 123456789123456789L, - 987654321123456L, - std::nullopt, - 2000000000000000L, - 5000000000000000L, - 987654321987654321L, - 100000000000000L, - 1230000000123456L, - 120000000123456L, - std::nullopt}; - auto rowVector = makeRowVector({ - makeNullableFlatVector(values, DECIMAL(18, 6)), - }); - createDuckDbTable({rowVector}); - - auto filePath = facebook::velox::test::getDataFilePath( - "velox/exec/tests", "data/short_decimal.orc"); - auto split = exec::test::HiveConnectorSplitBuilder(filePath) - .start(0) - .length(fs::file_size(filePath)) - .fileFormat(dwio::common::FileFormat::ORC) - .build(); - - auto rowType = ROW({"d"}, {DECIMAL(18, 6)}); - - // Is not null. - auto op = - PlanBuilder().tableScan(rowType, {}, "isnotnull(d)", rowType).planNode(); - assertQuery(op, split, "SELECT c0 FROM tmp where c0 is not null"); - - // Is null. - op = PlanBuilder().tableScan(rowType, {}, "is_null(d)", rowType).planNode(); - assertQuery(op, split, "SELECT c0 FROM tmp where c0 is null"); - - // BigintRange. - op = - PlanBuilder() - .tableScan( - rowType, - {}, - "d > 2000000000.0::DECIMAL(18, 6) and d < 6000000000.0::DECIMAL(18, 6)", - rowType) - .planNode(); - assertQuery( - op, - split, - "SELECT c0 FROM tmp where c0 > 2000000000.0 and c0 < 6000000000.0"); - - // NegatedBigintRange. - op = - PlanBuilder() - .tableScan( - rowType, - {}, - "not(d between 2000000000.0::DECIMAL(18, 6) and 6000000000.0::DECIMAL(18, 6))", - rowType) - .planNode(); - assertQuery( - op, - split, - "SELECT c0 FROM tmp where c0 < 2000000000.0 or c0 > 6000000000.0"); -} - -TEST_F(TableScanTest, longDecimalFilter) { - functions::registerIsNotNullFunction("isnotnull"); - - std::vector> values = { - HugeInt::parse("123456789123456789123456789" + std::string(9, '0')), - HugeInt::parse("987654321123456789" + std::string(9, '0')), - std::nullopt, - HugeInt::parse("2" + std::string(37, '0')), - HugeInt::parse("5" + std::string(37, '0')), - HugeInt::parse("987654321987654321987654321" + std::string(9, '0')), - HugeInt::parse("1" + std::string(26, '0')), - HugeInt::parse("123000000012345678" + std::string(10, '0')), - HugeInt::parse("120000000123456789" + std::string(9, '0')), - HugeInt::parse("9" + std::string(37, '0'))}; - auto rowVector = makeRowVector({ - makeNullableFlatVector(values, DECIMAL(38, 18)), - }); - createDuckDbTable({rowVector}); - - auto filePath = facebook::velox::test::getDataFilePath( - "velox/exec/tests", "data/long_decimal.orc"); - auto split = exec::test::HiveConnectorSplitBuilder(filePath) - .start(0) - .length(fs::file_size(filePath)) - .fileFormat(dwio::common::FileFormat::ORC) - .build(); - - auto rowType = ROW({"d"}, {DECIMAL(38, 18)}); - auto op = - PlanBuilder().tableScan(rowType, {}, "isnotnull(d)", rowType).planNode(); - assertQuery(op, split, "SELECT c0 FROM tmp where c0 is not null"); - - // Is null. - op = PlanBuilder().tableScan(rowType, {}, "is_null(d)", rowType).planNode(); - assertQuery(op, split, "SELECT c0 FROM tmp where c0 is null"); - - // HugeintRange. - op = - PlanBuilder() - .tableScan( - rowType, - {}, - "d > 2000000000.0::DECIMAL(38, 18) and d < 6000000000.0::DECIMAL(38, 18)", - rowType) - .planNode(); - assertQuery( - op, - split, - "SELECT c0 FROM tmp where c0 > 2000000000.0 and c0 < 6000000000.0"); -} - // An invalid (size = 0) file. TEST_F(TableScanTest, emptyFile) { auto filePath = TempFilePath::create(); diff --git a/velox/exec/tests/data/long_decimal.orc b/velox/exec/tests/data/long_decimal.orc deleted file mode 100644 index f732246b469aab0ccddbf80fbdfb98ecf6adc79a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 485 zcmeYdau#G@;9?VE;ou5js9|6T7vKuz;$#qHR1xyv;52gL;xshiW#kYNvE=2_V`LDJ zk~cIn6l4rBHZ`#@H#0RcHqtY(Fa#kpivUJ;28Mt453FZkSoLSof%ngEJbwE9`$L{p zce=N~oc?x;bVEbK-bGD|`&P3wG#r?5?dbK#uelzbIK!wSX^ z5gg0{9~h;$fRv9!o`SIkml6jDj}RlH6l01K8wa0;nt_m(B9}ydQMz7YL1J=7s$OwH zVo|nUS!z*nW`3R!tFfN3o}mGk71$|OaHkk>GJ!&ylhX(h+9s%OVPy6J1$IQ9!vsGM nh6u(aRzp2=Ju{A(i~>v&4GjWHObk34&IX)KUznNwgPbJ*j+A$+ diff --git a/velox/exec/tests/data/short_decimal.orc b/velox/exec/tests/data/short_decimal.orc deleted file mode 100644 index d442711fc750540744f81c1bb561d2ecf180f0af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 429 zcmeYdau#G@;9?VE;ou5jh+$wb72q=F;$#qHR1s3+;4o6);xshiWsDFKwzM!eGc_?b zG6XX8AglmJb_Rxj_Z#vV7*_phI{Wp~*=@`XhmQ8QO+3ilaAD17zJ?R)7pOiuwc!2x z>2J44H?*veZ|Gb$aog(kEDfFA*S?-G<7HrQV?V=i;7lUO5gcp+3=-U6no+_KNHYj9 zO0WTGMj&kkq*;M9rw|hd0}wOSFfe$yaJg}TUCw0(bgUV~u@-2K<>Zo(5-~J1v@{Tu z($F(9HZe6b3t)`!)M8|q!}uYBgIQoVqZAjAvXSsqFxKEw;^5#BVq}zJOi^Ov;L{K? zVAE3MlE^Pg*Gnu&OwLHvD=tVZ%GN7OEh^5;&l6%b)-%>KG~luVJH!g^5Ccvod@e~q ta*4wPKM#fo#w1olJz&^!%wQB?l4xiUP-0@>(Qq{2Z2H2?>>uPT0RTfgUfTcw