Skip to content

Commit

Permalink
fix(csharp/drivers/bigquery): add back support for Struct and List ar…
Browse files Browse the repository at this point in the history
…rays (#1282)

got a little too crazy with the refactoring and missed the List and
Struct types for BigQuery

---------

Co-authored-by: David Coe <coedavid@umich.edu>
  • Loading branch information
davidhcoe and David Coe authored Nov 10, 2023
1 parent 8c801c1 commit ff222e2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions csharp/src/Drivers/BigQuery/BigQueryStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ private Field TranslateField(TableFieldSchema field)
return new Field(field.Name, TranslateType(field), field.Mode == "NULLABLE");
}

public override object GetValue(IArrowArray arrowArray, Field field, int index)
{
switch(arrowArray)
{
case StructArray structArray:
return SerializeToJson(structArray, index);
case ListArray listArray:
return listArray.GetSlicedValues(index);
default:
return base.GetValue(arrowArray, field, index);
}
}

private IArrowType TranslateType(TableFieldSchema field)
{
// per https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/java/latest/com/google/api/services/bigquery/model/TableFieldSchema.html#getType--
Expand Down

0 comments on commit ff222e2

Please sign in to comment.