diff --git a/.gitmodules b/.gitmodules index 6fb925ff13ecf..5c8e794550874 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "presto-native-execution/velox"] path = presto-native-execution/velox - url = https://github.com/facebookincubator/velox.git + url = https://github.com/pdabre12/velox.git + branch = cte-page-reader diff --git a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxConnector.cpp b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxConnector.cpp index 9cc3568787e2b..f286abda38d26 100644 --- a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxConnector.cpp +++ b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxConnector.cpp @@ -94,7 +94,7 @@ dwio::common::FileFormat toVeloxFileFormat( return dwio::common::FileFormat::NIMBLE; } VELOX_UNSUPPORTED( - "Unsupported file format: {} {}", format.inputFormat, format.serDe); + "Unsupported file format123: {} {}", format.inputFormat, format.serDe); } dwio::common::FileFormat toVeloxFileFormat( @@ -104,7 +104,7 @@ dwio::common::FileFormat toVeloxFileFormat( } else if (format == protocol::iceberg::FileFormat::PARQUET) { return dwio::common::FileFormat::PARQUET; } - VELOX_UNSUPPORTED("Unsupported file format: {}", fmt::underlying(format)); + VELOX_UNSUPPORTED("Unsupported file format123: {}", fmt::underlying(format)); } template @@ -805,7 +805,7 @@ std::unique_ptr toHiveTableHandle( const protocol::Map& tableParameters, const VeloxExprConverter& exprConverter, const TypeParser& typeParser) { - common::SubfieldFilters subfieldFilters; + velox::connector::hive::SubfieldFilters subfieldFilters; auto domains = domainPredicate.domains; for (const auto& domain : *domains) { auto filter = domain.second; @@ -905,6 +905,8 @@ dwio::common::FileFormat toFileFormat( case protocol::hive::HiveStorageFormat::ALPHA: // This has been renamed in Velox from ALPHA to NIMBLE. return dwio::common::FileFormat::NIMBLE; + case protocol::hive::HiveStorageFormat::PAGEFILE: + return dwio::common::FileFormat::PAGEFILE; default: VELOX_UNSUPPORTED( "Unsupported file format in {}: {}.", diff --git a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeCteExecutionPageFile.java b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeCteExecutionPageFile.java new file mode 100644 index 0000000000000..dfb2306984069 --- /dev/null +++ b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeCteExecutionPageFile.java @@ -0,0 +1,62 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.facebook.presto.nativeworker; + +import com.facebook.presto.Session; +import com.facebook.presto.testing.QueryRunner; + +import static com.facebook.presto.SystemSessionProperties.CTE_FILTER_AND_PROJECTION_PUSHDOWN_ENABLED; +import static com.facebook.presto.SystemSessionProperties.CTE_MATERIALIZATION_STRATEGY; +import static com.facebook.presto.SystemSessionProperties.PARTITIONING_PROVIDER_CATALOG; +import static com.facebook.presto.SystemSessionProperties.PUSHDOWN_SUBFIELDS_ENABLED; +import static com.facebook.presto.SystemSessionProperties.VERBOSE_OPTIMIZER_INFO_ENABLED; + +public class TestPrestoNativeCteExecutionPageFile + extends AbstractTestNativeCteExecution +{ + @Override + protected QueryRunner createQueryRunner() + throws Exception + { + return PrestoNativeQueryRunnerUtils.createNativeCteQueryRunner(true, "PAGEFILE"); + } + + @Override + protected QueryRunner createExpectedQueryRunner() + throws Exception + { + return PrestoNativeQueryRunnerUtils.createJavaQueryRunner("PAGEFILE"); + } + + @Override + protected Session getSession() + { + return Session.builder(super.getSession()) + .setSystemProperty(PUSHDOWN_SUBFIELDS_ENABLED, "true") + .setSystemProperty(CTE_MATERIALIZATION_STRATEGY, "NONE") + .build(); + } + + @Override + protected Session getMaterializedSession() + { + return Session.builder(super.getSession()) + .setSystemProperty(PUSHDOWN_SUBFIELDS_ENABLED, "true") + .setSystemProperty(VERBOSE_OPTIMIZER_INFO_ENABLED, "true") + .setSystemProperty(PARTITIONING_PROVIDER_CATALOG, "hive") + .setSystemProperty(CTE_MATERIALIZATION_STRATEGY, "ALL") + .setSystemProperty(CTE_FILTER_AND_PROJECTION_PUSHDOWN_ENABLED, "true") + .build(); + } +} diff --git a/presto-native-execution/velox b/presto-native-execution/velox index ce273fac228ca..d2d3e906ad294 160000 --- a/presto-native-execution/velox +++ b/presto-native-execution/velox @@ -1 +1 @@ -Subproject commit ce273fac228ca214386c9a577b11e755994ef611 +Subproject commit d2d3e906ad294df42073770d96fe1c9da4e573c5