From b9262d58ac5986a4e123f654c38d03f933aa11d8 Mon Sep 17 00:00:00 2001 From: David Li
This can be used to interrupt execution of a method like {@link #getObjects(GetObjectsDepth, + * String, String, String, String[], String)}}. + * + *
This method must be thread-safe (other method are not necessarily thread-safe). + * + * @since ADBC API revision 1.1.0 + */ + default void cancel() throws AdbcException { + throw AdbcException.notImplemented("Statement does not support cancel"); + } + /** Commit the pending transaction. */ default void commit() throws AdbcException { throw AdbcException.notImplemented("Connection does not support transactions"); @@ -102,7 +116,7 @@ default ArrowReader getInfo() throws AdbcException { *
DB_SCHEMA_SCHEMA is a Struct with fields: * *
Field Name | Field Type |
---|
TABLE_SCHEMA is a Struct with fields: * *
Field Name | Field Type |
---|
COLUMN_SCHEMA is a Struct with fields: * *
Field Name | Field Type | Comments |
---|
Notes: * *
CONSTRAINT_SCHEMA is a Struct with fields: * *
Field Name | Field Type | Comments |
---|
Field Name | Field Type |
---|
Field Name | Field Type |
---|---|
catalog_name | utf8 |
catalog_db_schemas | list[DB_SCHEMA_SCHEMA] |
DB_SCHEMA_SCHEMA is a Struct with fields: + * + *
Field Name | Field Type |
---|---|
db_schema_name | utf8 |
db_schema_tables | list[TABLE_SCHEMA] |
STATISTICS_SCHEMA is a Struct with fields: + * + *
Field Name | Field Type | Comments |
---|---|---|
table_name | utf8 not null | |
column_name | utf8 | (1) |
statistic_key | int16 | (2) |
statistic_value | VALUE_SCHEMA not null | |
statistic_is_approximate | bool not null | (3) |
VALUE_SCHEMA is a dense union with members: + * + *
Field Name | Field Type |
---|---|
int64 | int64 |
uint64 | uint64 |
float64 | float64 |
decimal256 | decimal256 |
binary | binary |
This allows drivers to return custom, structured error information (for example, JSON or
+ * Protocol Buffers) that can be optionally parsed by clients, beyond the standard AdbcError
+ * fields, without having to encode it in the error message. The encoding of the data is
+ * driver-defined.
+ */
+ public Collection This can be used to interrupt execution of a method like {@link #executeQuery()}.
+ *
* This method must be thread-safe (other method are not necessarily thread-safe).
*
* @since ADBC API revision 1.1.0
diff --git a/java/core/src/main/java/org/apache/arrow/adbc/core/StandardStatistics.java b/java/core/src/main/java/org/apache/arrow/adbc/core/StandardStatistics.java
new file mode 100644
index 0000000000..5412c645c3
--- /dev/null
+++ b/java/core/src/main/java/org/apache/arrow/adbc/core/StandardStatistics.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.arrow.adbc.core;
+
+import java.util.Objects;
+
+/**
+ * Definitions of standard statistic names/keys.
+ *
+ * Statistic names are returned from {@link AdbcConnection#getStatistics(String, String, String,
+ * boolean)} in a dictionary-encoded form. This class provides the names and dictionary-encoded form
+ * of statistics defined by ADBC.
+ */
+public enum StandardStatistics {
+ /**
+ * The average byte width statistic. The average size in bytes of a row in the column. Value type
+ * is float64.
+ *
+ * For example, this is roughly the average length of a string for a string column.
+ */
+ AVERAGE_BYTE_WIDTH("adbc.statistic.byte_width", 0),
+ /**
+ * The distinct value count (NDV) statistic. The number of distinct values in the column. Value
+ * type is int64 (when not approximate) or float64 (when approximate).
+ */
+ DISTINCT_COUNT("adbc.statistic.distinct_count", 1),
+ /**
+ * The max byte width statistic. The maximum size in bytes of a row in the column. Value type is
+ * int64 (when not approximate) or float64 (when approximate).
+ *
+ * For example, this is the maximum length of a string for a string column.
+ */
+ MAX_BYTE_WIDTH("adbc.statistic.byte_width", 2),
+ /** The max value statistic. Value type is column-dependent. */
+ MAX_VALUE_NAME("adbc.statistic.byte_width", 3),
+ /** The min value statistic. Value type is column-dependent. */
+ MIN_VALUE_NAME("adbc.statistic.byte_width", 4),
+ /**
+ * The null count statistic. The number of values that are null in the column. Value type is int64
+ * (when not approximate) or float64 (when approximate).
+ */
+ NULL_COUNT_NAME("adbc.statistic.null_count", 5),
+ /**
+ * The row count statistic. The number of rows in the column or table. Value type is int64 (when
+ * not approximate) or float64 (when approximate).
+ */
+ ROW_COUNT_NAME("adbc.statistic.row_count", 6),
+ ;
+
+ private final String name;
+ private final int key;
+
+ StandardStatistics(String name, int key) {
+ this.name = Objects.requireNonNull(name);
+ this.key = key;
+ }
+
+ /** Get the statistic name. */
+ public String getName() {
+ return name;
+ }
+
+ /** Get the dictionary-encoded name. */
+ public int getKey() {
+ return key;
+ }
+}