This is an automated email from the ASF dual-hosted git repository.
curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 864da786 feat(csharp/test): Add support for data without need for
tables (#1287)
864da786 is described below
commit 864da786febf2768c6de2ffdde74f424936badf2
Author: davidhcoe <[email protected]>
AuthorDate: Mon Nov 13 16:19:04 2023 -0500
feat(csharp/test): Add support for data without need for tables (#1287)
- Add support for dynamic data that can execute against data sources
without physical tables
- Add data for tests of issues previously found in BigQuery and
Snowflake
- Refactor common functionality into the Apache.Arrow.Adbc.Tests project
from the respective drivers
Addresses
https://github.com/apache/arrow-adbc/pull/1282#issuecomment-1806034942
---------
Co-authored-by: David Coe <[email protected]>
---
csharp/test/Apache.Arrow.Adbc.Tests/ClientTests.cs | 168 ++++++++++++--
.../Apache.Arrow.Adbc.Tests/SampleDataBuilder.cs | 55 +++++
csharp/test/Drivers/BigQuery/BigQueryData.cs | 139 +++++++++++
csharp/test/Drivers/BigQuery/ClientTests.cs | 76 +-----
csharp/test/Drivers/BigQuery/SampleData.cs | 61 -----
csharp/test/Drivers/FlightSql/ClientTests.cs | 31 +--
csharp/test/Drivers/Snowflake/ClientTests.cs | 127 ++--------
csharp/test/Drivers/Snowflake/SampleData.cs | 75 ------
csharp/test/Drivers/Snowflake/SnowflakeData.cs | 255 +++++++++++++++++++++
9 files changed, 632 insertions(+), 355 deletions(-)
diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/ClientTests.cs
b/csharp/test/Apache.Arrow.Adbc.Tests/ClientTests.cs
index 1ecddb4b..b3784fc0 100644
--- a/csharp/test/Apache.Arrow.Adbc.Tests/ClientTests.cs
+++ b/csharp/test/Apache.Arrow.Adbc.Tests/ClientTests.cs
@@ -17,10 +17,12 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Data.Common;
using System.Linq;
+using Apache.Arrow.Adbc.Client;
using Apache.Arrow.Types;
using Xunit;
@@ -31,6 +33,139 @@ namespace Apache.Arrow.Adbc.Tests
/// </summary>
public class ClientTests
{
+ /// <summary>
+ /// Validates if the client execute updates.
+ /// </summary>
+ /// <param name="adbcConnection">The <see
cref="Adbc.Client.AdbcConnection"/> to use.</param>
+ /// <param name="testConfiguration">The <see
cref="TestConfiguration"/> to use</param>
+ /// <param name="queries">The queries to run</param>
+ /// <param name="expectedResults">The expected results (one per
query)</param>
+ public static void CanClientExecuteUpdate(Adbc.Client.AdbcConnection
adbcConnection,
+ TestConfiguration testConfiguration,
+ string[] queries,
+ List<int> expectedResults)
+ {
+ if (adbcConnection == null) throw new
ArgumentNullException(nameof(adbcConnection));
+ if (testConfiguration == null) throw new
ArgumentNullException(nameof(testConfiguration));
+ if (queries == null) throw new
ArgumentNullException(nameof(queries));
+ if (expectedResults == null) throw new
ArgumentNullException(nameof(expectedResults));
+ if (queries.Length != expectedResults.Count) throw new
ArgumentException($"{nameof(queries)} and {nameof(expectedResults)} must have
the same number of values");
+
+ adbcConnection.Open();
+
+ for (int i = 0; i < queries.Length; i++)
+ {
+ string query = queries[i];
+
+ using AdbcCommand adbcCommand = adbcConnection.CreateCommand();
+
+ adbcCommand.CommandText = query;
+
+ int rows = adbcCommand.ExecuteNonQuery();
+
+ Assert.Equal(expectedResults[i], rows);
+ }
+ }
+
+ /// <summary>
+ /// Validates if the client can get the schema.
+ /// </summary>
+ /// <param name="adbcConnection">The <see
cref="Adbc.Client.AdbcConnection"/> to use.</param>
+ /// <param name="testConfiguration">The <see
cref="TestConfiguration"/> to use</param>
+ public static void CanClientGetSchema(Adbc.Client.AdbcConnection
adbcConnection, TestConfiguration testConfiguration)
+ {
+ if (adbcConnection == null) throw new
ArgumentNullException(nameof(adbcConnection));
+ if (testConfiguration == null) throw new
ArgumentNullException(nameof(testConfiguration));
+
+ adbcConnection.Open();
+
+ using AdbcCommand adbcCommand = new
AdbcCommand(testConfiguration.Query, adbcConnection);
+ using AdbcDataReader reader =
adbcCommand.ExecuteReader(CommandBehavior.SchemaOnly);
+
+ DataTable table = reader.GetSchemaTable();
+
+ // there is one row per field
+ Assert.Equal(testConfiguration.Metadata.ExpectedColumnCount,
table.Rows.Count);
+ }
+
+ /// <summary>
+ /// Validates if the client can connect to a live server and
+ /// parse the results.
+ /// </summary>
+ /// <param name="adbcConnection">The <see
cref="Adbc.Client.AdbcConnection"/> to use.</param>
+ /// <param name="testConfiguration">The <see
cref="TestConfiguration"/> to use</param>
+ public static void CanClientExecuteQuery(Adbc.Client.AdbcConnection
adbcConnection, TestConfiguration testConfiguration)
+ {
+ if (adbcConnection == null) throw new
ArgumentNullException(nameof(adbcConnection));
+ if (testConfiguration == null) throw new
ArgumentNullException(nameof(testConfiguration));
+
+ long count = 0;
+
+ adbcConnection.Open();
+
+ using AdbcCommand adbcCommand = new
AdbcCommand(testConfiguration.Query, adbcConnection);
+ using AdbcDataReader reader = adbcCommand.ExecuteReader();
+
+ try
+ {
+ while (reader.Read())
+ {
+ count++;
+
+ for (int i = 0; i < reader.FieldCount; i++)
+ {
+ object value = reader.GetValue(i);
+
+ if (value == null)
+ value = "(null)";
+
+ // write out the values to ensure things like null are
correctly returned
+ Console.WriteLine($"{reader.GetName(i)}: {value}");
+ }
+ }
+ }
+ finally { reader.Close(); }
+
+ Assert.Equal(testConfiguration.ExpectedResultsCount, count);
+ }
+
+ /// <summary>
+ /// Validates if the client is retrieving and converting values
+ /// to the expected types.
+ /// </summary>
+ /// <param name="adbcConnection">The <see
cref="Adbc.Client.AdbcConnection"/> to use.</param>
+ /// <param name="sampleDataBuilder">The <see
cref="SampleDataBuilder"/> to use</param>
+ public static void VerifyTypesAndValues(Adbc.Client.AdbcConnection
adbcConnection, SampleDataBuilder sampleDataBuilder)
+ {
+ if(adbcConnection == null) throw new
ArgumentNullException(nameof(adbcConnection));
+ if(sampleDataBuilder == null) throw new
ArgumentNullException(nameof(sampleDataBuilder));
+
+ adbcConnection.Open();
+
+ foreach (SampleData sample in sampleDataBuilder.Samples)
+ {
+ using AdbcCommand dbCommand = adbcConnection.CreateCommand();
+ dbCommand.CommandText = sample.Query;
+
+ using AdbcDataReader reader =
dbCommand.ExecuteReader(CommandBehavior.Default);
+ if (reader.Read())
+ {
+ var column_schema = reader.GetColumnSchema();
+ DataTable dataTable = reader.GetSchemaTable();
+
+ Assert.True(reader.FieldCount ==
sample.ExpectedValues.Count, $"{sample.ExpectedValues.Count} fields were
expected but {reader.FieldCount} fields were returned for the query
[{sample.Query}]");
+
+ for (int i = 0; i < reader.FieldCount; i++)
+ {
+ object value = reader.GetValue(i);
+ ColumnNetTypeArrowTypeValue ctv =
sample.ExpectedValues[i];
+
+ AssertTypeAndValue(ctv, value, reader, column_schema,
dataTable, sample.Query);
+ }
+ }
+ }
+ }
+
/// <summary>
/// Validates a column contains the correct types and values.
/// </summary>
@@ -39,7 +174,13 @@ namespace Apache.Arrow.Adbc.Tests
/// <param name="reader">The current reader</param>
/// <param name="column_schema">The column schema from the
reader</param>
/// <param name="dataTable">The <see cref="DataTable"/></param>
- public static void AssertTypeAndValue(ColumnNetTypeArrowTypeValue ctv,
object value, DbDataReader reader, ReadOnlyCollection<DbColumn> column_schema,
DataTable dataTable)
+ static void AssertTypeAndValue(
+ ColumnNetTypeArrowTypeValue ctv,
+ object value,
+ DbDataReader reader,
+ ReadOnlyCollection<DbColumn> column_schema,
+ DataTable dataTable,
+ string query)
{
string name = ctv.Name;
Type clientArrowType = column_schema.Where(x => x.ColumnName ==
name).FirstOrDefault()?.DataType;
@@ -58,11 +199,11 @@ namespace Apache.Arrow.Adbc.Tests
Type netType = reader[name]?.GetType();
- Assert.True(clientArrowType == ctv.ExpectedNetType, $"{name} is
{clientArrowType.Name} and not {ctv.ExpectedNetType.Name} in the column
schema");
+ Assert.True(clientArrowType == ctv.ExpectedNetType, $"{name} is
{clientArrowType.Name} and not {ctv.ExpectedNetType.Name} in the column schema
for query [{query}]");
- Assert.True(dataTableType == ctv.ExpectedNetType, $"{name} is
{dataTableType.Name} and not {ctv.ExpectedNetType.Name} in the data table");
+ Assert.True(dataTableType == ctv.ExpectedNetType, $"{name} is
{dataTableType.Name} and not {ctv.ExpectedNetType.Name} in the data table for
query [{query}]");
- Assert.True(arrowType.GetType() == ctv.ExpectedArrowArrayType,
$"{name} is {arrowType.Name} and not {ctv.ExpectedArrowArrayType.Name} in the
provider type");
+ Assert.True(arrowType.GetType() == ctv.ExpectedArrowArrayType,
$"{name} is {arrowType.Name} and not {ctv.ExpectedArrowArrayType.Name} in the
provider type for query [{query}]");
if (netType != null)
{
@@ -74,16 +215,16 @@ namespace Apache.Arrow.Adbc.Tests
{
object internalValue =
value.GetType().GetMethod("GetValue").Invoke(value, new object[] { 0 });
- Assert.True(internalValue.GetType() ==
ctv.ExpectedNetType, $"{name} is {netType.Name} and not
{ctv.ExpectedNetType.Name} in the reader");
+ Assert.True(internalValue.GetType() ==
ctv.ExpectedNetType, $"{name} is {netType.Name} and not
{ctv.ExpectedNetType.Name} in the reader for query [{query}]");
}
else
{
- Console.WriteLine($"Could not validate the values
inside of {netType.Name} because it is empty");
+ Console.WriteLine($"Could not validate the values
inside of {netType.Name} because it is empty for query [{query}]");
}
}
else
{
- Assert.True(netType == ctv.ExpectedNetType, $"{name} is
{netType.Name} and not {ctv.ExpectedNetType.Name} in the reader");
+ Assert.True(netType == ctv.ExpectedNetType, $"{name} is
{netType.Name} and not {ctv.ExpectedNetType.Name} in the reader for query
[{query}]");
}
}
@@ -91,18 +232,17 @@ namespace Apache.Arrow.Adbc.Tests
{
if (!value.GetType().BaseType.Name.Contains("PrimitiveArray"))
{
- Assert.True(ctv.ExpectedNetType == value.GetType(),
$"Expected type does not match actual type for {ctv.Name}");
+ Assert.True(ctv.ExpectedNetType == value.GetType(),
$"Expected type does not match actual type for {ctv.Name} for query [{query}]");
- if (value.GetType() == typeof(byte[]))
+ if (value is byte[] actualBytes)
{
- byte[] actualBytes = (byte[])value;
byte[] expectedBytes = (byte[])ctv.ExpectedValue;
- Assert.True(actualBytes.SequenceEqual(expectedBytes),
$"byte[] values do not match expected values for {ctv.Name}");
+ Assert.True(actualBytes.SequenceEqual(expectedBytes),
$"byte[] values do not match expected values for {ctv.Name} for query
[{query}]");
}
else
{
- Assert.True(ctv.ExpectedValue.Equals(value),
$"Expected value does not match actual value for {ctv.Name}");
+ Assert.True(ctv.ExpectedValue.Equals(value),
$"Expected value [{ctv.ExpectedValue}] does not match actual value [{value}]
for {ctv.Name} for query [{query}]");
}
}
else
@@ -124,7 +264,7 @@ namespace Apache.Arrow.Adbc.Tests
if (i == j)
{
- Assert.True(expected.Equals(actual),
$"Expected value does not match actual value for {ctv.Name} at {i}");
+ Assert.True(expected.Equals(actual),
$"Expected value does not match actual value for {ctv.Name} at {i} for query
[{query}]");
}
}
}
@@ -132,7 +272,7 @@ namespace Apache.Arrow.Adbc.Tests
}
else
{
- Console.WriteLine($"The value for {ctv.Name} is null and
cannot be verified");
+ Assert.True(ctv.ExpectedValue == null, $"The value for
{ctv.Name} is null and but it's expected value is not null for query
[{query}]");
}
}
}
diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/SampleDataBuilder.cs
b/csharp/test/Apache.Arrow.Adbc.Tests/SampleDataBuilder.cs
new file mode 100644
index 00000000..fc03ff9b
--- /dev/null
+++ b/csharp/test/Apache.Arrow.Adbc.Tests/SampleDataBuilder.cs
@@ -0,0 +1,55 @@
+/*
+* 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.
+*/
+
+using System.Collections.Generic;
+
+namespace Apache.Arrow.Adbc.Tests
+{
+ /// <summary>
+ /// Used to build and verify sample data against a data source without
having to create a table.
+ /// </summary>
+ public class SampleDataBuilder
+ {
+ public SampleDataBuilder()
+ {
+ this.Samples = new List<SampleData>();
+ }
+
+ public List<SampleData> Samples { get; set; }
+ }
+
+ /// <summary>
+ /// Sample data for different data sources.
+ /// </summary>
+ public class SampleData
+ {
+ public SampleData()
+ {
+ this.ExpectedValues = new List<ColumnNetTypeArrowTypeValue>();
+ }
+
+ /// <summary>
+ /// The query to run.
+ /// </summary>
+ public string Query { get; set; }
+
+ /// <summary>
+ /// The expected values.
+ /// </summary>
+ public List<ColumnNetTypeArrowTypeValue> ExpectedValues { get; set; }
+ }
+}
diff --git a/csharp/test/Drivers/BigQuery/BigQueryData.cs
b/csharp/test/Drivers/BigQuery/BigQueryData.cs
new file mode 100644
index 00000000..2ab54d8b
--- /dev/null
+++ b/csharp/test/Drivers/BigQuery/BigQueryData.cs
@@ -0,0 +1,139 @@
+/*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Data.SqlTypes;
+using System.Text;
+using Apache.Arrow.Types;
+
+namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
+{
+ /// <summary>
+ /// Gets the sample data
+ /// </summary>
+ internal class BigQueryData
+ {
+ /// <summary>
+ /// Represents the different types of data for BigQuery.
+ /// </summary>
+ public static SampleDataBuilder GetSampleData()
+ {
+ Int64Array.Builder numbersBuilder = new Int64Array.Builder();
+ numbersBuilder.AppendRange(new List<long>() { 1, 2, 3 });
+ Int64Array numbersArray = numbersBuilder.Build();
+
+ SampleDataBuilder sampleDataBuilder = new SampleDataBuilder();
+
+ // standard values
+ sampleDataBuilder.Samples.Add(
+ new SampleData() {
+ Query = "SELECT " +
+ "CAST(1 as INT64) as id, " +
+ "CAST(1.23 as FLOAT64) as number, " +
+ "PARSE_NUMERIC(\"4.56\") as decimal, " +
+
"PARSE_BIGNUMERIC(\"7.89000000000000000000000000000000000000\") as big_decimal,
" +
+ "CAST(True as BOOL) as is_active, " +
+ "'John Doe' as name, " +
+ "FROM_BASE64('YWJjMTIz') as data, " +
+ "CAST('2023-09-08' as DATE) as date, " +
+ "CAST('12:34:56' as TIME) as time, " +
+ "CAST('2023-09-08 12:34:56' as DATETIME) as
datetime, " +
+ "CAST('2023-09-08 12:34:56+00:00' as TIMESTAMP) as
timestamp, " +
+ "ST_GEOGPOINT(1, 2) as point, " +
+ "ARRAY[1, 2, 3] as numbers, " +
+ "STRUCT('John Doe' as name, 30 as age) as person",
+ ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
+ {
+ new ColumnNetTypeArrowTypeValue("id", typeof(long),
typeof(Int64Type), 1L),
+ new ColumnNetTypeArrowTypeValue("number",
typeof(double), typeof(DoubleType), 1.23d),
+ new ColumnNetTypeArrowTypeValue("decimal",
typeof(SqlDecimal), typeof(Decimal128Type), SqlDecimal.Parse("4.56")),
+ new ColumnNetTypeArrowTypeValue("big_decimal",
typeof(string), typeof(StringType), "7.89000000000000000000000000000000000000"),
+ new ColumnNetTypeArrowTypeValue("is_active",
typeof(bool), typeof(BooleanType), true),
+ new ColumnNetTypeArrowTypeValue("name",
typeof(string), typeof(StringType), "John Doe"),
+ new ColumnNetTypeArrowTypeValue("data",
typeof(byte[]), typeof(BinaryType), UTF8Encoding.UTF8.GetBytes("abc123")),
+ new ColumnNetTypeArrowTypeValue("date",
typeof(DateTime), typeof(Date64Type), new DateTime(2023, 9, 8)),
+ new ColumnNetTypeArrowTypeValue("time", typeof(long),
typeof(Time64Type), 45296000000L), //'12:34:56'
+ new ColumnNetTypeArrowTypeValue("datetime",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023, 9, 8, 12, 34, 56), TimeSpan.Zero)),
+ new ColumnNetTypeArrowTypeValue("timestamp",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023, 9, 8, 12, 34, 56), TimeSpan.Zero)),
+ new ColumnNetTypeArrowTypeValue("point",
typeof(string), typeof(StringType), "POINT(1 2)"),
+ new ColumnNetTypeArrowTypeValue("numbers",
typeof(long), typeof(Int64Type), numbersArray),
+ new ColumnNetTypeArrowTypeValue("person",
typeof(string), typeof(StringType), "{\"name\":\"John Doe\",\"age\":30}")
+ }
+ });
+
+ // big numbers
+ sampleDataBuilder.Samples.Add(
+ new SampleData()
+ {
+ Query = "SELECT " +
+ "CAST(1.7976931348623157e+308 as FLOAT64) as
number, " +
+
"PARSE_NUMERIC(\"9.99999999999999999999999999999999E+28\") as decimal, " +
+
"PARSE_BIGNUMERIC(\"5.7896044618658097711785492504343953926634992332820282019728792003956564819968E+37\")
as big_decimal ",
+ ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
+ {
+ new ColumnNetTypeArrowTypeValue("number",
typeof(double), typeof(DoubleType), 1.7976931348623157e+308d),
+ new ColumnNetTypeArrowTypeValue("decimal",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999.999900000")),
+ new ColumnNetTypeArrowTypeValue("big_decimal",
typeof(string), typeof(StringType),
"57896044618658097711785492504343953926.63499233282028201972879200395656481997")
+ }
+ });
+
+ // nulls
+ Int64Array.Builder emptyNumbersBuilder = new Int64Array.Builder();
+ Int64Array emptyNumbersArray = emptyNumbersBuilder.Build();
+
+ sampleDataBuilder.Samples.Add(
+ new SampleData()
+ {
+ Query = "SELECT " +
+ "CAST(NULL as INT64) as id, " +
+ "CAST(NULL as FLOAT64) as number, " +
+ "PARSE_NUMERIC(NULL) as decimal, " +
+ "PARSE_BIGNUMERIC(NULL) as big_decimal, " +
+ "CAST(NULL as BOOL) as is_active, " +
+ "CAST(NULL as STRING) as name, " +
+ "FROM_BASE64(NULL) as data, " +
+ "CAST(NULL as DATE) as date, " +
+ "CAST(NULL as TIME) as time, " +
+ "CAST(NULL as DATETIME) as datetime, " +
+ "CAST(NULL as TIMESTAMP) as timestamp," +
+ "ST_GEOGPOINT(NULL, NULL) as point, " +
+ "CAST(NULL as ARRAY<INT64>) as numbers, " +
+ "STRUCT(CAST(NULL as STRING) as name, CAST(NULL as
INT64) as age) as person",
+ ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
+ {
+ new ColumnNetTypeArrowTypeValue("id", typeof(long),
typeof(Int64Type), null),
+ new ColumnNetTypeArrowTypeValue("number",
typeof(double), typeof(DoubleType), null),
+ new ColumnNetTypeArrowTypeValue("decimal",
typeof(SqlDecimal), typeof(Decimal128Type), null),
+ new ColumnNetTypeArrowTypeValue("big_decimal",
typeof(string), typeof(StringType), null),
+ new ColumnNetTypeArrowTypeValue("is_active",
typeof(bool), typeof(BooleanType), null),
+ new ColumnNetTypeArrowTypeValue("name",
typeof(string), typeof(StringType), null),
+ new ColumnNetTypeArrowTypeValue("data",
typeof(byte[]), typeof(BinaryType), null),
+ new ColumnNetTypeArrowTypeValue("date",
typeof(DateTime), typeof(Date64Type), null),
+ new ColumnNetTypeArrowTypeValue("time", typeof(long),
typeof(Time64Type), null),
+ new ColumnNetTypeArrowTypeValue("datetime",
typeof(DateTimeOffset), typeof(TimestampType), null),
+ new ColumnNetTypeArrowTypeValue("timestamp",
typeof(DateTimeOffset), typeof(TimestampType), null),
+ new ColumnNetTypeArrowTypeValue("point",
typeof(string), typeof(StringType), null),
+ new ColumnNetTypeArrowTypeValue("numbers",
typeof(long), typeof(Int64Type), emptyNumbersArray),
+ new ColumnNetTypeArrowTypeValue("person",
typeof(string), typeof(StringType), "{\"name\":null,\"age\":null}")
+ }
+ });
+
+ return sampleDataBuilder;
+ }
+ }
+}
diff --git a/csharp/test/Drivers/BigQuery/ClientTests.cs
b/csharp/test/Drivers/BigQuery/ClientTests.cs
index 36d2f19f..fd234068 100644
--- a/csharp/test/Drivers/BigQuery/ClientTests.cs
+++ b/csharp/test/Drivers/BigQuery/ClientTests.cs
@@ -15,10 +15,8 @@
* limitations under the License.
*/
-using System;
using System.Collections.Generic;
using System.Data;
-using System.Data.Common;
using Apache.Arrow.Adbc.Client;
using Apache.Arrow.Adbc.Drivers.BigQuery;
using Apache.Arrow.Adbc.Tests.Xunit;
@@ -57,16 +55,7 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
List<int> expectedResults = new List<int>() { -1, 1, 1, 1 };
- for (int i = 0; i < queries.Length; i++)
- {
- string query = queries[i];
- AdbcCommand adbcCommand = adbcConnection.CreateCommand();
- adbcCommand.CommandText = query;
-
- int rows = adbcCommand.ExecuteNonQuery();
-
- Assert.Equal(expectedResults[i], rows);
- }
+ Tests.ClientTests.CanClientExecuteUpdate(adbcConnection,
testConfiguration, queries, expectedResults);
}
}
@@ -80,16 +69,7 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
using (Adbc.Client.AdbcConnection adbcConnection =
GetAdbcConnection(testConfiguration))
{
- AdbcCommand adbcCommand = new
AdbcCommand(testConfiguration.Query, adbcConnection);
-
- adbcConnection.Open();
-
- AdbcDataReader reader =
adbcCommand.ExecuteReader(CommandBehavior.SchemaOnly);
-
- DataTable table = reader.GetSchemaTable();
-
- // there is one row per field
- Assert.Equal(testConfiguration.Metadata.ExpectedColumnCount,
table.Rows.Count);
+ Tests.ClientTests.CanClientGetSchema(adbcConnection,
testConfiguration);
}
}
@@ -102,37 +82,10 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
{
BigQueryTestConfiguration testConfiguration =
Utils.LoadTestConfiguration<BigQueryTestConfiguration>(BigQueryTestingUtils.BIGQUERY_TEST_CONFIG_VARIABLE);
- long count = 0;
-
using (Adbc.Client.AdbcConnection adbcConnection =
GetAdbcConnection(testConfiguration))
{
- AdbcCommand adbcCommand = new
AdbcCommand(testConfiguration.Query, adbcConnection);
-
- adbcConnection.Open();
-
- AdbcDataReader reader = adbcCommand.ExecuteReader();
-
- try
- {
- while (reader.Read())
- {
- count++;
-
- for(int i=0;i<reader.FieldCount;i++)
- {
- object value = reader.GetValue(i);
-
- if (value == null)
- value = "(null)";
-
- Console.WriteLine($"{reader.GetName(i)}: {value}");
- }
- }
- }
- finally { reader.Close(); }
+ Tests.ClientTests.CanClientExecuteQuery(adbcConnection,
testConfiguration);
}
-
- Assert.Equal(testConfiguration.ExpectedResultsCount, count);
}
/// <summary>
@@ -144,28 +97,11 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
{
BigQueryTestConfiguration testConfiguration =
Utils.LoadTestConfiguration<BigQueryTestConfiguration>(BigQueryTestingUtils.BIGQUERY_TEST_CONFIG_VARIABLE);
- Adbc.Client.AdbcConnection dbConnection =
GetAdbcConnection(testConfiguration);
-
- dbConnection.Open();
- DbCommand dbCommand = dbConnection.CreateCommand();
- dbCommand.CommandText = testConfiguration.Query;
-
- DbDataReader reader =
dbCommand.ExecuteReader(CommandBehavior.Default);
-
- if (reader.Read())
+ using(Adbc.Client.AdbcConnection dbConnection =
GetAdbcConnection(testConfiguration))
{
- var column_schema = reader.GetColumnSchema();
- DataTable dataTable = reader.GetSchemaTable();
-
- List<ColumnNetTypeArrowTypeValue> expectedValues =
SampleData.GetSampleData();
-
- for (int i = 0; i < reader.FieldCount; i++)
- {
- object value = reader.GetValue(i);
- ColumnNetTypeArrowTypeValue ctv = expectedValues[i];
+ SampleDataBuilder sampleDataBuilder =
BigQueryData.GetSampleData();
- Tests.ClientTests.AssertTypeAndValue(ctv, value, reader,
column_schema, dataTable);
- }
+ Tests.ClientTests.VerifyTypesAndValues(dbConnection,
sampleDataBuilder);
}
}
diff --git a/csharp/test/Drivers/BigQuery/SampleData.cs
b/csharp/test/Drivers/BigQuery/SampleData.cs
deleted file mode 100644
index d97e51dc..00000000
--- a/csharp/test/Drivers/BigQuery/SampleData.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-* 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.
-*/
-
-using System;
-using System.Collections.Generic;
-using System.Data.SqlTypes;
-using System.Text;
-using Apache.Arrow.Types;
-
-namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
-{
- /// <summary>
- /// Gets the sample data (based on the first record of the
resources/BigQueryData.sql file)
- /// </summary>
- internal class SampleData
- {
- /// <summary>
- /// Represents the first row of data from resources/BigQueryData.sql
- /// </summary>
- public static List<ColumnNetTypeArrowTypeValue> GetSampleData()
- {
- Int64Array.Builder numbersBuilder = new Int64Array.Builder();
- numbersBuilder.AppendRange(new List<long>() { 1, 2, 3 });
- Int64Array numbersArray = numbersBuilder.Build();
-
- List<ColumnNetTypeArrowTypeValue> expectedValues = new
List<ColumnNetTypeArrowTypeValue>()
- {
- new ColumnNetTypeArrowTypeValue("id", typeof(long),
typeof(Int64Type), 1L),
- new ColumnNetTypeArrowTypeValue("number", typeof(double),
typeof(DoubleType), 1.23d),
- new ColumnNetTypeArrowTypeValue("decimal", typeof(SqlDecimal),
typeof(Decimal128Type), SqlDecimal.Parse("4.56")),
- new ColumnNetTypeArrowTypeValue("big_decimal", typeof(string),
typeof(StringType), "7.89000000000000000000000000000000000000"),
- new ColumnNetTypeArrowTypeValue("is_active", typeof(bool),
typeof(BooleanType), true),
- new ColumnNetTypeArrowTypeValue("name", typeof(string),
typeof(StringType), "John Doe"),
- new ColumnNetTypeArrowTypeValue("data", typeof(byte[]),
typeof(BinaryType), UTF8Encoding.UTF8.GetBytes("abc123")),
- new ColumnNetTypeArrowTypeValue("date", typeof(DateTime),
typeof(Date64Type), new DateTime(2023, 9, 8)),
- new ColumnNetTypeArrowTypeValue("time", typeof(long),
typeof(Time64Type), 45296000000L), //'12:34:56'
- new ColumnNetTypeArrowTypeValue("datetime",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023, 9, 8, 12, 34, 56), TimeSpan.Zero)),
- new ColumnNetTypeArrowTypeValue("timestamp",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023, 9, 8, 12, 34, 56), TimeSpan.Zero)),
- new ColumnNetTypeArrowTypeValue("point", typeof(string),
typeof(StringType), "POINT(1 2)"),
- new ColumnNetTypeArrowTypeValue("numbers", typeof(long),
typeof(Int64Type), numbersArray),
- new ColumnNetTypeArrowTypeValue("person", typeof(string),
typeof(StringType), "{\"name\":\"John Doe\",\"age\":30}")
- };
-
- return expectedValues;
- }
- }
-}
diff --git a/csharp/test/Drivers/FlightSql/ClientTests.cs
b/csharp/test/Drivers/FlightSql/ClientTests.cs
index 04f3c6f5..4b413c9b 100644
--- a/csharp/test/Drivers/FlightSql/ClientTests.cs
+++ b/csharp/test/Drivers/FlightSql/ClientTests.cs
@@ -55,43 +55,14 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.FlightSql
{ FlightSqlParameters.ServerAddress,
flightSqlTestConfiguration.ServerAddress },
};
- long count = 0;
-
using (Adbc.Client.AdbcConnection adbcConnection = new
Adbc.Client.AdbcConnection(
new FlightSqlDriver(),
parameters,
options)
)
{
- string query = flightSqlTestConfiguration.Query;
-
- AdbcCommand adbcCommand = new AdbcCommand(query,
adbcConnection);
-
- adbcConnection.Open();
-
- AdbcDataReader reader = adbcCommand.ExecuteReader();
-
- try
- {
- while (reader.Read())
- {
- count++;
-
- for (int i = 0; i < reader.FieldCount; i++)
- {
- object value = reader.GetValue(i);
-
- if (value == null)
- value = "(null)";
-
- Console.WriteLine($"{reader.GetName(i)}: {value}");
- }
- }
- }
- finally { reader.Close(); }
+ Tests.ClientTests.CanClientExecuteQuery(adbcConnection,
flightSqlTestConfiguration);
}
-
- Assert.Equal(flightSqlTestConfiguration.ExpectedResultsCount,
count);
}
}
}
diff --git a/csharp/test/Drivers/Snowflake/ClientTests.cs
b/csharp/test/Drivers/Snowflake/ClientTests.cs
index 99c01b8e..187ef7b2 100644
--- a/csharp/test/Drivers/Snowflake/ClientTests.cs
+++ b/csharp/test/Drivers/Snowflake/ClientTests.cs
@@ -17,7 +17,6 @@
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.Data;
using System.Data.Common;
using System.Data.SqlTypes;
@@ -53,22 +52,11 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake
using (Adbc.Client.AdbcConnection adbcConnection =
GetSnowflakeAdbcConnection(testConfiguration))
{
- adbcConnection.Open();
-
string[] queries =
SnowflakeTestingUtils.GetQueries(testConfiguration);
List<int> expectedResults = new List<int>() { -1, 1, 1 };
- for (int i = 0; i < queries.Length; i++)
- {
- string query = queries[i];
- AdbcCommand adbcCommand = adbcConnection.CreateCommand();
- adbcCommand.CommandText = query;
-
- int rows = adbcCommand.ExecuteNonQuery();
-
- Assert.Equal(expectedResults[i], rows);
- }
+ Tests.ClientTests.CanClientExecuteUpdate(adbcConnection,
testConfiguration, queries, expectedResults);
}
}
@@ -118,16 +106,7 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake
using (Adbc.Client.AdbcConnection adbcConnection =
GetSnowflakeAdbcConnection(testConfiguration))
{
- AdbcCommand adbcCommand = new
AdbcCommand(testConfiguration.Query, adbcConnection);
-
- adbcConnection.Open();
-
- AdbcDataReader reader =
adbcCommand.ExecuteReader(CommandBehavior.SchemaOnly);
-
- DataTable table = reader.GetSchemaTable();
-
- // there is one row per field
- Assert.Equal(testConfiguration.Metadata.ExpectedColumnCount,
table.Rows.Count);
+ Tests.ClientTests.CanClientGetSchema(adbcConnection,
testConfiguration);
}
}
@@ -140,37 +119,27 @@ namespace
Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake
{
SnowflakeTestConfiguration testConfiguration =
Utils.LoadTestConfiguration<SnowflakeTestConfiguration>(SnowflakeTestingUtils.SNOWFLAKE_TEST_CONFIG_VARIABLE);
- long count = 0;
-
using (Adbc.Client.AdbcConnection adbcConnection =
GetSnowflakeAdbcConnection(testConfiguration))
{
- AdbcCommand adbcCommand = new
AdbcCommand(testConfiguration.Query, adbcConnection);
-
- adbcConnection.Open();
-
- AdbcDataReader reader = adbcCommand.ExecuteReader();
-
- try
- {
- while (reader.Read())
- {
- count++;
-
- for (int i = 0; i < reader.FieldCount; i++)
- {
- object value = reader.GetValue(i);
+ Tests.ClientTests.CanClientExecuteQuery(adbcConnection,
testConfiguration);
+ }
+ }
- if (value == null)
- value = "(null)";
+ // <summary>
+ /// Validates if the client can connect to a live server
+ /// and parse the results.
+ /// </summary>
+ [SkippableFact, Order(4)]
+ public void CanClientExecuteQueryWithNoResults()
+ {
+ SnowflakeTestConfiguration testConfiguration =
Utils.LoadTestConfiguration<SnowflakeTestConfiguration>(SnowflakeTestingUtils.SNOWFLAKE_TEST_CONFIG_VARIABLE);
+ testConfiguration.Query = "SELECT * WHERE 0=1";
+ testConfiguration.ExpectedResultsCount = 0;
- Console.WriteLine($"{reader.GetName(i)}: {value}");
- }
- }
- }
- finally { reader.Close(); }
+ using (Adbc.Client.AdbcConnection adbcConnection =
GetSnowflakeAdbcConnection(testConfiguration))
+ {
+ Tests.ClientTests.CanClientExecuteQuery(adbcConnection,
testConfiguration);
}
-
- Assert.Equal(testConfiguration.ExpectedResultsCount, count);
}
/// <summary>
@@ -182,37 +151,10 @@ namespace
Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake
{
SnowflakeTestConfiguration testConfiguration =
Utils.LoadTestConfiguration<SnowflakeTestConfiguration>(SnowflakeTestingUtils.SNOWFLAKE_TEST_CONFIG_VARIABLE);
- long count = 0;
-
using (Adbc.Client.AdbcConnection adbcConnection =
GetSnowflakeAdbcConnectionUsingConnectionString(testConfiguration))
{
- AdbcCommand adbcCommand = new
AdbcCommand(testConfiguration.Query, adbcConnection);
-
- adbcConnection.Open();
-
- AdbcDataReader reader = adbcCommand.ExecuteReader();
-
- try
- {
- while (reader.Read())
- {
- count++;
-
- for (int i = 0; i < reader.FieldCount; i++)
- {
- object value = reader.GetValue(i);
-
- if (value == null)
- value = "(null)";
-
- Console.WriteLine($"{reader.GetName(i)}: {value}");
- }
- }
- }
- finally { reader.Close(); }
+ Tests.ClientTests.CanClientExecuteQuery(adbcConnection,
testConfiguration);
}
-
- Assert.Equal(testConfiguration.ExpectedResultsCount, count);
}
/// <summary>
@@ -224,36 +166,11 @@ namespace
Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake
{
SnowflakeTestConfiguration testConfiguration =
Utils.LoadTestConfiguration<SnowflakeTestConfiguration>(SnowflakeTestingUtils.SNOWFLAKE_TEST_CONFIG_VARIABLE);
- Adbc.Client.AdbcConnection dbConnection =
GetSnowflakeAdbcConnection(testConfiguration);
- dbConnection.Open();
-
- DbCommand dbCommand = dbConnection.CreateCommand();
- dbCommand.CommandText = testConfiguration.Query;
-
- DbDataReader reader =
dbCommand.ExecuteReader(CommandBehavior.Default);
-
- if (reader.Read())
+ using (Adbc.Client.AdbcConnection adbcConnection =
GetSnowflakeAdbcConnection(testConfiguration))
{
- ReadOnlyCollection<DbColumn> column_schema =
reader.GetColumnSchema();
-
- DataTable dataTable = reader.GetSchemaTable();
+ SampleDataBuilder sampleDataBuilder =
SnowflakeData.GetSampleData();
- List<ColumnNetTypeArrowTypeValue> expectedValues =
SampleData.GetSampleData();
-
- for (int i = 0; i < reader.FieldCount; i++)
- {
- object value = reader.GetValue(i);
- ColumnNetTypeArrowTypeValue ctv = expectedValues[i];
-
- string readerColumnName = reader.GetName(i);
- string dataTableColumnName =
dataTable.Rows[i][SchemaTableColumn.ColumnName].ToString();
-
- Assert.True(readerColumnName.Equals(ctv.Name,
StringComparison.OrdinalIgnoreCase), $"`{readerColumnName}` != `{ctv.Name}` at
position {i}. Verify the test query and sample data return in the same order in
the reader.");
-
- Assert.True(dataTableColumnName.Equals(ctv.Name,
StringComparison.OrdinalIgnoreCase), $"`{dataTableColumnName}` != `{ctv.Name}`
at position {i}. Verify the test query and sample data return in the same order
in the data table.");
-
- Tests.ClientTests.AssertTypeAndValue(ctv, value, reader,
column_schema, dataTable);
- }
+ Tests.ClientTests.VerifyTypesAndValues(adbcConnection,
sampleDataBuilder);
}
}
diff --git a/csharp/test/Drivers/Snowflake/SampleData.cs
b/csharp/test/Drivers/Snowflake/SampleData.cs
deleted file mode 100644
index 6a99fe1a..00000000
--- a/csharp/test/Drivers/Snowflake/SampleData.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-* 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.
-*/
-
-using System;
-using System.Collections.Generic;
-using System.Data.SqlTypes;
-using System.Text;
-using Apache.Arrow.Types;
-
-namespace Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake
-{
- /// <summary>
- /// Gets the sample data (based on the first record of the
- /// resources/SnowflakeData.sql file)
- /// </summary>
- internal class SampleData
- {
- /// <summary>
- /// Sample data returned from TestConfiguration.Query.
- /// </summary>
- public static List<ColumnNetTypeArrowTypeValue> GetSampleData()
- {
- List<ColumnNetTypeArrowTypeValue> expectedValues = new
List<ColumnNetTypeArrowTypeValue>()
- {
- // https://github.com/apache/arrow-adbc/issues/1020 has
Snowflake treat all values as decimal by default
- new ColumnNetTypeArrowTypeValue("NUMBERTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(1m)),
- new ColumnNetTypeArrowTypeValue("DECIMALTYPE", typeof(double),
typeof(DoubleType), 123.1d),
- new ColumnNetTypeArrowTypeValue("NUMERICTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(1231m)),
- new ColumnNetTypeArrowTypeValue("INTTYPE", typeof(SqlDecimal),
typeof(Decimal128Type), new SqlDecimal(123m)),
- new ColumnNetTypeArrowTypeValue("INTEGERTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
- new ColumnNetTypeArrowTypeValue("BIGINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
- new ColumnNetTypeArrowTypeValue("SMALLINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
- new ColumnNetTypeArrowTypeValue("TINYINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
- new ColumnNetTypeArrowTypeValue("BYTEINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
- new ColumnNetTypeArrowTypeValue("FLOATTYPE", typeof(double),
typeof(DoubleType), 123.45d),
- new ColumnNetTypeArrowTypeValue("FLOAT4TYPE", typeof(double),
typeof(DoubleType), 123.45d),
- new ColumnNetTypeArrowTypeValue("FLOAT8TYPE", typeof(double),
typeof(DoubleType), 123.45d),
- new ColumnNetTypeArrowTypeValue("DOUBLETYPE", typeof(double),
typeof(DoubleType), 123.45d),
- new ColumnNetTypeArrowTypeValue("DOUBLEPRECISIONTYPE",
typeof(double), typeof(DoubleType), 123.45d),
- new ColumnNetTypeArrowTypeValue("REALTYPE", typeof(double),
typeof(DoubleType), 123.45d),
- new ColumnNetTypeArrowTypeValue("VARCHARTYPE", typeof(string),
typeof(StringType), "Hello"),
- new ColumnNetTypeArrowTypeValue("CHARTYPE", typeof(string),
typeof(StringType), "H"),
- new ColumnNetTypeArrowTypeValue("CHARACTERTYPE",
typeof(string), typeof(StringType), "H"),
- new ColumnNetTypeArrowTypeValue("STRINGTYPE", typeof(string),
typeof(StringType), "H"),
- new ColumnNetTypeArrowTypeValue("TEXTTYPE", typeof(string),
typeof(StringType), "Hello World"),
- new ColumnNetTypeArrowTypeValue("BINARYTYPE", typeof(byte[]),
typeof(BinaryType), Encoding.UTF8.GetBytes("Hello World")),
- new ColumnNetTypeArrowTypeValue("VARBINARYTYPE",
typeof(byte[]), typeof(BinaryType), Encoding.UTF8.GetBytes("Hello World")),
- new ColumnNetTypeArrowTypeValue("BOOLEANTYPE", typeof(bool),
typeof(BooleanType), true),
- new ColumnNetTypeArrowTypeValue("DATETYPE", typeof(DateTime),
typeof(Date32Type), new DateTime(2023, 7, 28)),
- new ColumnNetTypeArrowTypeValue("DATETIMETYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28, 12,34,56), TimeSpan.Zero)),
- new ColumnNetTypeArrowTypeValue("TIMETYPE", typeof(long),
typeof(Time64Type), 45296000000000L),
- new ColumnNetTypeArrowTypeValue("TIMESTAMPTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28,12,34,56), TimeSpan.Zero)),
- new ColumnNetTypeArrowTypeValue("TIMESTAMPLTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28,19,34,56), TimeSpan.Zero)),
- new ColumnNetTypeArrowTypeValue("TIMESTAMPNTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28, 12,34,56), TimeSpan.Zero)),
- new ColumnNetTypeArrowTypeValue("TIMESTAMPTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28, 19,34,56), TimeSpan.Zero)),
- };
-
- return expectedValues;
- }
- }
-}
diff --git a/csharp/test/Drivers/Snowflake/SnowflakeData.cs
b/csharp/test/Drivers/Snowflake/SnowflakeData.cs
new file mode 100644
index 00000000..c695d967
--- /dev/null
+++ b/csharp/test/Drivers/Snowflake/SnowflakeData.cs
@@ -0,0 +1,255 @@
+/*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Data.SqlTypes;
+using System.Text;
+using Apache.Arrow.Types;
+
+namespace Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake
+{
+ /// <summary>
+ /// Gets the sample data from Snowflake.
+ /// </summary>
+ internal class SnowflakeData
+ {
+ /// <summary>
+ /// Sample data
+ /// </summary>
+ public static SampleDataBuilder GetSampleData()
+ {
+ SampleDataBuilder sampleDataBuilder = new SampleDataBuilder();
+
+ // standard data
+ sampleDataBuilder.Samples.Add(
+ new SampleData()
+ {
+ Query = "SELECT " +
+ "CAST(1 as NUMBER(38,0)) as NUMBERTYPE, " +
+ "CAST(123.1 as NUMBER(18,1)) as DECIMALTYPE, " +
+ "CAST(123.1 as NUMBER(28,1)) as NUMERICTYPE, " +
+ "CAST(123 as NUMBER(38,0)) as INTTYPE, " +
+ "CAST(123 as NUMBER(38,0)) as INTEGERTYPE, " +
+ "CAST(123 as NUMBER(38,0)) as BIGINTTYPE, " +
+ "CAST(123 as NUMBER(38,0)) as SMALLINTTYPE, " +
+ "CAST(123 as NUMBER(38,0)) as TINYINTTYPE, " +
+ "CAST(123 as NUMBER(38,0)) as BYTEINTTYPE, " +
+ "CAST(123.45 as FLOAT) as FLOATTYPE, " +
+ "CAST(123.45 as FLOAT) as FLOAT4TYPE, " +
+ "CAST(123.45 as FLOAT) as FLOAT8TYPE, " +
+ "CAST(123.45 as FLOAT) as DOUBLETYPE, " +
+ "CAST(123.45 as FLOAT) as DOUBLEPRECISIONTYPE, " +
+ "CAST(123.45 as FLOAT) as REALTYPE, " +
+ "CAST('Hello' as VARCHAR(16777216)) as
VARCHARTYPE, " +
+ "CAST('H' as VARCHAR(1)) as CHARTYPE, " +
+ "CAST('H' as VARCHAR(1)) as CHARACTERTYPE, " +
+ "CAST('H' as VARCHAR(16777216)) as STRINGTYPE, " +
+ "CAST('Hello World' as VARCHAR(16777216)) as
TEXTTYPE, " +
+ "to_binary('Hello World', 'UTF-8') as BINARYTYPE,
" +
+ "to_binary('Hello World', 'UTF-8') as
VARBINARYTYPE, " +
+ "CAST(TRUE as BOOLEAN) as BOOLEANTYPE, " +
+ "CAST('2023-07-28' as DATE) as DATETYPE, " +
+ "CAST('2023-07-28 12:34:56' as TIMESTAMP_NTZ(9))
as DATETIMETYPE, " +
+ "CAST('12:34:56' as TIME(9)) as TIMETYPE, " +
+ "CAST('2023-07-28 12:34:56' as TIMESTAMP_NTZ(9))
as TIMESTAMPTYPE, " +
+ "CAST('2023-07-28 12:34:56' as TIMESTAMP_LTZ(9))
as TIMESTAMPLTZTYPE, " +
+ "CAST('2023-07-28 12:34:56' as TIMESTAMP_NTZ(9))
as TIMESTAMPNTZTYPE, " +
+ "CAST('2023-07-28 12:34:56' as TIMESTAMP_TZ(9)) as
TIMESTAMPTZTYPE",
+ ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
+ {
+ new ColumnNetTypeArrowTypeValue("NUMBERTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(1m)),
+ new ColumnNetTypeArrowTypeValue("DECIMALTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123.1m)),
+ new ColumnNetTypeArrowTypeValue("NUMERICTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123.1m)),
+ new ColumnNetTypeArrowTypeValue("INTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
+ new ColumnNetTypeArrowTypeValue("INTEGERTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
+ new ColumnNetTypeArrowTypeValue("BIGINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
+ new ColumnNetTypeArrowTypeValue("SMALLINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
+ new ColumnNetTypeArrowTypeValue("TINYINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
+ new ColumnNetTypeArrowTypeValue("BYTEINTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), new SqlDecimal(123m)),
+ new ColumnNetTypeArrowTypeValue("FLOATTYPE",
typeof(double), typeof(DoubleType), 123.45d),
+ new ColumnNetTypeArrowTypeValue("FLOAT4TYPE",
typeof(double), typeof(DoubleType), 123.45d),
+ new ColumnNetTypeArrowTypeValue("FLOAT8TYPE",
typeof(double), typeof(DoubleType), 123.45d),
+ new ColumnNetTypeArrowTypeValue("DOUBLETYPE",
typeof(double), typeof(DoubleType), 123.45d),
+ new ColumnNetTypeArrowTypeValue("DOUBLEPRECISIONTYPE",
typeof(double), typeof(DoubleType), 123.45d),
+ new ColumnNetTypeArrowTypeValue("REALTYPE",
typeof(double), typeof(DoubleType), 123.45d),
+ new ColumnNetTypeArrowTypeValue("VARCHARTYPE",
typeof(string), typeof(StringType), "Hello"),
+ new ColumnNetTypeArrowTypeValue("CHARTYPE",
typeof(string), typeof(StringType), "H"),
+ new ColumnNetTypeArrowTypeValue("CHARACTERTYPE",
typeof(string), typeof(StringType), "H"),
+ new ColumnNetTypeArrowTypeValue("STRINGTYPE",
typeof(string), typeof(StringType), "H"),
+ new ColumnNetTypeArrowTypeValue("TEXTTYPE",
typeof(string), typeof(StringType), "Hello World"),
+ new ColumnNetTypeArrowTypeValue("BINARYTYPE",
typeof(byte[]), typeof(BinaryType), Encoding.UTF8.GetBytes("Hello World")),
+ new ColumnNetTypeArrowTypeValue("VARBINARYTYPE",
typeof(byte[]), typeof(BinaryType), Encoding.UTF8.GetBytes("Hello World")),
+ new ColumnNetTypeArrowTypeValue("BOOLEANTYPE",
typeof(bool), typeof(BooleanType), true),
+ new ColumnNetTypeArrowTypeValue("DATETYPE",
typeof(DateTime), typeof(Date32Type), new DateTime(2023, 7, 28)),
+ new ColumnNetTypeArrowTypeValue("DATETIMETYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28, 12,34,56), TimeSpan.Zero)),
+ new ColumnNetTypeArrowTypeValue("TIMETYPE",
typeof(long), typeof(Time64Type), 45296000000000L),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28,12,34,56), TimeSpan.Zero)),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPLTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28,19,34,56), TimeSpan.Zero)),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPNTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28, 12,34,56), TimeSpan.Zero)),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), new DateTimeOffset(new
DateTime(2023,7,28, 19,34,56), TimeSpan.Zero)),
+ }
+ });
+
+ // null data
+ sampleDataBuilder.Samples.Add(
+ new SampleData()
+ {
+ Query = "SELECT " +
+ "CAST(NULL as NUMBER(38,0)) as NUMBERTYPE, " +
+ "CAST(NULL as NUMBER(18,1)) as DECIMALTYPE, " +
+ "CAST(NULL as NUMBER(28,1)) as NUMERICTYPE, " +
+ "CAST(NULL as NUMBER(38,0)) as INTTYPE, " +
+ "CAST(NULL as FLOAT) as FLOATTYPE, " +
+ "CAST(NULL as VARCHAR(16777216)) as VARCHARTYPE, "
+
+ "CAST(NULL as VARCHAR(1)) as CHARTYPE, " +
+ "to_binary(NULL) as BINARYTYPE, " +
+ "CAST(NULL as BOOLEAN) as BOOLEANTYPE, " +
+ "CAST(NULL as DATE) as DATETYPE, " +
+ "CAST(NULL as TIME(9)) as TIMETYPE, " +
+ "CAST(NULL as TIMESTAMP_NTZ(9)) as TIMESTAMPTYPE,
" +
+ "CAST(NULL as TIMESTAMP_LTZ(9)) as
TIMESTAMPLTZTYPE, " +
+ "CAST(NULL as TIMESTAMP_NTZ(9)) as
TIMESTAMPNTZTYPE, " +
+ "CAST(NULL as TIMESTAMP_TZ(9)) as TIMESTAMPTZTYPE",
+ ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
+ {
+ new ColumnNetTypeArrowTypeValue("NUMBERTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), null),
+ new ColumnNetTypeArrowTypeValue("DECIMALTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), null),
+ new ColumnNetTypeArrowTypeValue("NUMERICTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), null),
+ new ColumnNetTypeArrowTypeValue("INTTYPE",
typeof(SqlDecimal), typeof(Decimal128Type), null),
+ new ColumnNetTypeArrowTypeValue("FLOATTYPE",
typeof(double), typeof(DoubleType), null),
+ new ColumnNetTypeArrowTypeValue("VARCHARTYPE",
typeof(string), typeof(StringType), null),
+ new ColumnNetTypeArrowTypeValue("CHARTYPE",
typeof(string), typeof(StringType), null),
+ new ColumnNetTypeArrowTypeValue("BINARYTYPE",
typeof(byte[]), typeof(BinaryType), null),
+ new ColumnNetTypeArrowTypeValue("BOOLEANTYPE",
typeof(bool), typeof(BooleanType), null),
+ new ColumnNetTypeArrowTypeValue("DATETYPE",
typeof(DateTime), typeof(Date32Type), null),
+ new ColumnNetTypeArrowTypeValue("TIMETYPE",
typeof(long), typeof(Time64Type), null),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPTYPE",
typeof(DateTimeOffset), typeof(TimestampType), null),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPLTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), null),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPNTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), null),
+ new ColumnNetTypeArrowTypeValue("TIMESTAMPTZTYPE",
typeof(DateTimeOffset), typeof(TimestampType), null),
+ }
+ });
+
+ // large numbers
+ sampleDataBuilder.Samples.Add(
+ new SampleData()
+ {
+ Query = "SELECT " +
+ "CAST(999999999999999999 as NUMBER(18,0)) as
COL18, " +
+ "CAST(9999999999999999999 as NUMBER(19,0)) as
COL19, " +
+ "CAST(99999999999999999999 as NUMBER(20,0)) as
COL20, " +
+ "CAST(999999999999999999999 as NUMBER(21,0)) as
COL21, " +
+ "CAST(9999999999999999999999 as NUMBER(22,0)) as
COL22, " +
+ "CAST(99999999999999999999999 as NUMBER(23,0)) as
COL23, " +
+ "CAST(999999999999999999999999 as NUMBER(24,0)) as
COL24, " +
+ "CAST(9999999999999999999999999 as NUMBER(25,0))
as COL25, " +
+ "CAST(99999999999999999999999999 as NUMBER(26,0))
as COL26, " +
+ "CAST(999999999999999999999999999 as NUMBER(27,0))
as COL27, " +
+ "CAST(9999999999999999999999999999 as
NUMBER(28,0)) as COL28, " +
+ "CAST(99999999999999999999999999999 as
NUMBER(29,0)) as COL29, " +
+ "CAST(999999999999999999999999999999 as
NUMBER(30,0)) as COL30, " +
+ "CAST(9999999999999999999999999999999 as
NUMBER(31,0)) as COL31, " +
+ "CAST(99999999999999999999999999999999 as
NUMBER(32,0)) as COL32, " +
+ "CAST(999999999999999999999999999999999 as
NUMBER(33,0)) as COL33, " +
+ "CAST(9999999999999999999999999999999999 as
NUMBER(34,0)) as COL34, " +
+ "CAST(99999999999999999999999999999999999 as
NUMBER(35,0)) as COL35, " +
+ "CAST(999999999999999999999999999999999999 as
NUMBER(36,0)) as COL36, " +
+ "CAST(9999999999999999999999999999999999999 as
NUMBER(37,0)) as COL37, " +
+ "CAST(99999999999999999999999999999999999999 as
NUMBER(38,0)) as COL38",
+ ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
+ {
+ new ColumnNetTypeArrowTypeValue("COL18",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL19",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL20",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL21",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL22",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL23",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL24",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL25",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL26",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL27",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL28",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL29",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL30",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL31",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL32",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL33",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL34",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL35",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL36",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL37",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999999999999999")),
+ new ColumnNetTypeArrowTypeValue("COL38",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999999999999")),
+ }
+ });
+
+ // large with decimal
+ sampleDataBuilder.Samples.Add(
+ new SampleData()
+ {
+ Query = "SELECT " +
+ "CAST(9999999999999999.99 as NUMBER(18,2)) as
COL18, " +
+ "CAST(99999999999999999.99 as NUMBER(19,2)) as
COL19, " +
+ "CAST(999999999999999999.99 as NUMBER(20,2)) as
COL20, " +
+ "CAST(9999999999999999999.99 as NUMBER(21,2)) as
COL21, " +
+ "CAST(99999999999999999999.99 as NUMBER(22,2)) as
COL22, " +
+ "CAST(999999999999999999999.99 as NUMBER(23,2)) as
COL23, " +
+ "CAST(9999999999999999999999.99 as NUMBER(24,2))
as COL24, " +
+ "CAST(99999999999999999999999.99 as NUMBER(25,2))
as COL25, " +
+ "CAST(999999999999999999999999.99 as NUMBER(26,2))
as COL26, " +
+ "CAST(9999999999999999999999999.99 as
NUMBER(27,2)) as COL27, " +
+ "CAST(99999999999999999999999999.99 as
NUMBER(28,2)) as COL28, " +
+ "CAST(999999999999999999999999999.99 as
NUMBER(29,2)) as COL29, " +
+ "CAST(9999999999999999999999999999.99 as
NUMBER(30,2)) as COL30, " +
+ "CAST(99999999999999999999999999999.99 as
NUMBER(31,2)) as COL31, " +
+ "CAST(999999999999999999999999999999.99 as
NUMBER(32,2)) as COL32, " +
+ "CAST(9999999999999999999999999999999.99 as
NUMBER(33,2)) as COL33, " +
+ "CAST(99999999999999999999999999999999.99 as
NUMBER(34,2)) as COL34, " +
+ "CAST(999999999999999999999999999999999.99 as
NUMBER(35,2)) as COL35, " +
+ "CAST(9999999999999999999999999999999999.99 as
NUMBER(36,2)) as COL36, " +
+ "CAST(99999999999999999999999999999999999.99 as
NUMBER(37,2)) as COL37, " +
+ "CAST(999999999999999999999999999999999999.99 as
NUMBER(38,2)) as COL38",
+ ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
+ {
+ new ColumnNetTypeArrowTypeValue("COL18",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL19",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL20",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL21",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL22",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL23",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL24",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL25",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL26",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL27",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL28",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL29",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL30",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL31",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL32",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL33",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL34",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL35",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL36",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("9999999999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL37",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("99999999999999999999999999999999999.99")),
+ new ColumnNetTypeArrowTypeValue("COL38",
typeof(SqlDecimal), typeof(Decimal128Type),
SqlDecimal.Parse("999999999999999999999999999999999999.99")),
+ }
+ });
+
+ return sampleDataBuilder;
+ }
+ }
+}