Skip to content

Commit

Permalink
Also update ADBC C source
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed May 8, 2024
1 parent ec2e5aa commit fc75426
Show file tree
Hide file tree
Showing 45 changed files with 5,040 additions and 4,121 deletions.
45 changes: 45 additions & 0 deletions 3rd_party/apache-arrow-adbc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,3 +511,48 @@
- **c/driver_manager**: differentiate errors from driver manager (#1662)
- **c/driver/sqlite**: port to driver base (#1603)
- **go/adbc/driver**: driverbase implementation for connection (#1590)

## ADBC Libraries 12 (2024-05-08)

### Feat

- **go/adbc/driver/snowflake**: support parameter binding (#1808)
- **csharp**: imported objects should have call "release" when no longer in use (#1802)
- **rust**: add the driver exporter (#1756)
- **csharp**: enable nullable checks and resolve all warnings (#1792)
- **go/adbc/driver/flightsql**: support stateless prepared statements (#1796)
- **csharp**: Implement support for transactions, isolation level and read-only flag (#1784)
- **csharp/test**: implement DuckDb test fixture (#1781)
- **csharp**: Implement remaining functions in 1.0 spec (#1773)
- **csharp/src/Apache.Arrow.Adbc**: Cleanup use of List<T> in APIs and implementation (#1761)
- **csharp**: Update to test with net8.0 (#1771)
- **csharp/src/Apache.Arrow.Adbc**: Remove AdbcConnection.GetInfo(List<int>) (#1760)
- **glib**: add GADBCArrowConnection (#1754)
- **rust**: add complete FFI bindings (#1742)
- **glib**: Add garrow_connection_get_statistic_names() (#1748)
- **glib**: Add garrow_connection_get_statistics() (#1744)
- **c/driver/postgresql**: add money type and test intervals (#1741)
- **rust**: add public abstract API and dummy driver implementation (#1725)
- **csharp/src/Drivers**: introduce drivers for Apache systems built on Thrift (#1710)
- **format**: add info codes for supported capabilities (#1649)

### Fix

- **csharp**: Change option translation to be case-sensitive (#1820)
- **csharp/src/Apache.Arrow.Adbc/C**: imported errors don't return a native error or SQL state (#1815)
- **csharp/src/Apache.Arrow.Adbc**: imported statements and databases don't allow options to be set (#1816)
- **csharp/src/Apache.Arrow.Adbc/C**: correctly handle null driver entries for imported drivers (#1812)
- **go/adbc/driver/snowflake**: handle empty result sets (#1805)
- **csharp**: an assortment of small fixes not worth individual pull requests (#1807)
- **go/adbc/driver/snowflake**: workaround snowflake metadata-only limitations (#1790)
- **csharp/src/Apache.Arrow.Adbc**: correct StandardSchemas.ColumnSchema data types (#1731)
- **csharp**: imported drivers have the potential for a lot of memory leaks (#1776)
- **go/adbc/driver/flightsql**: should use `ctx.Err().Error()` (#1769)
- **go/adbc/driver/snowflake**: handle quotes properly (#1738)
- **go/adbc/driver/snowflake**: comment format (#1768)
- **csharp/src/Apache.Arrow.Adbc**: Fix marshaling in three functions where it was broken (#1758)
- **csharp/src/Apache.Arrow.Adbc**: Add support to the C Exporter for converting exceptions into AdbcErrors (#1752)
- **format**: correct duplicated statistics names (#1736)
- **dev/release**: correct C# version bump regex (#1733)
- **r**: Ensure CXX_STD is set everywhere (#1706)
- **csharp**: Resolve memory leaks described by #1690 (#1695)
42 changes: 39 additions & 3 deletions 3rd_party/apache-arrow-adbc/adbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,24 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
///
/// \see AdbcConnectionGetInfo
#define ADBC_INFO_VENDOR_ARROW_VERSION 2
/// \brief Indicates whether SQL queries are supported (type: bool).
///
/// \see AdbcConnectionGetInfo
#define ADBC_INFO_VENDOR_SQL 3
/// \brief Indicates whether Substrait queries are supported (type: bool).
///
/// \see AdbcConnectionGetInfo
#define ADBC_INFO_VENDOR_SUBSTRAIT 4
/// \brief The minimum supported Substrait version, or null if
/// Substrait is not supported (type: utf8).
///
/// \see AdbcConnectionGetInfo
#define ADBC_INFO_VENDOR_SUBSTRAIT_MIN_VERSION 5
/// \brief The maximum supported Substrait version, or null if
/// Substrait is not supported (type: utf8).
///
/// \see AdbcConnectionGetInfo
#define ADBC_INFO_VENDOR_SUBSTRAIT_MAX_VERSION 6

/// \brief The driver name (type: utf8).
///
Expand Down Expand Up @@ -528,15 +546,15 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
/// (when approximate).
///
/// For example, this is the maximum length of a string for a string column.
#define ADBC_STATISTIC_MAX_BYTE_WIDTH_NAME "adbc.statistic.byte_width"
#define ADBC_STATISTIC_MAX_BYTE_WIDTH_NAME "adbc.statistic.max_byte_width"
/// \brief The dictionary-encoded name of the max value statistic.
#define ADBC_STATISTIC_MAX_VALUE_KEY 3
/// \brief The max value statistic. Value type is column-dependent.
#define ADBC_STATISTIC_MAX_VALUE_NAME "adbc.statistic.byte_width"
#define ADBC_STATISTIC_MAX_VALUE_NAME "adbc.statistic.max_value"
/// \brief The dictionary-encoded name of the min value statistic.
#define ADBC_STATISTIC_MIN_VALUE_KEY 4
/// \brief The min value statistic. Value type is column-dependent.
#define ADBC_STATISTIC_MIN_VALUE_NAME "adbc.statistic.byte_width"
#define ADBC_STATISTIC_MIN_VALUE_NAME "adbc.statistic.min_value"
/// \brief The dictionary-encoded name of the null count statistic.
#define ADBC_STATISTIC_NULL_COUNT_KEY 5
/// \brief The null count statistic. The number of values that are null in
Expand Down Expand Up @@ -754,6 +772,24 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
/// schema of the data to append (ADBC_STATUS_ALREADY_EXISTS).
/// \since ADBC API revision 1.1.0
#define ADBC_INGEST_OPTION_MODE_CREATE_APPEND "adbc.ingest.mode.create_append"
/// \brief The catalog of the table for bulk insert.
///
/// The type is char*.
#define ADBC_INGEST_OPTION_TARGET_CATALOG "adbc.ingest.target_catalog"
/// \brief The schema of the table for bulk insert.
///
/// The type is char*.
#define ADBC_INGEST_OPTION_TARGET_DB_SCHEMA "adbc.ingest.target_db_schema"
/// \brief Use a temporary table for ingestion.
///
/// The value should be ADBC_OPTION_VALUE_ENABLED or
/// ADBC_OPTION_VALUE_DISABLED (the default).
///
/// This is not supported with ADBC_INGEST_OPTION_TARGET_CATALOG and
/// ADBC_INGEST_OPTION_TARGET_DB_SCHEMA.
///
/// The type is char*.
#define ADBC_INGEST_OPTION_TEMPORARY "adbc.ingest.temporary"

/// @}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ if(MSVC)
# Allow incomplete switch (since MSVC warns even if there's a default case)
add_compile_options(/wd4061)
add_compile_options(/wd4100)
add_compile_options(/wd4127)
# Nanoarrow emits a lot of conversion warnings
add_compile_options(/wd4365)
add_compile_options(/wd4242)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# ------------------------------------------------------------
# Version definitions

set(ADBC_VERSION "0.11.0")
set(ADBC_VERSION "1.0.0")
string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" ADBC_BASE_VERSION "${ADBC_VERSION}")
string(REPLACE "." ";" _adbc_version_list "${ADBC_BASE_VERSION}")
list(GET _adbc_version_list 0 ADBC_VERSION_MAJOR)
Expand Down
21 changes: 0 additions & 21 deletions 3rd_party/apache-arrow-adbc/c/driver/common/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,6 @@
extern "C" {
#endif

/// \brief The catalog of the table for bulk insert.
///
/// The type is char*.
#define ADBC_INGEST_OPTION_TARGET_CATALOG "adbc.ingest.target_catalog"

/// \brief The schema of the table for bulk insert.
///
/// The type is char*.
#define ADBC_INGEST_OPTION_TARGET_DB_SCHEMA "adbc.ingest.target_db_schema"

/// \brief Use a temporary table for ingestion.
///
/// The value should be ADBC_OPTION_VALUE_ENABLED or
/// ADBC_OPTION_VALUE_DISABLED (the default).
///
/// This is not supported with ADBC_INGEST_OPTION_TARGET_CATALOG and
/// ADBC_INGEST_OPTION_TARGET_DB_SCHEMA.
///
/// The type is char*.
#define ADBC_INGEST_OPTION_TEMPORARY "adbc.ingest.temporary"

#ifdef __cplusplus
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class DremioFlightSqlStatementTest : public ::testing::Test,
void TestSqlIngestColumnEscaping() {
GTEST_SKIP() << "Column escaping not implemented";
}
void TestSqlQueryEmpty() { GTEST_SKIP() << "Dremio doesn't support 'acceptPut'"; }
void TestSqlQueryRowsAffectedDelete() {
GTEST_SKIP() << "Cannot query rows affected in delete (not implemented)";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

include(FetchContent)

add_library(adbc_driver_framework STATIC base.cc catalog.cc objects.cc)
add_library(adbc_driver_framework STATIC base_driver.cc catalog.cc objects.cc)
adbc_configure_target(adbc_driver_framework)
set_target_properties(adbc_driver_framework PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(adbc_driver_framework
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "driver/common/options.h"
#include "driver/common/utils.h"
#include "driver/framework/base.h"
#include "driver/framework/base_driver.h"
#include "driver/framework/catalog.h"
#include "driver/framework/objects.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <adbc.h>

#include "driver/framework/base.h"
#include "driver/framework/base_driver.h"
#include "driver/framework/status.h"

namespace adbc::driver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#include "driver/framework/base.h"
#include "driver/framework/base_driver.h"

namespace adbc::driver {
Result<bool> Option::AsBool() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ class Driver {
/// \brief Formatter for Option values.
template <>
struct fmt::formatter<adbc::driver::Option> : fmt::nested_formatter<std::string_view> {
auto format(const adbc::driver::Option& option, fmt::format_context& ctx) {
auto format(const adbc::driver::Option& option, fmt::format_context& ctx) const {
return write_padded(ctx, [=](auto out) {
return std::visit(
[&](auto&& value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <vector>

#include "driver/common/options.h"
#include "driver/framework/base.h"
#include "driver/framework/base_driver.h"
#include "driver/framework/status.h"

namespace adbc::driver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ static inline ArrowErrorCode MakeCopyFieldReader(
case NANOARROW_TYPE_INT64:
switch (pg_type.type_id()) {
case PostgresTypeId::kInt8:
case PostgresTypeId::kCash:
*out = std::make_unique<PostgresCopyNetworkEndianFieldReader<int64_t>>();
return NANOARROW_OK;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ class PostgresType {
case PostgresTypeId::kFloat8:
NANOARROW_RETURN_NOT_OK(ArrowSchemaSetType(schema, NANOARROW_TYPE_DOUBLE));
break;
case PostgresTypeId::kCash:
// PostgreSQL appears to send an int64, without decimal point information
NANOARROW_RETURN_NOT_OK(ArrowSchemaSetType(schema, NANOARROW_TYPE_INT64));
break;

// ---- Numeric/Decimal-------------------
case PostgresTypeId::kNumeric:
Expand Down
Loading

0 comments on commit fc75426

Please sign in to comment.