Skip to content

Commit

Permalink
fix enum util
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed Dec 5, 2024
1 parent ac80e3a commit 582202e
Showing 1 changed file with 40 additions and 29 deletions.
69 changes: 40 additions & 29 deletions src/delta_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,37 +107,48 @@ ffi::EngineError *DuckDBEngineError::AllocateError(ffi::KernelError etype, ffi::
string DuckDBEngineError::KernelErrorEnumToString(ffi::KernelError err) {
const char *KERNEL_ERROR_ENUM_STRINGS[] = {
"UnknownError",
"FFIError",
"ArrowError",
"EngineDataTypeError",
"ExtractError",
"GenericError",
"IOErrorError",
"ParquetError",
"ObjectStoreError",
"ObjectStorePathError",
"Reqwest",
"FileNotFoundError",
"MissingColumnError",
"UnexpectedColumnTypeError",
"MissingDataError",
"MissingVersionError",
"DeletionVectorError",
"InvalidUrlError",
"MalformedJsonError",
"MissingMetadataError",
"MissingProtocolError",
"MissingMetadataAndProtocolError",
"ParseError",
"JoinFailureError",
"Utf8Error",
"ParseIntError",
"InvalidColumnMappingMode",
"InvalidTableLocation",
"InvalidDecimalError",
"FFIError",
"ArrowError",
"EngineDataTypeError",
"ExtractError",
"GenericError",
"IOErrorError",
"ParquetError",
"ObjectStoreError",
"ObjectStorePathError",
"ReqwestError",
"FileNotFoundError",
"MissingColumnError",
"UnexpectedColumnTypeError",
"MissingDataError",
"MissingVersionError",
"DeletionVectorError",
"InvalidUrlError",
"MalformedJsonError",
"MissingMetadataError",
"MissingProtocolError",
"InvalidProtocolError",
"MissingMetadataAndProtocolError",
"ParseError",
"JoinFailureError",
"Utf8Error",
"ParseIntError",
"InvalidColumnMappingModeError",
"InvalidTableLocationError",
"InvalidDecimalError",
"InvalidStructDataError",
"InternalError",
"InvalidExpression",
"InvalidLogPath",
"InvalidCommitInfo",
"FileAlreadyExists",
"MissingCommitInfo",
"UnsupportedError",
"ParseIntervalError",
"ChangeDataFeedUnsupported"
};

static_assert(sizeof(KERNEL_ERROR_ENUM_STRINGS) / sizeof(char *) - 1 == (int)ffi::KernelError::InvalidDecimalError,
static_assert(sizeof(KERNEL_ERROR_ENUM_STRINGS) / sizeof(char *) - 1 == (int)ffi::KernelError::ChangeDataFeedUnsupported,
"KernelErrorEnumStrings mismatched with kernel");

if ((int)err < sizeof(KERNEL_ERROR_ENUM_STRINGS) / sizeof(char *)) {
Expand Down

0 comments on commit 582202e

Please sign in to comment.