From 4479b249daed7706fa0b9a3fefb891e7a23771ca Mon Sep 17 00:00:00 2001 From: Karthikeyan Natarajan Date: Mon, 22 Sep 2025 19:09:08 -0500 Subject: [PATCH] cudf scan using CudfHiveConnector, Add linking to cudf Co-authored-by: Devavret Makkar --- .../presto_cpp/main/connectors/CMakeLists.txt | 5 +++++ .../presto_cpp/main/connectors/Registration.cpp | 16 ++++++++++++++++ .../presto_cpp/main/types/CMakeLists.txt | 1 + 3 files changed, 22 insertions(+) diff --git a/presto-native-execution/presto_cpp/main/connectors/CMakeLists.txt b/presto-native-execution/presto_cpp/main/connectors/CMakeLists.txt index 5ba165c0ad67d..8d1905217359c 100644 --- a/presto-native-execution/presto_cpp/main/connectors/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/connectors/CMakeLists.txt @@ -19,5 +19,10 @@ if(PRESTO_ENABLE_ARROW_FLIGHT_CONNECTOR) target_link_libraries(presto_connectors presto_flight_connector) endif() +if(PRESTO_ENABLE_CUDF) + target_link_libraries(presto_connectors velox_cudf_hive_connector + cudf::cudf) +endif() + target_link_libraries(presto_connectors presto_velox_expr_conversion velox_type_fbhive) diff --git a/presto-native-execution/presto_cpp/main/connectors/Registration.cpp b/presto-native-execution/presto_cpp/main/connectors/Registration.cpp index d6f6555fb8a22..44944c526e7bd 100644 --- a/presto-native-execution/presto_cpp/main/connectors/Registration.cpp +++ b/presto-native-execution/presto_cpp/main/connectors/Registration.cpp @@ -19,6 +19,10 @@ #include "presto_cpp/main/connectors/arrow_flight/ArrowPrestoToVeloxConnector.h" #endif +#ifdef PRESTO_ENABLE_CUDF +#include "velox/experimental/cudf/connectors/hive/CudfHiveConnector.h" +#endif + #include "velox/connectors/hive/HiveConnector.h" #include "velox/connectors/tpch/TpchConnector.h" @@ -31,6 +35,16 @@ constexpr char const* kIcebergConnectorName = "iceberg"; void registerConnectorFactories() { // These checks for connector factories can be removed after we remove the // registrations from the Velox library. +#ifdef PRESTO_ENABLE_CUDF + if (!velox::connector::hasConnectorFactory( + velox::connector::hive::HiveConnectorFactory::kHiveConnectorName)) { + velox::connector::registerConnectorFactory( + std::make_shared()); + velox::connector::registerConnectorFactory( + std::make_shared( + kHiveHadoop2ConnectorName)); + } +#else if (!velox::connector::hasConnectorFactory( velox::connector::hive::HiveConnectorFactory::kHiveConnectorName)) { velox::connector::registerConnectorFactory( @@ -39,6 +53,8 @@ void registerConnectorFactories() { std::make_shared( kHiveHadoop2ConnectorName)); } +#endif + if (!velox::connector::hasConnectorFactory( velox::connector::tpch::TpchConnectorFactory::kTpchConnectorName)) { velox::connector::registerConnectorFactory( diff --git a/presto-native-execution/presto_cpp/main/types/CMakeLists.txt b/presto-native-execution/presto_cpp/main/types/CMakeLists.txt index 8b168254334aa..85215e2fb7b89 100644 --- a/presto-native-execution/presto_cpp/main/types/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/types/CMakeLists.txt @@ -19,6 +19,7 @@ target_link_libraries(presto_velox_expr_conversion velox_presto_types add_library(presto_types PrestoToVeloxQueryPlan.cpp VeloxPlanValidator.cpp PrestoToVeloxSplit.cpp) +target_compile_definitions(presto_types PUBLIC VELOX_ENABLE_BACKWARD_COMPATIBILITY) target_link_libraries( presto_types presto_velox_expr_conversion