apache/arrow-adbc

csharp: integration tests (ClientTests) fail for Databricks data source due to float type incompatibility

Closed this issue · 0 comments

What happened?

The ClientTests.VerifyTypesAndValues test fails when running with Databricks Spark data source due to float data being returned as Single/float instead of Double/double as is the case with Apache Spark data source. Test needs to handle the case of Databricks Spark.

Stack Trace

  Message: 
    number_float is Single and not Double in the column schema for query [SELECT CAST(1 as BIGINT) as id, CAST(2 as INTEGER) as int, CAST(1.23 as FLOAT) as number_float, CAST(4.56 as DOUBLE) as number_double, 4.56BD as decimal, 9.9999999999999999999999999999999999999BD as big_decimal, CAST(True as BOOLEAN) as is_active, 'John Doe' as name, X'616263313233' as data, DATE '2023-09-08' as date, TIMESTAMP '2023-09-08 12:34:56+00:00' as timestamp, INTERVAL 178956969 YEAR 11 MONTH as interval, ARRAY(1, 2, 3) as numbers, STRUCT('John Doe' as name, 30 as age) as person,MAP('name', CAST('Jane Doe' AS STRING), 'age', CAST(29 AS INT)) as map]

  Stack Trace: 
    ClientTests.AssertTypeAndValue(ColumnNetTypeArrowTypeValue ctv, Object value, DbDataReader reader, ReadOnlyCollection`1 column_schema, DataTable dataTable, String query) line 213
    ClientTests.VerifyTypesAndValues(AdbcConnection adbcConnection, SampleDataBuilder sampleDataBuilder) line 173
    ClientTests.VerifyTypesAndValues() line 132
    RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

How can we reproduce the bug?

In VS run the ClientTests.VerifyTypesAndValues with a Databricks Spark data source.

Environment/Setup

No response