Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,48 @@ std::unique_ptr<velox::connector::ConnectorTableHandle> toIcebergTableHandle(
columnHandles);
}

velox::connector::hive::iceberg::IcebergPartitionSpec::Field
toVeloxIcebergPartitionField(
const protocol::iceberg::IcebergPartitionField& field,
const TypeParser& typeParser,
const protocol::iceberg::PrestoIcebergSchema& schema) {
std::string type;
for (const auto& column : schema.columns) {
if (column.name == field.name) {
type = column.prestoType;
break;
}
}

VELOX_USER_CHECK(
!type.empty(),
"Partition column not found in table schema: {}",
field.name);

return velox::connector::hive::iceberg::IcebergPartitionSpec::Field{
field.name,
stringToType(type, typeParser),
static_cast<velox::connector::hive::iceberg::TransformType>(
field.transform),
field.parameter ? *field.parameter : std::optional<int32_t>()};
}

std::unique_ptr<velox::connector::hive::iceberg::IcebergPartitionSpec>
toVeloxIcebergPartitionSpec(
const protocol::iceberg::PrestoIcebergPartitionSpec& spec,
const TypeParser& typeParser) {
std::vector<velox::connector::hive::iceberg::IcebergPartitionSpec::Field>
fields;
fields.reserve(spec.fields.size());
for (const auto& field : spec.fields) {
fields.emplace_back(
toVeloxIcebergPartitionField(field, typeParser, spec.schema));
}
return std::make_unique<
velox::connector::hive::iceberg::IcebergPartitionSpec>(
spec.specId, fields);
}

} // namespace

