diff --git a/presto-native-execution/CMakeLists.txt b/presto-native-execution/CMakeLists.txt index 4eadf42a7ee3e..6b5972e128a3b 100644 --- a/presto-native-execution/CMakeLists.txt +++ b/presto-native-execution/CMakeLists.txt @@ -58,6 +58,10 @@ if(PRESTO_ENABLE_PARQUET) add_definitions(-DPRESTO_ENABLE_PARQUET) endif() +if(VELOX_ENABLE_HDFS) + add_definitions(-DVELOX_ENABLE_HDFS) +endif() + set(VELOX_BUILD_TESTING OFF CACHE BOOL "Enable Velox tests") diff --git a/presto-native-execution/Makefile b/presto-native-execution/Makefile index 613d550a8f711..02f8f0ffa1025 100644 --- a/presto-native-execution/Makefile +++ b/presto-native-execution/Makefile @@ -21,12 +21,14 @@ CPU_TARGET ?= "avx" CMAKE_PREFIX_PATH ?= "/usr/local" PRESTO_ENABLE_PARQUET ?= "OFF" +VELOX_ENABLE_HDFS ?= "OFF" CMAKE_FLAGS := -DTREAT_WARNINGS_AS_ERRORS=${TREAT_WARNINGS_AS_ERRORS} CMAKE_FLAGS += -DENABLE_ALL_WARNINGS=${ENABLE_WALL} CMAKE_FLAGS += -DCMAKE_PREFIX_PATH=$(CMAKE_PREFIX_PATH) CMAKE_FLAGS += -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) CMAKE_FLAGS += -DPRESTO_ENABLE_PARQUET=$(PRESTO_ENABLE_PARQUET) +CMAKE_FLAGS += -DVELOX_ENABLE_HDFS=$(VELOX_ENABLE_HDFS) # Use Ninja if available. If Ninja is used, pass through parallelism control flags. USE_NINJA ?= 1 diff --git a/presto-native-execution/presto_cpp/main/CMakeLists.txt b/presto-native-execution/presto_cpp/main/CMakeLists.txt index a96fa1db62966..23db4ad0769b0 100644 --- a/presto-native-execution/presto_cpp/main/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/CMakeLists.txt @@ -84,6 +84,10 @@ target_link_libraries( ${CIDER_VELOX_LIB} ) +if(VELOX_ENABLE_HDFS) + target_link_libraries(presto_server_lib velox_hdfs) +endif() + add_executable(presto_server PrestoMain.cpp) target_link_libraries( diff --git a/presto-native-execution/presto_cpp/main/connectors/hive/storage_adapters/FileSystems.cpp b/presto-native-execution/presto_cpp/main/connectors/hive/storage_adapters/FileSystems.cpp index 98fcbcc69db10..c2031ea54f83b 100644 --- a/presto-native-execution/presto_cpp/main/connectors/hive/storage_adapters/FileSystems.cpp +++ b/presto-native-execution/presto_cpp/main/connectors/hive/storage_adapters/FileSystems.cpp @@ -18,12 +18,19 @@ #include "velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.h" // @manual #endif +#ifdef VELOX_ENABLE_HDFS +#include "velox/connectors/hive/storage_adapters/hdfs/HdfsFileSystem.h" // @manual +#endif + namespace facebook::presto { void registerOptionalHiveStorageAdapters() { #ifdef PRESTO_ENABLE_S3 velox::filesystems::registerS3FileSystem(); #endif +#ifdef VELOX_ENABLE_HDFS + velox::filesystems::registerHdfsFileSystem(); +#endif } } // namespace facebook::presto