Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/arrow-flight-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
prestocpp-linux-build-for-test:
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.292-20250204112033-cf8ba84
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
concurrency:
group: ${{ github.workflow }}-prestocpp-linux-build-for-test-${{ github.event.pull_request.number }}
cancel-in-progress: true
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
-DCMAKE_PREFIX_PATH=/usr/local \
-DThrift_ROOT=/usr/local \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DMAX_LINK_JOBS=4
-DMAX_LINK_JOBS=3
ninja -C _build/release -j 4

- name: Ccache after
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
needs: prestocpp-linux-build-for-test
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.292-20250204112033-cf8ba84
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
env:
INSTALL_PREFIX: "${{ github.workspace }}/adapter-deps/install"
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prestocpp-linux-adapters-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
prestocpp-linux-adapters-build:
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
concurrency:
group: ${{ github.workflow }}-prestocpp-linux-adapters-build-${{ github.event.pull_request.number }}
cancel-in-progress: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/prestocpp-linux-build-and-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-22.04
needs: changes
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
concurrency:
group: ${{ github.workflow }}-prestocpp-linux-build-test-${{ github.event.pull_request.number }}
cancel-in-progress: true
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
needs: [changes, prestocpp-linux-build-for-test]
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
volumes:
- /usr:/host_usr
- /opt:/host_opt
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
storage-format: [PARQUET, DWRF]
enable-sidecar: [true, false]
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
volumes:
- /usr:/host_usr
- /opt:/host_opt
Expand Down Expand Up @@ -388,7 +388,7 @@ jobs:
group: ${{ github.workflow }}-prestocpp-linux-presto-on-spark-e2e-tests-${{ matrix.storage-format }}-${{ matrix.enable-sidecar }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
volumes:
- /usr:/host_usr
- /opt:/host_opt
Expand Down Expand Up @@ -501,7 +501,7 @@ jobs:
needs: [changes, prestocpp-linux-build-for-test]
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
volumes:
- /usr:/host_usr
- /opt:/host_opt
Expand Down Expand Up @@ -613,7 +613,7 @@ jobs:
needs: [changes, prestocpp-linux-build-for-test]
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
volumes:
- /usr:/host_usr
- /opt:/host_opt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prestocpp-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
contents: read
needs: changes
container:
image: prestodb/presto-native-dependency:0.297-202512180933-75d7d4ea
image: prestodb/presto-native-dependency:0.297-202601311423-22d722a9
volumes:
- /usr:/host_usr
- /opt:/host_opt
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/prestocpp-macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ jobs:
install_velox_deps_from_brew
install_double_conversion

# Install glog/gflags because they are not installed from homebrew.
install_gflags
install_glog

# Velox deps needed by proxygen, a presto dependency.
install_boost
install_fmt
Expand Down
12 changes: 8 additions & 4 deletions presto-native-execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ option(PRESTO_ENABLE_ARROW_FLIGHT_CONNECTOR "Enable Arrow Flight connector" OFF)

option(PRESTO_ENABLE_SPATIAL "Enable spatial support" ON)

# Set all Velox options below and make sure that if we include folly headers or
# other dependency headers that include folly headers we turn off the coroutines
# and turn on int128.
add_compile_definitions(FOLLY_HAVE_INT128_T=1 FOLLY_CFG_NO_COROUTINES)
# Turn on folly int128 support.
add_compile_definitions(FOLLY_HAVE_INT128_T=1)

set(VELOX_ENABLE_S3 ${PRESTO_ENABLE_S3} CACHE BOOL "Build S3 support")

Expand Down Expand Up @@ -184,6 +182,9 @@ find_library(PROXYGEN_HTTP_SERVER proxygenhttpserver)
find_library(FIZZ fizz)
find_library(WANGLE wangle)
find_library(MVFST_EXCEPTION mvfst_exception)
find_library(MVFST_FOLLY_UTILS mvfst_folly_utils)
find_library(MVFST_CODEC_TYPES mvfst_codec_types)
find_library(MVFST_CONTIGUOUS_CURSOR mvfst_contiguous_cursor)

find_library(RE2 re2)

Expand All @@ -199,6 +200,9 @@ set(
${WANGLE}
${FIZZ}
${MVFST_EXCEPTION}
${MVFST_FOLLY_UTILS}
${MVFST_CODEC_TYPES}
${MVFST_CONTIGUOUS_CURSOR}
)
find_path(PROXYGEN_DIR NAMES include/proxygen)
set(PROXYGEN_INCLUDE_DIR "${PROXYGEN_DIR}/include/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,22 @@ toVeloxIcebergPartitionSpec(
spec.specId, fields);
}