std::unique_ptr<velox::connector::ConnectorSplit>
Expand Down Expand Up @@ -293,6 +335,8 @@ IcebergPrestoToVeloxConnector::toVeloxInsertTableHandle(
fmt::format("{}/data", icebergOutputTableHandle->outputPath),
velox::connector::hive::LocationHandle::TableType::kNew),
toVeloxFileFormat(icebergOutputTableHandle->fileFormat),
toVeloxIcebergPartitionSpec(
icebergOutputTableHandle->partitionSpec, typeParser),
std::optional(
toFileCompressionKind(icebergOutputTableHandle->compressionCodec)));
}
Expand Down Expand Up @@ -321,6 +365,8 @@ IcebergPrestoToVeloxConnector::toVeloxInsertTableHandle(
fmt::format("{}/data", icebergInsertTableHandle->outputPath),
velox::connector::hive::LocationHandle::TableType::kExisting),
toVeloxFileFormat(icebergInsertTableHandle->fileFormat),
toVeloxIcebergPartitionSpec(
icebergInsertTableHandle->partitionSpec, typeParser),
std::optional(
toFileCompressionKind(icebergInsertTableHandle->compressionCodec)));
}
Expand Down
2 changes: 1 addition & 1 deletion presto-native-execution/velox
Submodule velox updated 64 files
+2 −2 scripts/setup-centos9.sh
+8 −0 velox/common/base/RuntimeMetrics.h
+11 −2 velox/connectors/hive/HiveConnectorUtil.cpp
+38 −2 velox/connectors/hive/HiveConnectorUtil.h
+24 −10 velox/connectors/hive/HiveDataSource.cpp
+1 −1 velox/connectors/hive/HiveDataSource.h
+22 −3 velox/connectors/hive/TableHandle.cpp
+11 −1 velox/connectors/hive/TableHandle.h
+2 −1 velox/connectors/hive/iceberg/CMakeLists.txt
+8 −2 velox/connectors/hive/iceberg/IcebergDataSink.cpp
+31 −0 velox/connectors/hive/iceberg/IcebergDataSink.h
+157 −0 velox/connectors/hive/iceberg/PartitionSpec.cpp
+145 −0 velox/connectors/hive/iceberg/PartitionSpec.h
+8 −1 velox/connectors/hive/iceberg/tests/CMakeLists.txt
+6 −11 velox/connectors/hive/iceberg/tests/IcebergInsertTest.cpp
+68 −13 velox/connectors/hive/iceberg/tests/IcebergTestBase.cpp
+22 −4 velox/connectors/hive/iceberg/tests/IcebergTestBase.h
+134 −0 velox/connectors/hive/iceberg/tests/PartitionSpecTest.cpp
+18 −18 velox/connectors/hive/tests/HiveConnectorTest.cpp
+1 −1 velox/dwio/common/ColumnVisitors.h
+6 −6 velox/dwio/common/FormatData.h
+16 −16 velox/dwio/common/ScanSpec.h
+2 −2 velox/dwio/common/SelectiveColumnReader.cpp
+0 −1 velox/dwio/common/SelectiveStructColumnReader.cpp
+2 −2 velox/dwio/common/SelectiveStructColumnReader.h
+3 −1 velox/dwio/common/Statistics.h
+4 −2 velox/exec/HashProbe.cpp
+8 −0 velox/exec/fuzzer/CMakeLists.txt
+2 −1 velox/exec/fuzzer/ReferenceQueryRunner.h
+245 −0 velox/exec/fuzzer/VeloxQueryRunner.cpp
+77 −0 velox/exec/fuzzer/VeloxQueryRunner.h
+130 −38 velox/exec/tests/HashJoinTest.cpp
+37 −22 velox/exec/tests/PlanNodeSerdeTest.cpp
+7 −13 velox/exec/tests/PrintPlanWithStatsTest.cpp
+2 −2 velox/exec/tests/TableScanTest.cpp
+5 −0 velox/exec/tests/utils/PlanBuilder.cpp
+3 −0 velox/exec/tests/utils/PlanBuilder.h
+105 −81 velox/experimental/cudf/tests/CMakeLists.txt
+112 −0 velox/experimental/cudf/tests/S3ReadTest.cpp
+1 −0 velox/expression/tests/CustomTypeTest.cpp
+54 −6 velox/functions/lib/DateTimeUtil.h
+5 −2 velox/functions/prestosql/BinaryFunctions.h
+29 −8 velox/functions/prestosql/DateTimeFunctions.h
+8 −6 velox/functions/prestosql/DateTimeImpl.h
+4 −0 velox/functions/prestosql/TypeOf.cpp
+4 −0 velox/functions/prestosql/registration/BinaryFunctionsRegistration.cpp
+2 −0 velox/functions/prestosql/registration/DateTimeFunctionsRegistration.cpp
+36 −0 velox/functions/prestosql/tests/BinaryFunctionsTest.cpp
+1 −0 velox/functions/prestosql/tests/CMakeLists.txt
+62 −4 velox/functions/prestosql/tests/DateTimeFunctionsTest.cpp
+48 −0 velox/functions/prestosql/tests/KHyperLogLogCastTest.cpp
+120 −96 velox/functions/prestosql/tests/TimeWithTimezoneCastTest.cpp
+2 −0 velox/functions/prestosql/tests/TypeOfTest.cpp
+4 −0 velox/functions/prestosql/tests/utils/FunctionBaseTest.cpp
+1 −0 velox/functions/prestosql/types/CMakeLists.txt
+48 −0 velox/functions/prestosql/types/KHyperLogLogRegistration.cpp
+22 −0 velox/functions/prestosql/types/KHyperLogLogRegistration.h
+65 −0 velox/functions/prestosql/types/KHyperLogLogType.h
+32 −20 velox/functions/prestosql/types/TimeWithTimezoneRegistration.cpp
+1 −0 velox/functions/prestosql/types/tests/CMakeLists.txt
+51 −0 velox/functions/prestosql/types/tests/KHyperLogLogTypeTest.cpp
+35 −24 velox/functions/prestosql/types/tests/TimeWithTimezoneTypeTest.cpp
+6 −1 velox/type/Time.cpp
+54 −0 velox/type/Time.h
Loading