From 8036acb2f373bb6ff6f752007bdfd1b7dcdd03c0 Mon Sep 17 00:00:00 2001 From: ClownXC Date: Thu, 9 May 2024 08:02:07 +0800 Subject: [PATCH] remove CommonErrorCodeDeprecated --- .../common/exception/CommonError.java | 26 ++++++++++++++++ .../common/exception/CommonErrorCode.java | 6 +++- .../seatunnel/paimon/utils/RowConverter.java | 21 ++++++------- .../paimon/utils/RowKindConverter.java | 9 +++--- .../paimon/utils/RowTypeConverter.java | 31 +++++++------------ 5 files changed, 55 insertions(+), 38 deletions(-) diff --git a/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonError.java b/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonError.java index 71a0e14676c..70b0bc95e61 100644 --- a/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonError.java +++ b/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonError.java @@ -37,8 +37,11 @@ import static org.apache.seatunnel.common.exception.CommonErrorCode.GET_CATALOG_TABLE_WITH_UNSUPPORTED_TYPE_ERROR; import static org.apache.seatunnel.common.exception.CommonErrorCode.JSON_OPERATION_FAILED; import static org.apache.seatunnel.common.exception.CommonErrorCode.SQL_TEMPLATE_HANDLED_ERROR; +import static org.apache.seatunnel.common.exception.CommonErrorCode.UNSUPPORTED_ARRAY_GENERIC_TYPE; import static org.apache.seatunnel.common.exception.CommonErrorCode.UNSUPPORTED_DATA_TYPE; +import static org.apache.seatunnel.common.exception.CommonErrorCode.UNSUPPORTED_DATA_TYPE_SIMPLE; import static org.apache.seatunnel.common.exception.CommonErrorCode.UNSUPPORTED_ENCODING; +import static org.apache.seatunnel.common.exception.CommonErrorCode.UNSUPPORTED_ROW_KIND; import static org.apache.seatunnel.common.exception.CommonErrorCode.WRITE_SEATUNNEL_ROW_ERROR; /** @@ -87,6 +90,14 @@ public static SeaTunnelRuntimeException writeSeaTunnelRowFailed( return new SeaTunnelRuntimeException(WRITE_SEATUNNEL_ROW_ERROR, params, cause); } + public static SeaTunnelRuntimeException unsupportedDataType( + String identifier, String dataType) { + Map params = new HashMap<>(); + params.put("identifier", identifier); + params.put("dataType", dataType); + return new SeaTunnelRuntimeException(UNSUPPORTED_DATA_TYPE_SIMPLE, params); + } + public static SeaTunnelRuntimeException unsupportedDataType( String identifier, String dataType, String field) { Map params = new HashMap<>(); @@ -199,4 +210,19 @@ public static SeaTunnelRuntimeException sqlTemplateHandledError( params.put("optionName", optionName); return new SeaTunnelRuntimeException(SQL_TEMPLATE_HANDLED_ERROR, params); } + + public static SeaTunnelRuntimeException unsupportedArrayGenericType( + String identifier, String dataType) { + Map params = new HashMap<>(); + params.put("identifier", identifier); + params.put("dataType", dataType); + return new SeaTunnelRuntimeException(UNSUPPORTED_ARRAY_GENERIC_TYPE, params); + } + + public static SeaTunnelRuntimeException unsupportedRowKind(String identifier, String rowKind) { + Map params = new HashMap<>(); + params.put("identifier", identifier); + params.put("rowKind", rowKind); + return new SeaTunnelRuntimeException(UNSUPPORTED_ROW_KIND, params); + } } diff --git a/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java b/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java index 4175050705e..015939eef5b 100644 --- a/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java +++ b/seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java @@ -51,7 +51,11 @@ public enum CommonErrorCode implements SeaTunnelErrorCode { " write SeaTunnelRow failed, the SeaTunnelRow value is ''."), SQL_TEMPLATE_HANDLED_ERROR( "COMMON-24", - "The table of has no , but the template \n