diff --git a/CMakeLists.txt b/CMakeLists.txt index 27c28320b1f3..c292f58f6f1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ # limitations under the License. cmake_minimum_required(VERSION 3.11) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) - +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # set the project name project(velox) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index c101837b5b07..4ba17b33e629 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -44,7 +44,9 @@ if(VELOX_ENABLE_ARROW) -DCMAKE_INSTALL_PREFIX=${ARROW_PREFIX}/install -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DARROW_BUILD_STATIC=ON - -DThrift_SOURCE=${THRIFT_SOURCE}) + -DThrift_SOURCE=BUNDLED + -DARROW_DEPENDENCY_SOURCE=BUNDLED + -Dre2_SOURCE=AUTO) set(ARROW_LIBDIR ${ARROW_PREFIX}/install/${CMAKE_INSTALL_LIBDIR}) add_library(thrift STATIC IMPORTED GLOBAL) diff --git a/velox/connectors/hive/CMakeLists.txt b/velox/connectors/hive/CMakeLists.txt index 968eda9ab6d7..6bec0e481966 100644 --- a/velox/connectors/hive/CMakeLists.txt +++ b/velox/connectors/hive/CMakeLists.txt @@ -15,7 +15,7 @@ add_library(velox_hive_connector OBJECT HiveConnector.cpp HiveDataSink.cpp FileHandle.cpp HiveWriteProtocol.cpp) -target_link_libraries(velox_hive_connector velox_connector +target_link_libraries(velox_hive_connector velox_connector velox_dwio_common_exception velox_dwio_dwrf_reader velox_dwio_dwrf_writer velox_file) add_library(velox_hive_partition_function HivePartitionFunction.cpp) diff --git a/velox/dwio/dwrf/common/Checksum.h b/velox/dwio/dwrf/common/Checksum.h index 6ca7d205d99a..611c671f921b 100644 --- a/velox/dwio/dwrf/common/Checksum.h +++ b/velox/dwio/dwrf/common/Checksum.h @@ -21,7 +21,7 @@ #include #define XXH_INLINE_ALL -#include +#include "velox/external/xxhash/xxhash.h" namespace facebook::velox::dwrf { diff --git a/velox/dwio/parquet/writer/Writer.cpp b/velox/dwio/parquet/writer/Writer.cpp index a2d72c2a0a84..5dec802e09c1 100644 --- a/velox/dwio/parquet/writer/Writer.cpp +++ b/velox/dwio/parquet/writer/Writer.cpp @@ -15,9 +15,9 @@ */ #include "velox/dwio/parquet/writer/Writer.h" -#include // @manual +#include #include // @manual -#include "velox/vector/arrow/Bridge.h" +#include "velox/vector/arrow/c/Bridge.h" namespace facebook::velox::parquet { diff --git a/velox/exec/TableScan.cpp b/velox/exec/TableScan.cpp index 5b55ef87aefc..7fcbe4ff8f05 100644 --- a/velox/exec/TableScan.cpp +++ b/velox/exec/TableScan.cpp @@ -32,7 +32,8 @@ TableScan::TableScan( "TableScan"), tableHandle_(tableScanNode->tableHandle()), columnHandles_(tableScanNode->assignments()), - driverCtx_(driverCtx) { + driverCtx_(driverCtx), + preferredBatchSize_(driverCtx->queryConfig().preferredOutputBatchSize()) { connector_ = connector::getConnector(tableHandle_->connectorId()); } @@ -144,6 +145,11 @@ bool TableScan::isFinished() { } void TableScan::setBatchSize() { + if (preferredBatchSize_ != 1024) { + // Not the default value. + readBatchSize_ = preferredBatchSize_; + return; + } constexpr int64_t kMB = 1 << 20; auto estimate = dataSource_->estimatedRowSize(); if (estimate == connector::DataSource::kUnknownRowSize) { diff --git a/velox/exec/TableScan.h b/velox/exec/TableScan.h index 8bba6d136297..1b4b69e345a7 100644 --- a/velox/exec/TableScan.h +++ b/velox/exec/TableScan.h @@ -69,6 +69,8 @@ class TableScan : public SourceOperator { std::unordered_map> pendingDynamicFilters_; int32_t readBatchSize_{kDefaultBatchSize}; + // A preferred batch size from configuration. + uint32_t preferredBatchSize_; // String shown in ExceptionContext inside DataSource and LazyVector loading. std::string debugString_; diff --git a/velox/external/duckdb/duckdb.hpp b/velox/external/duckdb/duckdb.hpp index 2664bdc54129..ffa3f2853cd8 100644 --- a/velox/external/duckdb/duckdb.hpp +++ b/velox/external/duckdb/duckdb.hpp @@ -397,7 +397,7 @@ namespace duckdb { DUCKDB_API void DuckDBAssertInternal(bool condition, const char *condition_name, const char *file, int linenr); } -#define D_ASSERT(condition) duckdb::DuckDBAssertInternal(bool(condition), #condition, __FILE__, __LINE__) +#define D_ASSERT(condition) ::duckdb::DuckDBAssertInternal(bool(condition), #condition, __FILE__, __LINE__) #endif diff --git a/velox/substrait/CMakeLists.txt b/velox/substrait/CMakeLists.txt index a5be326d120f..8f375d07242f 100644 --- a/velox/substrait/CMakeLists.txt +++ b/velox/substrait/CMakeLists.txt @@ -49,7 +49,7 @@ set(SRCS SubstraitParser.cpp SubstraitToVeloxExpr.cpp SubstraitToVeloxPlan.cpp - TypeUtils.cpp + TypeUtils.cpp_out SubstraitExtensionCollector.cpp VeloxToSubstraitExpr.cpp VeloxToSubstraitPlan.cpp diff --git a/velox/substrait/SubstraitParser.cpp b/velox/substrait/SubstraitParser.cpp index 728d717345b8..c7102999e044 100644 --- a/velox/substrait/SubstraitParser.cpp +++ b/velox/substrait/SubstraitParser.cpp @@ -28,7 +28,7 @@ std::shared_ptr SubstraitParser::parseType( switch (substraitType.kind_case()) { case ::substrait::Type::KindCase::kBool: { typeName = "BOOLEAN"; - nullability = sType.bool_().nullability(); + nullability = substraitType.bool_().nullability(); break; } case ::substrait::Type::KindCase::kI8: { @@ -115,7 +115,7 @@ std::shared_ptr SubstraitParser::parseType( } case ::substrait::Type::KindCase::kDate: { typeName = "DATE"; - nullability = sType.date().nullability(); + nullability = substraitType.date().nullability(); break; } default: @@ -217,39 +217,14 @@ std::string SubstraitParser::findSubstraitFuncSpec( return map[id]; } -std::string SubstraitParser::getFunctionName( - const std::string& functionSpec) const { +std::string SubstraitParser::getSubFunctionName( + const std::string& subFuncSpec) const { // Get the position of ":" in the function name. - std::size_t pos = functionSpec.find(":"); + std::size_t pos = subFuncSpec.find(":"); if (pos == std::string::npos) { - return functionSpec; + return subFuncSpec; } - return functionSpec.substr(0, pos); -} - -void SubstraitParser::getFunctionTypes( - const std::string& functionSpec, - std::vector& types) const { - types.clear(); - // Get the position of ":" in the function name. - std::size_t pos = functionSpec.find(":"); - // Get the parameter types. - std::string funcTypes; - if (pos == std::string::npos) { - return; - } else { - if (pos == functionSpec.size() - 1) { - return; - } - funcTypes = functionSpec.substr(pos + 1); - } - // Split the types with delimiter. - std::string delimiter = "_"; - while ((pos = funcTypes.find(delimiter)) != std::string::npos) { - types.emplace_back(funcTypes.substr(0, pos)); - funcTypes.erase(0, pos + delimiter.length()); - } - types.emplace_back(funcTypes); + return subFuncSpec.substr(0, pos); } void SubstraitParser::getSubFunctionTypes( @@ -293,7 +268,7 @@ std::string SubstraitParser::mapToVeloxFunction( // If not finding the mapping from Substrait function name to Velox function // name, the original Substrait function name will be used. - return substraitFunction; + return subFunc; } } // namespace facebook::velox::substrait diff --git a/velox/substrait/SubstraitParser.h b/velox/substrait/SubstraitParser.h index 4dbf652f8a60..78545a98af77 100644 --- a/velox/substrait/SubstraitParser.h +++ b/velox/substrait/SubstraitParser.h @@ -65,18 +65,13 @@ class SubstraitParser { /// Currently, the input types in the function specification are not used. But /// in the future, they should be used for the validation according the /// specifications in Substrait yaml files. - const std::string& findFunctionSpec( + std::string findSubstraitFuncSpec( const std::unordered_map& functionMap, uint64_t id) const; /// Extracts the function name for a function from specified compound name. /// When the input is a simple name, it will be returned. - std::string getFunctionName(const std::string& functionSpec) const; - - /// Extracts argument types for a function from specified compound name. - void getFunctionTypes( - const std::string& functionSpec, - std::vector& types) const; + std::string getSubFunctionName(const std::string& functionSpec) const; /// This function is used get the types from the compound name. void getSubFunctionTypes( diff --git a/velox/substrait/SubstraitToVeloxExpr.cpp b/velox/substrait/SubstraitToVeloxExpr.cpp index 155f124b9814..60db19b9079a 100644 --- a/velox/substrait/SubstraitToVeloxExpr.cpp +++ b/velox/substrait/SubstraitToVeloxExpr.cpp @@ -28,7 +28,7 @@ SubstraitVeloxExprConverter::toVeloxExpr( switch (typeCase) { case ::substrait::Expression::FieldReference::ReferenceTypeCase:: kDirectReference: { - const auto& dRef = sField.direct_reference(); + const auto& dRef = substraitField.direct_reference(); int32_t colIdx = subParser_->parseReferenceSegment(dRef); const auto& inputNames = inputType->names(); const int64_t inputSize = inputNames.size(); @@ -101,9 +101,33 @@ SubstraitVeloxExprConverter::toExtractExpr( VELOX_FAIL("Constant is expected to be the first parameter in extract."); } +std::shared_ptr +SubstraitVeloxExprConverter::toRowConstructorExpr( + const std::vector>& params, + const std::string& typeName) { + std::vector structTypeNames; + subParser_->getSubFunctionTypes(typeName, structTypeNames); + VELOX_CHECK( + structTypeNames.size() > 0, "At lease one type name is expected."); + + // Preparation for the conversion from struct types to RowType. + std::vector rowTypes; + std::vector names; + for (int idx = 0; idx < structTypeNames.size(); idx++) { + std::string substraitTypeName = structTypeNames[idx]; + names.emplace_back("col_" + std::to_string(idx)); + rowTypes.emplace_back(std::move(toVeloxType(substraitTypeName))); + } + + return std::make_shared( + ROW(std::move(names), std::move(rowTypes)), + std::move(params), + "row_constructor"); +} + std::shared_ptr SubstraitVeloxExprConverter::toVeloxExpr( - const ::substrait::Expression::ScalarFunction& substraitFunc, + const ::substrait::Expression::ScalarFunction& sFunc, const RowTypePtr& inputType) { std::vector params; params.reserve(substraitFunc.arguments().size()); @@ -112,17 +136,19 @@ SubstraitVeloxExprConverter::toVeloxExpr( } const auto& veloxFunction = subParser_->findVeloxFunction(functionMap_, sFunc.function_reference()); - const auto& veloxType = - toVeloxType(subParser_->parseType(sFunc.output_type())->type); + std::string typeName = subParser_->parseType(sFunc.output_type())->type; if (veloxFunction == "extract") { - return toExtractExpr(params, veloxType); + return toExtractExpr(std::move(params), toVeloxType(typeName)); } if (veloxFunction == "alias") { - return toAliasExpr(params); + return toAliasExpr(std::move(params)); } if (veloxFunction == "is_not_null") { - return toIsNotNullExpr(params, veloxType); + return toIsNotNullExpr(std::move(params), toVeloxType(typeName)); + } + if (veloxFunction == "row_constructor") { + return toRowConstructorExpr(std::move(params), typeName); } return std::make_shared( @@ -152,7 +178,8 @@ SubstraitVeloxExprConverter::toVeloxExpr( return std::make_shared( variant(substraitLit.fp32())); case ::substrait::Expression_Literal::LiteralTypeCase::kI64: - return std::make_shared(variant(sLit.i64())); + return std::make_shared( + variant(substraitLit.i64())); case ::substrait::Expression_Literal::LiteralTypeCase::kFp64: return std::make_shared( variant(substraitLit.fp64())); @@ -161,7 +188,7 @@ SubstraitVeloxExprConverter::toVeloxExpr( variant(substraitLit.string())); case ::substrait::Expression_Literal::LiteralTypeCase::kNull: { auto veloxType = - toVeloxType(substraitParser_.parseType(substraitLit.null())->type); + toVeloxType(subParser_->parseType(substraitLit.null())->type); return std::make_shared( veloxType, variant::null(veloxType->kind())); } @@ -169,12 +196,12 @@ SubstraitVeloxExprConverter::toVeloxExpr( // List is used in 'in' expression. Will wrap a constant // vector with an array vector inside to create the constant expression. std::vector variants; - variants.reserve(sLit.list().values().size()); + variants.reserve(substraitLit.list().values().size()); VELOX_CHECK( - sLit.list().values().size() > 0, + substraitLit.list().values().size() > 0, "List should have at least one item."); std::optional literalType = std::nullopt; - for (const auto& literal : sLit.list().values()) { + for (const auto& literal : substraitLit.list().values()) { auto typedVariant = toTypedVariant(literal); if (!literalType.has_value()) { literalType = typedVariant->variantType; @@ -302,19 +329,6 @@ SubstraitVeloxExprConverter::toVeloxExpr( resultType = thenClauseExpr->type(); } } - - if (substraitIfThen.has_else_()) { - auto elseClauseExpr = toVeloxExpr(substraitIfThen.else_(), inputType); - inputs.emplace_back(elseClauseExpr); - if (!resultType && !elseClauseExpr->type()->containsUnknown()) { - resultType = elseClauseExpr->type(); - } - } - - VELOX_CHECK_NOT_NULL(resultType, "Result type not found"); - - return std::make_shared( - resultType, std::move(inputs), "if"); } } // namespace facebook::velox::substrait diff --git a/velox/substrait/SubstraitToVeloxExpr.h b/velox/substrait/SubstraitToVeloxExpr.h index d8441493b27e..f8bad7597ac8 100644 --- a/velox/substrait/SubstraitToVeloxExpr.h +++ b/velox/substrait/SubstraitToVeloxExpr.h @@ -51,7 +51,7 @@ class SubstraitVeloxExprConverter { /// Convert Substrait ScalarFunction into Velox Expression. std::shared_ptr toVeloxExpr( - const ::substrait::Expression::ScalarFunction& substraitFunc, + const ::substrait::Expression::ScalarFunction& sFunc, const RowTypePtr& inputType); /// Convert Substrait CastExpression to Velox Expression. @@ -73,6 +73,11 @@ class SubstraitVeloxExprConverter { const std::vector>& params, const TypePtr& outputType); + /// Create expression for row_constructor. + std::shared_ptr toRowConstructorExpr( + const std::vector>& params, + const std::string& typeName); + /// Used to convert Substrait Literal into Velox Expression. std::shared_ptr toVeloxExpr( const ::substrait::Expression::Literal& substraitLit); diff --git a/velox/substrait/SubstraitToVeloxPlan.cpp b/velox/substrait/SubstraitToVeloxPlan.cpp index e715fb53fe60..08e38a1a428f 100644 --- a/velox/substrait/SubstraitToVeloxPlan.cpp +++ b/velox/substrait/SubstraitToVeloxPlan.cpp @@ -190,7 +190,7 @@ std::shared_ptr SubstraitVeloxPlanConverter::toVeloxAgg( // Parse measures and get the aggregate expressions. // Each measure represents one aggregate expression. - std::vector> aggExprs; + std::vector aggExprs; aggExprs.reserve(sAgg.measures().size()); for (const auto& smea : sAgg.measures()) { @@ -302,6 +302,25 @@ core::PlanNodePtr SubstraitVeloxPlanConverter::toVeloxPlan( exprConverter_->toVeloxExpr(sExpr, inputType), childNode); } +bool isPushDownSupportedByFormat( + const dwio::common::FileFormat& format, + connector::hive::SubfieldFilters& subfieldFilters) { + switch (format) { + case dwio::common::FileFormat::PARQUET: + case dwio::common::FileFormat::ORC: + case dwio::common::FileFormat::DWRF: + case dwio::common::FileFormat::RC: + case dwio::common::FileFormat::RC_TEXT: + case dwio::common::FileFormat::RC_BINARY: + case dwio::common::FileFormat::TEXT: + case dwio::common::FileFormat::JSON: + case dwio::common::FileFormat::ALPHA: + case dwio::common::FileFormat::UNKNOWN: + default: + break; + } + return true; +} core::PlanNodePtr SubstraitVeloxPlanConverter::toVeloxPlan( const ::substrait::ReadRel& sRead) { @@ -502,7 +521,6 @@ core::PlanNodePtr SubstraitVeloxPlanConverter::toVeloxPlan( children.emplace_back( setVectorFromVariants(outputChildType, batchChild, pool_)); } - vectors.emplace_back( std::make_shared(pool_, type, nullptr, batchSize, children)); } @@ -737,10 +755,10 @@ void SubstraitVeloxPlanConverter::flattenConditions( switch (typeCase) { case ::substrait::Expression::RexTypeCase::kScalarFunction: { auto sFunc = substraitFilter.scalar_function(); - auto filterNameSpec = substraitParser_->findFunctionSpec( + auto filterNameSpec = subParser_->findSubstraitFuncSpec( functionMap_, sFunc.function_reference()); // TODO: Only and relation is supported here. - if (substraitParser_->getFunctionName(filterNameSpec) == "and") { + if (subParser_->getSubFunctionName(filterNameSpec) == "and") { for (const auto& sCondition : sFunc.args()) { flattenConditions(sCondition, scalarFunctions); } @@ -1398,7 +1416,6 @@ void SubstraitVeloxPlanConverter::constructFunctionMap( exprConverter_ = std::make_shared(pool_, functionMap_); } - bool SubstraitVeloxPlanConverter::checkTypeExtension( const ::substrait::Plan& substraitPlan) { for (const auto& sExtension : substraitPlan.extensions()) { diff --git a/velox/substrait/SubstraitToVeloxPlan.h b/velox/substrait/SubstraitToVeloxPlan.h index 86d55da192db..e4ed38fcb051 100644 --- a/velox/substrait/SubstraitToVeloxPlan.h +++ b/velox/substrait/SubstraitToVeloxPlan.h @@ -100,12 +100,12 @@ class SubstraitVeloxPlanConverter { /// Used to convert Substrait Plan into Velox PlanNode. std::shared_ptr toVeloxPlan( - const ::substrait::Plan& sPlan); + const ::substrait::Plan& substraitPlan); /// Used to construct the function map between the index /// and the Substrait function name. Initialize the expression /// converter based on the constructed function map. - void constructFuncMap(const ::substrait::Plan& sPlan); + void constructFunctionMap(const ::substrait::Plan& substraitPlan); /// Will return the function map used by this plan converter. const std::unordered_map& getFunctionMap() { @@ -345,6 +345,11 @@ class SubstraitVeloxPlanConverter { const std::vector<::substrait::Expression_ScalarFunction>& remainingFunctions); + /// Set the phase of Aggregation. + void setPhase( + const ::substrait::AggregateRel& sAgg, + core::AggregationNode::Step& aggStep); + /// Used to convert AggregateRel into Velox plan node. /// The output of child node will be used as the input of Aggregation. std::shared_ptr toVeloxAgg( diff --git a/velox/substrait/SubstraitToVeloxPlanValidator.cpp b/velox/substrait/SubstraitToVeloxPlanValidator.cpp index 000e01177984..c4f143ee4911 100644 --- a/velox/substrait/SubstraitToVeloxPlanValidator.cpp +++ b/velox/substrait/SubstraitToVeloxPlanValidator.cpp @@ -340,7 +340,7 @@ bool SubstraitToVeloxPlanValidator::validate(const ::substrait::Plan& sPlan) { functions::prestosql::registerAllScalarFunctions(); functions::sparksql::registerFunctions(""); // Create plan converter and expression converter to help the validation. - planConverter_->constructFuncMap(sPlan); + planConverter_->constructFunctionMap(sPlan); exprConverter_ = std::make_shared( pool_, planConverter_->getFunctionMap()); diff --git a/velox/substrait/TypeUtils.cpp b/velox/substrait/TypeUtils.cpp index adc237f93e5b..a7517140037e 100644 --- a/velox/substrait/TypeUtils.cpp +++ b/velox/substrait/TypeUtils.cpp @@ -119,8 +119,6 @@ TypePtr toVeloxType(const std::string& typeName) { } case TypeKind::UNKNOWN: return UNKNOWN(); - case TypeKind::DATE: - return DATE(); default: VELOX_NYI("Velox type conversion not supported for type {}.", typeName); } diff --git a/velox/substrait/proto/substrait/algebra.proto b/velox/substrait/proto/substrait/algebra.proto index 8dcc9c8d2110..e0920cd7e7ec 100644 --- a/velox/substrait/proto/substrait/algebra.proto +++ b/velox/substrait/proto/substrait/algebra.proto @@ -5,8 +5,8 @@ package substrait; import "google/protobuf/any.proto"; import "google/protobuf/empty.proto"; -import "velox/substrait/proto/substrait/extensions/extensions.proto"; -import "velox/substrait/proto/substrait/type.proto"; +import "substrait/extensions/extensions.proto"; +import "substrait/type.proto"; option cc_enable_arenas = true; option csharp_namespace = "Substrait.Protobuf"; @@ -131,13 +131,15 @@ message ReadRel { message ParquetReadOptions {} message ArrowReadOptions {} message OrcReadOptions {} + message DwrfReadOptions {} // The format of the files. oneof file_format { ParquetReadOptions parquet = 9; ArrowReadOptions arrow = 10; OrcReadOptions orc = 11; - google.protobuf.Any extension = 12; + DwrfReadOptions dwrf = 12; + google.protobuf.Any extension = 13; } } } diff --git a/velox/substrait/proto/substrait/function.proto b/velox/substrait/proto/substrait/function.proto index 613368f78d5e..0d09bef0eb8d 100644 --- a/velox/substrait/proto/substrait/function.proto +++ b/velox/substrait/proto/substrait/function.proto @@ -3,9 +3,9 @@ syntax = "proto3"; package substrait; -import "velox/substrait/proto/substrait/parameterized_types.proto"; -import "velox/substrait/proto/substrait/type.proto"; -import "velox/substrait/proto/substrait/type_expressions.proto"; +import "substrait/parameterized_types.proto"; +import "substrait/type.proto"; +import "substrait/type_expressions.proto"; option cc_enable_arenas = true; option csharp_namespace = "Substrait.Protobuf"; diff --git a/velox/substrait/tests/FunctionTest.cpp b/velox/substrait/tests/FunctionTest.cpp index db79d1ea189f..d3f9e5d529bd 100644 --- a/velox/substrait/tests/FunctionTest.cpp +++ b/velox/substrait/tests/FunctionTest.cpp @@ -97,25 +97,25 @@ TEST_F(FunctionTest, constructFunctionMap) { std::string function = planConverter_->findFunction(1); ASSERT_EQ(function, "lte:fp64_fp64"); - function = planConverter_->findFunction(2); + function = planConverter_->findFuncSpec(2); ASSERT_EQ(function, "and:bool_bool"); - function = planConverter_->findFunction(3); + function = planConverter_->findFuncSpec(3); ASSERT_EQ(function, "subtract:opt_fp64_fp64"); - function = planConverter_->findFunction(4); + function = planConverter_->findFuncSpec(4); ASSERT_EQ(function, "multiply:opt_fp64_fp64"); - function = planConverter_->findFunction(5); + function = planConverter_->findFuncSpec(5); ASSERT_EQ(function, "add:opt_fp64_fp64"); - function = planConverter_->findFunction(6); + function = planConverter_->findFuncSpec(6); ASSERT_EQ(function, "sum:opt_fp64"); function = planConverter_->findFunction(7); ASSERT_EQ(function, "count:opt_fp64"); - function = planConverter_->findFunction(8); + function = planConverter_->findFuncSpec(8); ASSERT_EQ(function, "count:opt_i32"); function = planConverter_->findFunction(9); @@ -203,3 +203,12 @@ TEST_F(FunctionTest, setVectorFromVariants) { "0 00:00:08.875", resultVec->asFlatVector()->valueAt(1).toString()); } + +TEST_F(FunctionTest, streamIsInput) { + std::string planPath = + getDataFilePath("velox/substrait/tests", "data/read_second_stage.json"); + ::substrait::Rel substraitRel; + JsonToProtoConverter::readFromFile(planPath, substraitRel); + int index = planConverter_->streamIsInput(substraitRel.read()); + ASSERT_EQ(index, 0); +} diff --git a/velox/substrait/tests/PlanConversionTest.cpp b/velox/substrait/tests/PlanConversionTest.cpp index dcc553f55ba8..014da7f5738d 100644 --- a/velox/substrait/tests/PlanConversionTest.cpp +++ b/velox/substrait/tests/PlanConversionTest.cpp @@ -540,14 +540,15 @@ TEST_P(PlanConversionTest, q6FirstStageTest) { std::string veloxPath = getVeloxPath(); genLineitemORC(veloxConverter); // Find and deserialize Substrait plan json file. - std::string subPlanPath = veloxPath + "/velox/substrait/tests/q6_first.json"; + std::string subPlanPath = + veloxPath + "/velox/substrait/tests/q6_first_stage.json"; auto resIter = veloxConverter->getResIter(subPlanPath); while (resIter->HasNext()) { auto rv = resIter->Next(); auto size = rv->size(); ASSERT_EQ(size, 1); std::string res = rv->toString(0); - ASSERT_EQ(res, "{ [child at 0]: 13613.1921}"); + ASSERT_EQ(res, "{13613.1921}"); } } @@ -573,7 +574,8 @@ TEST_P(PlanConversionTest, q1FirstStageTest) { std::string veloxPath = getVeloxPath(); genLineitemORC(veloxConverter); // Find and deserialize Substrait plan json file. - std::string subPlanPath = veloxPath + "/velox/substrait/tests/q1_first.json"; + std::string subPlanPath = + veloxPath + "/velox/substrait/tests/q1_first_stage.json"; auto resIter = veloxConverter->getResIter(subPlanPath); while (resIter->HasNext()) { auto rv = resIter->Next(); @@ -581,13 +583,13 @@ TEST_P(PlanConversionTest, q1FirstStageTest) { ASSERT_EQ(size, 3); ASSERT_EQ( rv->toString(0), - "{ [child at 0]: N, O, 34, 105963.31, 99911.3719, 101201.05309399999, 34, 3, 105963.31, 3, 0.16999999999999998, 3, 3}"); + "{N, O, 34, 105963.31, 99911.3719, 101201.05309399999, 34, 3, 105963.31, 3, 0.16999999999999998, 3, 3}"); ASSERT_EQ( rv->toString(1), - "{ [child at 1]: A, F, 60, 59390.729999999996, 56278.5879, 59485.994223, 60, 5, 59390.729999999996, 5, 0.24, 5, 5}"); + "{A, F, 60, 59390.729999999996, 56278.5879, 59485.994223, 60, 5, 59390.729999999996, 5, 0.24, 5, 5}"); ASSERT_EQ( rv->toString(2), - "{ [child at 2]: R, F, 23, 94461.56, 87849.2508, 90221.880192, 23, 2, 94461.56, 2, 0.14, 2, 2}"); + "{R, F, 23, 94461.56, 87849.2508, 90221.880192, 23, 2, 94461.56, 2, 0.14, 2, 2}"); } } diff --git a/velox/substrait/tests/Substrait2VeloxPlanConversionTest.cpp b/velox/substrait/tests/Substrait2VeloxPlanConversionTest.cpp index 8c19cb01b39f..80819dcd1b2f 100644 --- a/velox/substrait/tests/Substrait2VeloxPlanConversionTest.cpp +++ b/velox/substrait/tests/Substrait2VeloxPlanConversionTest.cpp @@ -266,7 +266,7 @@ TEST_F(Substrait2VeloxPlanConversionTest, q6) { {makeRowVector(type->names(), vectors)}); // Find and deserialize Substrait plan json file. - std::string planPath = + std::string subPlanPath = getDataFilePath("velox/substrait/tests", "data/q6_first_stage.json"); // Read q6_first_stage.json and resume the Substrait plan. @@ -285,4 +285,4 @@ TEST_F(Substrait2VeloxPlanConversionTest, q6) { exec::test::AssertQueryBuilder(planNode) .splits(makeSplits(planConverter, planNode)) .assertResults(expectedResult); -} +} \ No newline at end of file diff --git a/velox/substrait/tests/data/read_second_stage.json b/velox/substrait/tests/data/read_second_stage.json new file mode 100755 index 000000000000..5a5fc07d239f --- /dev/null +++ b/velox/substrait/tests/data/read_second_stage.json @@ -0,0 +1,32 @@ +{ + "read": { + "common": { + "direct": {} + }, + "baseSchema": { + "names": [ + "sum#43" + ], + "struct": { + "types": [ + { + "fp64": { + "nullability": "NULLABILITY_NULLABLE" + } + } + ] + } + }, + "localFiles": { + "items": [ + { + "format": "FILE_FORMAT_UNSPECIFIED", + "partition_index": "0", + "start": "0", + "length": "0", + "uriFile": "iterator:0" + } + ] + } + } +} \ No newline at end of file diff --git a/velox/substrait/tests/q1_first.json b/velox/substrait/tests/q1_first.json deleted file mode 100644 index e11d8a7f05a1..000000000000 --- a/velox/substrait/tests/q1_first.json +++ /dev/null @@ -1,720 +0,0 @@ -{ - "extension_uris": [], - "extensions": [ - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 1, - "name": "lte:fp64_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 6, - "name": "sum:opt_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 3, - "name": "subtract:opt_fp64_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 0, - "name": "is_not_null:fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 2, - "name": "and:bool_bool" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 5, - "name": "add:opt_fp64_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 7, - "name": "avg:opt_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 4, - "name": "multiply:opt_fp64_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 8, - "name": "count:opt_i32" - } - } - ], - "relations": [ - { - "root": { - "input": { - "aggregate": { - "common": { - "direct": {} - }, - "input": { - "project": { - "common": { - "direct": {} - }, - "input": { - "project": { - "common": { - "direct": {} - }, - "input": { - "read": { - "common": { - "direct": {} - }, - "base_schema": { - "names": [ - "l_quantity", - "l_extendedprice", - "l_discount", - "l_tax", - "l_returnflag", - "l_linestatus", - "l_shipdate" - ], - "struct": { - "types": [ - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "string": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "string": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - ], - "type_variation_reference": 0, - "nullability": "NULLABILITY_UNSPECIFIED" - } - }, - "filter": { - "scalar_function": { - "function_reference": 2, - "args": [ - { - "scalar_function": { - "function_reference": 0, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 6 - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 6 - } - } - } - }, - { - "literal": { - "nullable": false, - "fp64": 10471 - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - "local_files": { - "items": [ - { - "format": "FILE_FORMAT_UNSPECIFIED", - "partition_index": "0", - "start": "0", - "length": "3719", - "uri_file": "/mock_lineitem.orc" - } - ] - } - } - }, - "expressions": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 0 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 1 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 3 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 4 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 5 - } - } - } - } - ] - } - }, - "expressions": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 4 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 5 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 0 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 1 - } - } - } - }, - { - "scalar_function": { - "function_reference": 4, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 1 - } - } - } - }, - { - "scalar_function": { - "function_reference": 3, - "args": [ - { - "literal": { - "nullable": false, - "fp64": 1 - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - } - ], - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 4, - "args": [ - { - "scalar_function": { - "function_reference": 4, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 1 - } - } - } - }, - { - "scalar_function": { - "function_reference": 3, - "args": [ - { - "literal": { - "nullable": false, - "fp64": 1 - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - } - ], - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 5, - "args": [ - { - "literal": { - "nullable": false, - "fp64": 1 - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 3 - } - } - } - } - ], - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - }, - { - "literal": { - "nullable": false, - "i32": 1 - } - } - ] - } - }, - "groupings": [ - { - "grouping_expressions": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 0 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 1 - } - } - } - } - ] - } - ], - "measures": [ - { - "measure": { - "function_reference": 6, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "measure": { - "function_reference": 6, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 3 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "measure": { - "function_reference": 6, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 4 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "measure": { - "function_reference": 6, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 5 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "measure": { - "function_reference": 7, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "measure": { - "function_reference": 7, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 3 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "measure": { - "function_reference": 7, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 6 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "measure": { - "function_reference": 8, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 7 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "i64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_REQUIRED" - } - } - } - } - ] - } - }, - "names": [ - "real_arrow_output", - "l_returnflag", - "l_linestatus", - "sum", - "sum", - "sum", - "sum", - "sum", - "count", - "sum", - "count", - "sum", - "count", - "count" - ] - } - } - ], - "expected_type_urls": [] -} diff --git a/velox/substrait/tests/q6_first.json b/velox/substrait/tests/q6_first.json deleted file mode 100644 index a48bf5da285e..000000000000 --- a/velox/substrait/tests/q6_first.json +++ /dev/null @@ -1,523 +0,0 @@ -{ - "extension_uris": [], - "extensions": [ - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 4, - "name": "lte:fp64_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 6, - "name": "sum:opt_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 3, - "name": "lt:fp64_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 0, - "name": "is_not_null:fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 1, - "name": "and:bool_bool" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 2, - "name": "gte:fp64_fp64" - } - }, - { - "extension_function": { - "extension_uri_reference": 0, - "function_anchor": 5, - "name": "multiply:opt_fp64_fp64" - } - } - ], - "relations": [ - { - "root": { - "input": { - "aggregate": { - "common": { - "direct": {} - }, - "input": { - "project": { - "common": { - "direct": {} - }, - "input": { - "project": { - "common": { - "direct": {} - }, - "input": { - "read": { - "common": { - "direct": {} - }, - "base_schema": { - "names": [ - "l_quantity", - "l_extendedprice", - "l_discount", - "l_shipdate" - ], - "struct": { - "types": [ - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - }, - { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - ], - "type_variation_reference": 0, - "nullability": "NULLABILITY_UNSPECIFIED" - } - }, - "filter": { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "scalar_function": { - "function_reference": 1, - "args": [ - { - "scalar_function": { - "function_reference": 0, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 3 - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 0, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 0, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 0 - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 2, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 3 - } - } - } - }, - { - "literal": { - "nullable": false, - "fp64": 8766 - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 3, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 3 - } - } - } - }, - { - "literal": { - "nullable": false, - "fp64": 9131 - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 2, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - }, - { - "literal": { - "nullable": false, - "fp64": 0.05 - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 4, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - }, - { - "literal": { - "nullable": false, - "fp64": 0.07 - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - { - "scalar_function": { - "function_reference": 3, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 0 - } - } - } - }, - { - "literal": { - "nullable": false, - "fp64": 24 - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ], - "output_type": { - "bool": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - }, - "local_files": { - "items": [ - { - "format": "FILE_FORMAT_UNSPECIFIED", - "partition_index": "0", - "start": "0", - "length": "3719", - "uri_file": "/mock_lineitem.orc" - } - ] - } - } - }, - "expressions": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 1 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 2 - } - } - } - } - ] - } - }, - "expressions": [ - { - "scalar_function": { - "function_reference": 5, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 0 - } - } - } - }, - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 1 - } - } - } - } - ], - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ] - } - }, - "groupings": [ - { - "grouping_expressions": [] - } - ], - "measures": [ - { - "measure": { - "function_reference": 6, - "args": [ - { - "selection": { - "direct_reference": { - "struct_field": { - "field": 0 - } - } - } - } - ], - "sorts": [], - "phase": "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE", - "output_type": { - "fp64": { - "type_variation_reference": 0, - "nullability": "NULLABILITY_NULLABLE" - } - } - } - } - ] - } - }, - "names": [ - "real_arrow_output", - "sum" - ] - } - } - ], - "expected_type_urls": [] -} diff --git a/velox/type/Filter.cpp b/velox/type/Filter.cpp index c0f9f9d842c5..f30e900cf62a 100644 --- a/velox/type/Filter.cpp +++ b/velox/type/Filter.cpp @@ -490,6 +490,7 @@ std::unique_ptr notNullOrTrue(bool nullAllowed) { } return std::make_unique(); } +} // namespace std::unique_ptr createDoubleValues( const std::vector& values, @@ -572,7 +573,7 @@ std::unique_ptr createBigintValuesFilter( return std::make_unique( min, max, values, nullAllowed); } -} // namespace + std::unique_ptr createBigintValues( const std::vector& values, diff --git a/velox/vector/arrow/c/Bridge.cpp b/velox/vector/arrow/c/Bridge.cpp index a41df4c71272..c95187d00355 100644 --- a/velox/vector/arrow/c/Bridge.cpp +++ b/velox/vector/arrow/c/Bridge.cpp @@ -21,7 +21,7 @@ #include "velox/common/base/Exceptions.h" #include "velox/vector/ComplexVector.h" #include "velox/vector/FlatVector.h" -#include "velox/vector/arrow/Abi.h" +#include "velox/vector/arrow/c/abi.h" namespace facebook::velox {