From aba0dfe826ee2bf8c1ac74ccc7db4a5143afcdd1 Mon Sep 17 00:00:00 2001 From: Shai Szulanski Date: Wed, 4 Mar 2026 15:50:08 -0800 Subject: [PATCH] misc: [thrift] Migrate cpp.ref_type and drift.recursive_reference in presto thrift (#27248) Summary: Migrate cpp.ref_type and drift.recursive_reference unstructured annotations to their structured equivalents in presto thrift files: - presto_thrift.thrift - temp_presto_thrift.thrift Reviewed By: Mizuchi Differential Revision: D94726708 --- .../presto_cpp/main/thrift/CMakeLists.txt | 2 ++ .../presto_cpp/main/thrift/presto_thrift.thrift | 10 ++++++---- .../presto_cpp/main/thrift/temp_presto_thrift.thrift | 10 ++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/presto-native-execution/presto_cpp/main/thrift/CMakeLists.txt b/presto-native-execution/presto_cpp/main/thrift/CMakeLists.txt index a551a8f2aea72..a7aba85cdbd6e 100644 --- a/presto-native-execution/presto_cpp/main/thrift/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/thrift/CMakeLists.txt @@ -50,6 +50,8 @@ thrift_library( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/presto_cpp/main/thrift ".." + THRIFT_INCLUDE_DIRECTORIES + ${THRIFT_INCLUDES} ) target_link_libraries(presto_thrift-cpp2 ${presto_thrift_library_dependencies}) set(presto_thrift_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/presto-native-execution/presto_cpp/main/thrift/presto_thrift.thrift b/presto-native-execution/presto_cpp/main/thrift/presto_thrift.thrift index 035e40d5b2823..a8b1b5178344d 100644 --- a/presto-native-execution/presto_cpp/main/thrift/presto_thrift.thrift +++ b/presto-native-execution/presto_cpp/main/thrift/presto_thrift.thrift @@ -12,6 +12,9 @@ * limitations under the License. */ +include "thrift/annotation/cpp.thrift" +include "thrift/annotation/thrift.thrift" + namespace cpp2 facebook.presto.thrift enum TaskState { @@ -579,10 +582,9 @@ struct UpdateHandle { struct ExecutionFailureInfo { 1: string type; 2: string message; - 3: optional ExecutionFailureInfo cause ( - cpp.ref_type = "shared", - drift.recursive_reference = true, - ); + @cpp.Ref{type = cpp.RefType.SharedMutable} + @thrift.DeprecatedUnvalidatedAnnotations{items = {"drift.recursive_reference": "true"}} + 3: optional ExecutionFailureInfo cause; 4: list suppressed; 5: list stack; 6: ErrorLocation errorLocation; diff --git a/presto-native-execution/presto_cpp/main/thrift/temp_presto_thrift.thrift b/presto-native-execution/presto_cpp/main/thrift/temp_presto_thrift.thrift index 035e40d5b2823..a8b1b5178344d 100644 --- a/presto-native-execution/presto_cpp/main/thrift/temp_presto_thrift.thrift +++ b/presto-native-execution/presto_cpp/main/thrift/temp_presto_thrift.thrift @@ -12,6 +12,9 @@ * limitations under the License. */ +include "thrift/annotation/cpp.thrift" +include "thrift/annotation/thrift.thrift" + namespace cpp2 facebook.presto.thrift enum TaskState { @@ -579,10 +582,9 @@ struct UpdateHandle { struct ExecutionFailureInfo { 1: string type; 2: string message; - 3: optional ExecutionFailureInfo cause ( - cpp.ref_type = "shared", - drift.recursive_reference = true, - ); + @cpp.Ref{type = cpp.RefType.SharedMutable} + @thrift.DeprecatedUnvalidatedAnnotations{items = {"drift.recursive_reference": "true"}} + 3: optional ExecutionFailureInfo cause; 4: list suppressed; 5: list stack; 6: ErrorLocation errorLocation;