-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[native] Add Iceberg Connector to parse Java Iceberg Plan Fragment
Introduce presto protocol changes to parse/deserialize Iceberg Plan Fragment and other Iceberg Java objects
- Loading branch information
1 parent
f5f930c
commit 4bd39ae
Showing
25 changed files
with
13,178 additions
and
11,107 deletions.
There are no files selected for viewing
19,957 changes: 10,529 additions & 9,428 deletions
19,957
presto-native-execution/presto_cpp/presto_protocol/presto_protocol.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
3,697 changes: 2,025 additions & 1,672 deletions
3,697
presto-native-execution/presto_cpp/presto_protocol/presto_protocol.h
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
presto-native-execution/presto_cpp/presto_protocol/special/BaseHiveColumnHandle.hpp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
namespace facebook::presto::protocol { | ||
|
||
struct BaseHiveColumnHandle : public ColumnHandle { | ||
String name = {}; | ||
std::shared_ptr<String> comment = {}; | ||
ColumnType columnType = {}; | ||
List<Subfield> requiredSubfields = {}; | ||
|
||
bool operator<(const ColumnHandle& o) const override { | ||
return name < dynamic_cast<const BaseHiveColumnHandle&>(o).name; | ||
} | ||
}; | ||
|
||
void to_json(json& j, const BaseHiveColumnHandle& p); | ||
void from_json(const json& j, BaseHiveColumnHandle& p); | ||
|
||
} // namespace facebook::presto::protocol |
21 changes: 21 additions & 0 deletions
21
presto-native-execution/presto_cpp/presto_protocol/special/BaseHiveTableHandle.hpp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
namespace facebook::presto::protocol { | ||
struct BaseHiveTableHandle : public ConnectorTableHandle { | ||
String schemaName = {}; | ||
String tableName = {}; | ||
}; | ||
void to_json(json& j, const BaseHiveTableHandle& p); | ||
void from_json(const json& j, BaseHiveTableHandle& p); | ||
} // namespace facebook::presto::protocol |
27 changes: 27 additions & 0 deletions
27
presto-native-execution/presto_cpp/presto_protocol/special/BaseHiveTableLayoutHandle.hpp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
namespace facebook::presto::protocol { | ||
|
||
struct BaseHiveTableLayoutHandle : public ConnectorTableLayoutHandle { | ||
List<BaseHiveColumnHandle> partitionColumns = {}; | ||
TupleDomain<Subfield> domainPredicate = {}; | ||
std::shared_ptr<RowExpression> remainingPredicate = {}; | ||
bool pushdownFilterEnabled = {}; | ||
TupleDomain<std::shared_ptr<ColumnHandle>> partitionColumnPredicate = {}; | ||
}; | ||
|
||
void to_json(json& j, const BaseHiveTableLayoutHandle& p); | ||
void from_json(const json& j, BaseHiveTableLayoutHandle& p); | ||
|
||
} // namespace facebook::presto::protocol |
58 changes: 58 additions & 0 deletions
58
presto-native-execution/presto_cpp/presto_protocol/special/ChangelogOperation.cpp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace facebook::presto::protocol { | ||
|
||
static const std::pair<ChangelogOperation, json> | ||
ChangelogOperation_enum_table[] = { // NOLINT: cert-err58-cpp | ||
{ChangelogOperation::INSERT, "INSERT"}, | ||
{ChangelogOperation::DELETE, "DELETE"}, | ||
{ChangelogOperation::UPDATE_BEFORE, "UPDATE_BEFORE"}, | ||
{ChangelogOperation::UPDATE_AFTER, "UPDATE_AFTER"}}; | ||
|
||
void to_json(json& j, const ChangelogOperation& e) { | ||
static_assert( | ||
std::is_enum<ChangelogOperation>::value, | ||
"ChangelogOperation must be an enum!"); | ||
|
||
const auto* it = std::find_if( | ||
std::begin(ChangelogOperation_enum_table), | ||
std::end(ChangelogOperation_enum_table), | ||
[e](const std::pair<ChangelogOperation, json>& ej_pair) -> bool { | ||
return ej_pair.first == e; | ||
}); | ||
j = ((it != std::end(ChangelogOperation_enum_table)) | ||
? it | ||
: std::begin(ChangelogOperation_enum_table)) | ||
->second; | ||
} | ||
|
||
void from_json(const json& j, ChangelogOperation& e) { | ||
static_assert( | ||
std::is_enum<ChangelogOperation>::value, | ||
"ChangelogOperation must be an enum!"); | ||
|
||
const auto* it = std::find_if( | ||
std::begin(ChangelogOperation_enum_table), | ||
std::end(ChangelogOperation_enum_table), | ||
[&j](const std::pair<ChangelogOperation, json>& ej_pair) -> bool { | ||
return ej_pair.second == j; | ||
}); | ||
e = ((it != std::end(ChangelogOperation_enum_table)) | ||
? it | ||
: std::begin(ChangelogOperation_enum_table)) | ||
->first; | ||
} | ||
|
||
} // namespace facebook::presto::protocol |
21 changes: 21 additions & 0 deletions
21
presto-native-execution/presto_cpp/presto_protocol/special/ChangelogOperation.hpp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace facebook::presto::protocol { | ||
enum class ChangelogOperation { INSERT, DELETE, UPDATE_BEFORE, UPDATE_AFTER }; | ||
|
||
void to_json(json& j, const ChangelogOperation& p); | ||
void from_json(const json& j, ChangelogOperation& p); | ||
|
||
} // namespace facebook::presto::protocol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
presto-native-execution/presto_cpp/presto_protocol/special/ColumnType.cpp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace facebook::presto::protocol { | ||
|
||
static const std::pair<ColumnType, json> ColumnType_enum_table[] = | ||
{ // NOLINT: cert-err58-cpp | ||
{ColumnType::PARTITION_KEY, "PARTITION_KEY"}, | ||
{ColumnType::REGULAR, "REGULAR"}, | ||
{ColumnType::SYNTHESIZED, "SYNTHESIZED"}, | ||
{ColumnType::AGGREGATED, "AGGREGATED"}}; | ||
|
||
void to_json(json& j, const ColumnType& e) { | ||
static_assert(std::is_enum<ColumnType>::value, "ColumnType must be an enum!"); | ||
|
||
const auto* it = std::find_if( | ||
std::begin(ColumnType_enum_table), | ||
std::end(ColumnType_enum_table), | ||
[e](const std::pair<ColumnType, json>& ej_pair) -> bool { | ||
return ej_pair.first == e; | ||
}); | ||
j = ((it != std::end(ColumnType_enum_table)) | ||
? it | ||
: std::begin(ColumnType_enum_table)) | ||
->second; | ||
} | ||
|
||
void from_json(const json& j, ColumnType& e) { | ||
static_assert(std::is_enum<ColumnType>::value, "ColumnType must be an enum!"); | ||
|
||
const auto* it = std::find_if( | ||
std::begin(ColumnType_enum_table), | ||
std::end(ColumnType_enum_table), | ||
[&j](const std::pair<ColumnType, json>& ej_pair) -> bool { | ||
return ej_pair.second == j; | ||
}); | ||
e = ((it != std::end(ColumnType_enum_table)) | ||
? it | ||
: std::begin(ColumnType_enum_table)) | ||
->first; | ||
} | ||
|
||
} // namespace facebook::presto::protocol |
21 changes: 21 additions & 0 deletions
21
presto-native-execution/presto_cpp/presto_protocol/special/ColumnType.hpp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace facebook::presto::protocol { | ||
enum class ColumnType { PARTITION_KEY, REGULAR, SYNTHESIZED, AGGREGATED }; | ||
|
||
void to_json(json& j, const ColumnType& p); | ||
void from_json(const json& j, ColumnType& p); | ||
|
||
} // namespace facebook::presto::protocol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.