Skip to content

Commit 538dd72

Browse files
author
David Coe
committed
make DATE the Date32 Arrow type
1 parent 6f81035 commit 538dd72

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

csharp/src/Drivers/BigQuery/BigQueryConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ private Field.Builder GetFieldBuilder(string name, string type, string dataType,
928928
case "TIME":
929929
return fieldBuilder.DataType(Time64Type.Default);
930930
case "DATE":
931-
return fieldBuilder.DataType(Date64Type.Default);
931+
return fieldBuilder.DataType(Date32Type.Default);
932932
case "RECORD" or "STRUCT":
933933
string fieldRecords = type.Substring(index + 1);
934934
fieldRecords = fieldRecords.Remove(fieldRecords.Length - 1);

csharp/src/Drivers/BigQuery/BigQueryStatement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private IArrowType TranslateType(TableFieldSchema field)
161161
case "TIME":
162162
return GetType(field, Time64Type.Default);
163163
case "DATE":
164-
return GetType(field, Date64Type.Default);
164+
return GetType(field, Date32Type.Default);
165165
case "RECORD" or "STRUCT":
166166
// its a json string
167167
return GetType(field, StringType.Default);

csharp/src/Drivers/BigQuery/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The following table depicts how the BigQuery ADBC driver converts a BigQuery typ
8787
| BIGNUMERIC | Decimal256 | string
8888
| BOOL | Boolean | bool
8989
| BYTES | Binary | byte[]
90-
| DATE | Date64 | DateTime
90+
| DATE | Date32 | DateTime
9191
| DATETIME | Timestamp | DateTime
9292
| FLOAT64 | Double | double
9393
| GEOGRAPHY | String | string

csharp/test/Drivers/BigQuery/BigQueryData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static SampleDataBuilder GetSampleData()
7272
new ColumnNetTypeArrowTypeValue("is_active", typeof(bool), typeof(BooleanType), true),
7373
new ColumnNetTypeArrowTypeValue("name", typeof(string), typeof(StringType), "John Doe"),
7474
new ColumnNetTypeArrowTypeValue("data", typeof(byte[]), typeof(BinaryType), UTF8Encoding.UTF8.GetBytes("abc123")),
75-
new ColumnNetTypeArrowTypeValue("date", typeof(DateTime), typeof(Date64Type), new DateTime(2023, 9, 8)),
75+
new ColumnNetTypeArrowTypeValue("date", typeof(DateTime), typeof(Date32Type), new DateTime(2023, 9, 8)),
7676
#if NET6_0_OR_GREATER
7777
new ColumnNetTypeArrowTypeValue("time", typeof(TimeOnly), typeof(Time64Type), new TimeOnly(12, 34, 56)), //'12:34:56'
7878
#else
@@ -134,7 +134,7 @@ public static SampleDataBuilder GetSampleData()
134134
new ColumnNetTypeArrowTypeValue("is_active", typeof(bool), typeof(BooleanType), null),
135135
new ColumnNetTypeArrowTypeValue("name", typeof(string), typeof(StringType), null),
136136
new ColumnNetTypeArrowTypeValue("data", typeof(byte[]), typeof(BinaryType), null),
137-
new ColumnNetTypeArrowTypeValue("date", typeof(DateTime), typeof(Date64Type), null),
137+
new ColumnNetTypeArrowTypeValue("date", typeof(DateTime), typeof(Date32Type), null),
138138
#if NET6_0_OR_GREATER
139139
new ColumnNetTypeArrowTypeValue("time", typeof(TimeOnly), typeof(Time64Type), null),
140140
#else

0 commit comments

Comments
 (0)