diff --git a/presto-native-execution/presto_cpp/main/common/Exception.h b/presto-native-execution/presto_cpp/main/common/Exception.h index 3d107e853db81..edd63de13a1b2 100644 --- a/presto-native-execution/presto_cpp/main/common/Exception.h +++ b/presto-native-execution/presto_cpp/main/common/Exception.h @@ -50,57 +50,71 @@ class VeloxToPrestoExceptionTranslator { {0x00020007, "EXCEEDED_LOCAL_MEMORY_LIMIT", protocol::ErrorType::INSUFFICIENT_RESOURCES}}, + {velox::error_code::kMemAborted, {0x00020000, "GENERIC_INSUFFICIENT_RESOURCES", protocol::ErrorType::INSUFFICIENT_RESOURCES}}, + {velox::error_code::kSpillLimitExceeded, {0x00020006, "EXCEEDED_SPILL_LIMIT", protocol::ErrorType::INSUFFICIENT_RESOURCES}}, + {velox::error_code::kMemArbitrationFailure, {0x00020000, - "GENERIC_INSUFFICIENT_RESOURCES", + "MEMORY_ARBITRATION_FAILURE", protocol::ErrorType::INSUFFICIENT_RESOURCES}}, + {velox::error_code::kMemArbitrationTimeout, {0x00020000, "GENERIC_INSUFFICIENT_RESOURCES", protocol::ErrorType::INSUFFICIENT_RESOURCES}}, + {velox::error_code::kMemAllocError, {0x00020000, "GENERIC_INSUFFICIENT_RESOURCES", protocol::ErrorType::INSUFFICIENT_RESOURCES}}, + {velox::error_code::kInvalidState, {0x00010000, "GENERIC_INTERNAL_ERROR", protocol::ErrorType::INTERNAL_ERROR}}, + {velox::error_code::kGenericSpillFailure, {0x00010023, "GENERIC_SPILL_FAILURE", protocol::ErrorType::INTERNAL_ERROR}}, + {velox::error_code::kUnreachableCode, {0x00010000, "GENERIC_INTERNAL_ERROR", protocol::ErrorType::INTERNAL_ERROR}}, + {velox::error_code::kNotImplemented, {0x00010000, "GENERIC_INTERNAL_ERROR", protocol::ErrorType::INTERNAL_ERROR}}, + {velox::error_code::kUnknown, {0x00010000, "GENERIC_INTERNAL_ERROR", protocol::ErrorType::INTERNAL_ERROR}}}}, + {velox::error_source::kErrorSourceUser, {{velox::error_code::kInvalidArgument, {0x00000000, "GENERIC_USER_ERROR", protocol::ErrorType::USER_ERROR}}, + {velox::error_code::kUnsupported, {0x0000000D, "NOT_SUPPORTED", protocol::ErrorType::USER_ERROR}}, + {velox::error_code::kArithmeticError, {0x00000000, "GENERIC_USER_ERROR", protocol::ErrorType::USER_ERROR}}}}, + {velox::error_source::kErrorSourceSystem, {}}}; return kTranslateMap; } diff --git a/presto-spi/src/main/java/com/facebook/presto/spi/StandardErrorCode.java b/presto-spi/src/main/java/com/facebook/presto/spi/StandardErrorCode.java index 90856f013d874..3bd2b3cd12999 100644 --- a/presto-spi/src/main/java/com/facebook/presto/spi/StandardErrorCode.java +++ b/presto-spi/src/main/java/com/facebook/presto/spi/StandardErrorCode.java @@ -144,6 +144,7 @@ public enum StandardErrorCode NO_CPP_SIDECARS(0x0002_0014, INTERNAL_ERROR), HEADER_MODIFICATION_ATTEMPT(0x0002_0015, INTERNAL_ERROR), DUPLICATE_FUNCTION_ERROR(0x0002_0016, INTERNAL_ERROR), + MEMORY_ARBITRATION_FAILURE(0x0002_0017, INSUFFICIENT_RESOURCES), /**/; // Error code range 0x0003 is reserved for Presto-on-Spark