Skip to content

Commit 3e2628a

Browse files
committed
[native] Relevant changes of presto protocol for distributed procedure
1 parent 1dbd189 commit 3e2628a

File tree

12 files changed

+1123
-527
lines changed

12 files changed

+1123
-527
lines changed

presto-main-base/src/main/java/com/facebook/presto/execution/scheduler/ExecutionWriterTarget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
@JsonSubTypes.Type(value = ExecutionWriterTarget.DeleteHandle.class, name = "DeleteHandle"),
3939
@JsonSubTypes.Type(value = ExecutionWriterTarget.RefreshMaterializedViewHandle.class, name = "RefreshMaterializedViewHandle"),
4040
@JsonSubTypes.Type(value = ExecutionWriterTarget.UpdateHandle.class, name = "UpdateHandle"),
41-
@JsonSubTypes.Type(value = ExecutionWriterTarget.ExecuteProcedureHandle.class, name = "TableExecuteHandle")
41+
@JsonSubTypes.Type(value = ExecutionWriterTarget.ExecuteProcedureHandle.class, name = "ExecuteProcedureHandle")
4242
})
4343
@SuppressWarnings({"EmptyClass", "ClassMayBeInterface"})
4444
public abstract class ExecutionWriterTarget

presto-native-execution/presto_cpp/presto_protocol/connector/hive/HiveConnectorProtocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ using HiveConnectorProtocol = ConnectorProtocolTemplate<
2626
HivePartitioningHandle,
2727
HiveTransactionHandle,
2828
NotImplemented,
29+
NotImplemented,
2930
NotImplemented>;
3031
} // namespace facebook::presto::protocol::hive

presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/IcebergConnectorProtocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ using IcebergConnectorProtocol = ConnectorProtocolTemplate<
2828
NotImplemented,
2929
hive::HiveTransactionHandle,
3030
NotImplemented,
31+
NotImplemented,
3132
NotImplemented>;
3233

3334
} // namespace facebook::presto::protocol::iceberg

presto-native-execution/presto_cpp/presto_protocol/connector/tpch/TpchConnectorProtocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ using TpchConnectorProtocol = ConnectorProtocolTemplate<
2929
TpchPartitioningHandle,
3030
TpchTransactionHandle,
3131
NotImplemented,
32+
NotImplemented,
3233
NotImplemented>;
3334

3435
} // namespace facebook::presto::protocol::tpch

presto-native-execution/presto_cpp/presto_protocol/core/ConnectorProtocol.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ class ConnectorProtocol {
7575
const std::string& thrift,
7676
std::shared_ptr<ConnectorInsertTableHandle>& proto) const = 0;
7777

78+
virtual void to_json(
79+
json& j,
80+
const std::shared_ptr<ConnectorDistributedProcedureHandle>& p) const = 0;
81+
virtual void from_json(
82+
const json& j,
83+
std::shared_ptr<ConnectorDistributedProcedureHandle>& p) const = 0;
84+
7885
virtual void to_json(
7986
json& j,
8087
const std::shared_ptr<ConnectorOutputTableHandle>& p) const = 0;
@@ -117,7 +124,7 @@ class ConnectorProtocol {
117124
std::string& thrift) const = 0;
118125
virtual void deserialize(
119126
const std::string& thrift,
120-
std::shared_ptr<ConnectorTransactionHandle>& proto) const = 0;
127+
std::shared_ptr<ConnectorTransactionHandle>& proto) const = 0;
121128

122129
virtual void to_json(
123130
json& j,
@@ -153,6 +160,7 @@ template <
153160
typename ConnectorSplitType = NotImplemented,
154161
typename ConnectorPartitioningHandleType = NotImplemented,
155162
typename ConnectorTransactionHandleType = NotImplemented,
163+
typename ConnectorDistributedProcedureHandleType = NotImplemented,
156164
typename ConnectorDeleteTableHandleType = NotImplemented,
157165
typename ConnectorIndexHandleType = NotImplemented>
158166
class ConnectorProtocolTemplate final : public ConnectorProtocol {
@@ -221,6 +229,15 @@ class ConnectorProtocolTemplate final : public ConnectorProtocol {
221229
deserializeTemplate<ConnectorInsertTableHandleType>(thrift, proto);
222230
}
223231

232+
void to_json(json& j, const std::shared_ptr<ConnectorDistributedProcedureHandle>& p)
233+
const final {
234+
to_json_template<ConnectorDistributedProcedureHandleType>(j, p);
235+
}
236+
void from_json(const json& j, std::shared_ptr<ConnectorDistributedProcedureHandle>& p)
237+
const final {
238+
from_json_template<ConnectorDistributedProcedureHandleType>(j, p);
239+
}
240+
224241
void to_json(json& j, const std::shared_ptr<ConnectorOutputTableHandle>& p)
225242
const final {
226243
to_json_template<ConnectorOutputTableHandleType>(j, p);
@@ -406,6 +423,7 @@ using SystemConnectorProtocol = ConnectorProtocolTemplate<
406423
SystemPartitioningHandle,
407424
SystemTransactionHandle,
408425
NotImplemented,
426+
NotImplemented,
409427
NotImplemented>;
410428

411429
} // namespace facebook::presto::protocol

0 commit comments

Comments
 (0)