velox::parquet::ParquetFieldId toParquetField(
const protocol::iceberg::ColumnIdentity& column) {
std::vector<velox::parquet::ParquetFieldId> children;
if (!column.children.empty()) {
children.reserve(column.children.size());
for (const auto& child : column.children) {
children.push_back(toParquetField(child));
}
}
// ParquetFieldId does not declare a constructor that takes fieldId and
// children, so we use aggregate initialization to make it work for compilers
// that don't create the necessary constructors by default (e.g clang-15).
velox::parquet::ParquetFieldId pf{.fieldId = column.id, .children = children};
return pf;
}

} // namespace

std::unique_ptr<velox::connector::ConnectorSplit>
Expand Down Expand Up @@ -234,13 +250,13 @@ IcebergPrestoToVeloxConnector::toVeloxColumnHandle(
columnParseParameters.partitionDateValueFormat = velox::connector::hive::
HiveColumnHandle::ColumnParseParameters::kDaysSinceEpoch;
}
return std::make_unique<velox::connector::hive::HiveColumnHandle>(

return std::make_unique<velox::connector::hive::iceberg::IcebergColumnHandle>(
icebergColumn->columnIdentity.name,
toHiveColumnType(icebergColumn->columnType),
type,
type,
toRequiredSubfields(icebergColumn->requiredSubfields),
columnParseParameters);
toParquetField(icebergColumn->columnIdentity),
toRequiredSubfields(icebergColumn->requiredSubfields));
}

std::unique_ptr<velox::connector::ConnectorTableHandle>
Expand Down Expand Up @@ -324,7 +340,7 @@ IcebergPrestoToVeloxConnector::toVeloxInsertTableHandle(
createHandle->handle.connectorHandle->_type);

const auto inputColumns =
toHiveColumns(icebergOutputTableHandle->inputColumns, typeParser);
toIcebergColumns(icebergOutputTableHandle->inputColumns, typeParser);

return std::make_unique<
velox::connector::hive::iceberg::IcebergInsertTableHandle>(
Expand Down Expand Up @@ -354,7 +370,7 @@ IcebergPrestoToVeloxConnector::toVeloxInsertTableHandle(
insertHandle->handle.connectorHandle->_type);

const auto inputColumns =
toHiveColumns(icebergInsertTableHandle->inputColumns, typeParser);
toIcebergColumns(icebergInsertTableHandle->inputColumns, typeParser);

return std::make_unique<
velox::connector::hive::iceberg::IcebergInsertTableHandle>(
Expand All @@ -370,18 +386,20 @@ IcebergPrestoToVeloxConnector::toVeloxInsertTableHandle(
toFileCompressionKind(icebergInsertTableHandle->compressionCodec)));
}

