Skip to content

Commit

Permalink
handle updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroshade committed Oct 17, 2024
1 parent 73a7fbf commit e26883f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions c/driver/snowflake/snowflake_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }

Expand Down
6 changes: 6 additions & 0 deletions c/validation/adbc_validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""; }

Expand Down
12 changes: 12 additions & 0 deletions c/validation/adbc_validation_statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ void StatementTest::TestSqlIngestInt64() {
}

void StatementTest::TestSqlIngestFloat16() {
if (!quirks()->supports_ingest_float16()) {
GTEST_SKIP();
}

ASSERT_NO_FATAL_FAILURE(TestSqlIngestNumericType<float>(NANOARROW_TYPE_HALF_FLOAT));
}

Expand All @@ -268,6 +272,10 @@ void StatementTest::TestSqlIngestLargeString() {
}

void StatementTest::TestSqlIngestStringView() {
if (!quirks()->supports_ingest_view_types()) {
GTEST_SKIP();
}

ASSERT_NO_FATAL_FAILURE(TestSqlIngestType<std::string>(
NANOARROW_TYPE_STRING_VIEW, {std::nullopt, "", "", "longer than 12 bytes", ""},
false));
Expand Down Expand Up @@ -302,6 +310,10 @@ void StatementTest::TestSqlIngestFixedSizeBinary() {
}

void StatementTest::TestSqlIngestBinaryView() {
if (!quirks()->supports_ingest_view_types()) {
GTEST_SKIP();
}

ASSERT_NO_FATAL_FAILURE(TestSqlIngestType<std::vector<std::byte>>(
NANOARROW_TYPE_LARGE_BINARY,
{std::nullopt, std::vector<std::byte>{},
Expand Down
4 changes: 2 additions & 2 deletions go/adbc/driver/snowflake/statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e26883f

Please sign in to comment.