From e26883f974ed84965037baf3b5d3addde053a317 Mon Sep 17 00:00:00 2001 From: Matt Topol Date: Thu, 17 Oct 2024 14:00:13 -0400 Subject: [PATCH] handle updated tests --- c/driver/snowflake/snowflake_test.cc | 3 +++ c/validation/adbc_validation.h | 6 ++++++ c/validation/adbc_validation_statement.cc | 12 ++++++++++++ go/adbc/driver/snowflake/statement.go | 4 ++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/c/driver/snowflake/snowflake_test.cc b/c/driver/snowflake/snowflake_test.cc index 63767e1426..262286192a 100644 --- a/c/driver/snowflake/snowflake_test.cc +++ b/c/driver/snowflake/snowflake_test.cc @@ -155,6 +155,9 @@ class SnowflakeQuirks : public adbc_validation::DriverQuirks { bool supports_dynamic_parameter_binding() const override { return true; } bool supports_error_on_incompatible_schema() const override { return false; } bool ddl_implicit_commit_txn() const override { return true; } + bool supports_ingest_view_types() const override { return false; } + bool supports_ingest_float16() const override { return false; } + std::string db_schema() const override { return schema_; } std::string catalog() const override { return "ADBC_TESTING"; } diff --git a/c/validation/adbc_validation.h b/c/validation/adbc_validation.h index fa3c1cdccb..f8ef350cc2 100644 --- a/c/validation/adbc_validation.h +++ b/c/validation/adbc_validation.h @@ -238,6 +238,12 @@ class DriverQuirks { /// column matching. virtual bool supports_error_on_incompatible_schema() const { return true; } + /// \brief Whether ingestion supports StringView/BinaryView types + virtual bool supports_ingest_view_types() const { return true; } + + /// \brief Whether ingestion supports Float16 + virtual bool supports_ingest_float16() const { return true; } + /// \brief Default catalog to use for tests virtual std::string catalog() const { return ""; } diff --git a/c/validation/adbc_validation_statement.cc b/c/validation/adbc_validation_statement.cc index 19166d8524..94cee1fba3 100644 --- a/c/validation/adbc_validation_statement.cc +++ b/c/validation/adbc_validation_statement.cc @@ -246,6 +246,10 @@ void StatementTest::TestSqlIngestInt64() { } void StatementTest::TestSqlIngestFloat16() { + if (!quirks()->supports_ingest_float16()) { + GTEST_SKIP(); + } + ASSERT_NO_FATAL_FAILURE(TestSqlIngestNumericType(NANOARROW_TYPE_HALF_FLOAT)); } @@ -268,6 +272,10 @@ void StatementTest::TestSqlIngestLargeString() { } void StatementTest::TestSqlIngestStringView() { + if (!quirks()->supports_ingest_view_types()) { + GTEST_SKIP(); + } + ASSERT_NO_FATAL_FAILURE(TestSqlIngestType( NANOARROW_TYPE_STRING_VIEW, {std::nullopt, "", "", "longer than 12 bytes", "δΎ‹"}, false)); @@ -302,6 +310,10 @@ void StatementTest::TestSqlIngestFixedSizeBinary() { } void StatementTest::TestSqlIngestBinaryView() { + if (!quirks()->supports_ingest_view_types()) { + GTEST_SKIP(); + } + ASSERT_NO_FATAL_FAILURE(TestSqlIngestType>( NANOARROW_TYPE_LARGE_BINARY, {std::nullopt, std::vector{}, diff --git a/go/adbc/driver/snowflake/statement.go b/go/adbc/driver/snowflake/statement.go index 1fd1f658fe..574e390453 100644 --- a/go/adbc/driver/snowflake/statement.go +++ b/go/adbc/driver/snowflake/statement.go @@ -321,9 +321,9 @@ func toSnowflakeType(dt arrow.DataType) string { case arrow.DECIMAL, arrow.DECIMAL256: dec := dt.(arrow.DecimalType) return fmt.Sprintf("NUMERIC(%d,%d)", dec.GetPrecision(), dec.GetScale()) - case arrow.STRING, arrow.LARGE_STRING: + case arrow.STRING, arrow.LARGE_STRING, arrow.STRING_VIEW: return "text" - case arrow.BINARY, arrow.LARGE_BINARY: + case arrow.BINARY, arrow.LARGE_BINARY, arrow.BINARY_VIEW: return "binary" case arrow.FIXED_SIZE_BINARY: fsb := dt.(*arrow.FixedSizeBinaryType)