From bd3ff3b019bad8b40461872d686875d35151d388 Mon Sep 17 00:00:00 2001 From: Deepak Majeti Date: Thu, 9 May 2024 15:27:08 -0400 Subject: [PATCH] [native] Register Velox hive connector factory for iceberg The current iceberg catalog uses "hive" for the connector.name. Register a Velox hive connector factory for iceberg with name `iceberg`. "connector.name=iceberg" is now supported. --- presto-native-execution/etc/catalog/iceberg.properties | 3 +-- presto-native-execution/presto_cpp/main/PrestoServer.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/presto-native-execution/etc/catalog/iceberg.properties b/presto-native-execution/etc/catalog/iceberg.properties index 0aa3c6df982a..f3a43dcb2812 100644 --- a/presto-native-execution/etc/catalog/iceberg.properties +++ b/presto-native-execution/etc/catalog/iceberg.properties @@ -1,2 +1 @@ -# The Presto "iceberg" catalog is handled by the hive connector in Presto native execution. -connector.name=hive \ No newline at end of file +connector.name=iceberg diff --git a/presto-native-execution/presto_cpp/main/PrestoServer.cpp b/presto-native-execution/presto_cpp/main/PrestoServer.cpp index fb85bd3ea2f9..5bc0d5ef4b60 100644 --- a/presto-native-execution/presto_cpp/main/PrestoServer.cpp +++ b/presto-native-execution/presto_cpp/main/PrestoServer.cpp @@ -46,6 +46,7 @@ #include "velox/common/memory/MmapAllocator.h" #include "velox/common/memory/SharedArbitrator.h" #include "velox/connectors/Connector.h" +#include "velox/connectors/hive/HiveConnector.h" #include "velox/core/Config.h" #include "velox/exec/OutputBufferManager.h" #include "velox/functions/prestosql/aggregates/RegisterAggregateFunctions.h" @@ -224,6 +225,11 @@ void PrestoServer::run() { registerShuffleInterfaceFactories(); registerCustomOperators(); + // Register Velox connector factory for iceberg. + // The iceberg catalog is handled by the hive connector factory. + connector::registerConnectorFactory( + std::make_shared("iceberg")); + registerPrestoToVeloxConnector( std::make_unique("hive")); registerPrestoToVeloxConnector(