std::vector<velox::connector::hive::HiveColumnHandlePtr>
IcebergPrestoToVeloxConnector::toHiveColumns(
std::vector<velox::connector::hive::iceberg::IcebergColumnHandlePtr>
IcebergPrestoToVeloxConnector::toIcebergColumns(
const protocol::List<protocol::iceberg::IcebergColumnHandle>& inputColumns,
const TypeParser& typeParser) const {
std::vector<velox::connector::hive::HiveColumnHandlePtr> hiveColumns;
hiveColumns.reserve(inputColumns.size());
std::vector<velox::connector::hive::iceberg::IcebergColumnHandlePtr>
icebergColumns;
icebergColumns.reserve(inputColumns.size());
for (const auto& columnHandle : inputColumns) {
hiveColumns.emplace_back(
std::dynamic_pointer_cast<velox::connector::hive::HiveColumnHandle>(
icebergColumns.emplace_back(
std::dynamic_pointer_cast<
velox::connector::hive::iceberg::IcebergColumnHandle>(
std::shared_ptr(toVeloxColumnHandle(&columnHandle, typeParser))));
}
return hiveColumns;
return icebergColumns;
}

} // namespace facebook::presto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "presto_cpp/main/connectors/PrestoToVeloxConnector.h"
#include "presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.h"

#include "velox/connectors/hive/iceberg/IcebergColumnHandle.h"

namespace facebook::presto {

class IcebergPrestoToVeloxConnector final : public PrestoToVeloxConnector {
Expand Down Expand Up @@ -52,7 +54,8 @@ class IcebergPrestoToVeloxConnector final : public PrestoToVeloxConnector {
const TypeParser& typeParser) const final;

private:
std::vector<velox::connector::hive::HiveColumnHandlePtr> toHiveColumns(
std::vector<velox::connector::hive::iceberg::IcebergColumnHandlePtr>
toIcebergColumns(
const protocol::List<protocol::iceberg::IcebergColumnHandle>&
inputColumns,
const TypeParser& typeParser) const;
Expand Down
44 changes: 30 additions & 14 deletions presto-native-execution/presto_cpp/main/thrift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,24 @@ find_library(THRIFT_CORE thrift-core)
find_library(THRIFT_PROTOCOL thriftprotocol)
find_library(THRIFT_METADATA thriftmetadata)
find_library(THRIFT_TRANSPORT transport)
find_library(THRIDT_ASYNC async)
find_library(THRIFT_RPC_METADATA rpcmetadata)
find_library(THRIFT_TYPEREP thrifttyperep)

find_path(THRIFT_INCLUDES thrift/lib/cpp2/gen/module_data_h.h PATH_SUFFIXES include REQUIRED)

set(
presto_thrift_library_dependencies
${THRIFT_PROTOCOL}
${THRIFT_METADATA}
${THRIFT_CORE}
${THRIFT_TYPEREP}
${THRIFT_ASYNC}
${THRIFT_TRANSPORT}
${THRIFT_RPC_METADATA}
${FOLLY_WITH_DEPENDENCIES}
)

include(ThriftLibrary.cmake)

thrift_library(
Expand All @@ -29,16 +45,16 @@ thrift_library(
${CMAKE_CURRENT_BINARY_DIR}/presto_cpp/main/thrift
".."
)
target_link_libraries(
presto_thrift-cpp2
${THRIFT_PROTOCOL}
${THRIFT_METADATA}
${THRIFT_CORE}
${THRIFT_TRANSPORT}
)
target_link_libraries(presto_thrift-cpp2 ${presto_thrift_library_dependencies})
set(presto_thrift_INCLUDES ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(presto_thrift-cpp2 PUBLIC ${presto_thrift_INCLUDES} ${GLOG_INCLUDE_DIR})
target_include_directories(presto_thrift-cpp2-obj PUBLIC ${THRIFT_INCLUDES} ${GLOG_INCLUDE_DIR})
# Find libevent on macOS (required by FBThrift)
# Usually /opt/homebrew/include is a CMake isystem path but sometimes it is not (e.g. in the CI).
# It doesn't hurt making sure event.h will be found..
if(APPLE)
target_include_directories(presto_thrift-cpp2 SYSTEM INTERFACE "/opt/homebrew/include")
endif()

thrift_library(
presto_native
Expand All @@ -49,16 +65,16 @@ thrift_library(
${CMAKE_CURRENT_BINARY_DIR}/presto_cpp/main/thrift
".."
)
target_link_libraries(
presto_native-cpp2
${THRIFT_PROTOCOL}
${THRIFT_METADATA}
${THRIFT_CORE}
${THRIFT_TRANSPORT}
)
target_link_libraries(presto_native-cpp2 ${presto_thrift_library_dependencies})
set(presto_native_INCLUDES ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(presto_native-cpp2 PUBLIC ${presto_native_INCLUDES} ${GLOG_INCLUDE_DIR})
target_include_directories(presto_native-cpp2-obj PUBLIC ${THRIFT_INCLUDES} ${GLOG_INCLUDE_DIR})
# Find libevent on macOS (required by FBThrift)
# Usually /opt/homebrew/include is a CMake isystem path but sometimes it is not (e.g. in the CI).
# It doesn't hurt making sure event.h will be found..
if(APPLE)
target_include_directories(presto_native-cpp2 SYSTEM INTERFACE "/opt/homebrew/include")
endif()

add_library(presto_thrift_extra ProtocolToThrift.cpp)
target_include_directories(
Expand Down
Loading
Loading