You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2023/06/14 15:22:31 UTC
[arrow-adbc] branch main updated: chore(java/core): document the status codes (#792)
This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 3615f0bf chore(java/core): document the status codes (#792)
3615f0bf is described below
commit 3615f0bfedb585de85bda1b0f6d0505aeb7cf9a1
Author: David Li <li...@gmail.com>
AuthorDate: Wed Jun 14 11:22:26 2023 -0400
chore(java/core): document the status codes (#792)
Fixes #566.
---
.../org/apache/arrow/adbc/core/AdbcException.java | 3 +
.../org/apache/arrow/adbc/core/AdbcStatusCode.java | 72 +++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)
diff --git a/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcException.java b/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcException.java
index 0913d8b0..be5a4c6b 100644
--- a/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcException.java
+++ b/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcException.java
@@ -62,14 +62,17 @@ public class AdbcException extends Exception {
return new AdbcException(message, /*cause*/ null, AdbcStatusCode.NOT_IMPLEMENTED, null, 0);
}
+ /** The ADBC status code. */
public AdbcStatusCode getStatus() {
return status;
}
+ /** A SQLSTATE error code, if provided, as defined by the SQL:2003 standard. */
public String getSqlState() {
return sqlState;
}
+ /** A vendor-specific error code, if applicable. */
public int getVendorCode() {
return vendorCode;
}
diff --git a/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcStatusCode.java b/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcStatusCode.java
index 7b8c6345..1e09babf 100644
--- a/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcStatusCode.java
+++ b/java/core/src/main/java/org/apache/arrow/adbc/core/AdbcStatusCode.java
@@ -34,18 +34,88 @@ public enum AdbcStatusCode {
* <p>May indicate client-side or database-side error.
*/
NOT_IMPLEMENTED,
- /** */
+ /**
+ * \brief A requested resource already exists.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
NOT_FOUND,
+ /**
+ * A requested resource already exists.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
ALREADY_EXISTS,
+ /**
+ * The arguments are invalid, likely a programming error.
+ *
+ * <p>For instance, they may be of the wrong format, or out of range.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
INVALID_ARGUMENT,
+ /**
+ * The preconditions for the operation are not met, likely a programming error.
+ *
+ * <p>For instance, the object may be uninitialized, or may have not been fully configured.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
INVALID_STATE,
+ /**
+ * Invalid data was processed (not a programming error).
+ *
+ * <p>For instance, a division by zero may have occurred during query execution.
+ *
+ * <p>May indicate a database-side error only.
+ */
INVALID_DATA,
+ /**
+ * The database's integrity was affected.
+ *
+ * <p>For instance, a foreign key check may have failed, or a uniqueness constraint may have been
+ * violated.
+ *
+ * <p>May indicate a database-side error only.
+ */
INTEGRITY,
+ /**
+ * An error internal to the driver or database occurred.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
INTERNAL,
+ /**
+ * An I/O error occurred.
+ *
+ * <p>For instance, a remote service may be unavailable.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
IO,
+ /**
+ * The operation was cancelled, not due to a timeout.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
CANCELLED,
+ /**
+ * The operation was cancelled due to a timeout.
+ *
+ * <p>May indicate a driver-side or database-side error.
+ */
TIMEOUT,
+ /**
+ * Authentication failed.
+ *
+ * <p>May indicate a database-side error only.
+ */
UNAUTHENTICATED,
+ /**
+ * The client is not authorized to perform the given operation.
+ *
+ * <p>May indicate a database-side error only.
+ */
UNAUTHORIZED,
;
}