Error while scanning column of type array<decimal(10,2)>
into Go type []float64
#213
Labels
bug
Something isn't working
array<decimal(10,2)>
into Go type []float64
#213
I have a table that has a column
AMOUNTS
with a typearray<decimal(10,2)>
, which I expect to scan into a field type[]float64
.This is the test I wrote to reproduce it:
When I run my query, I get this error:
Source
This error comes from the standard library in Go: the value for that field is provided by the SDK as a
string
, but the destination is[]float64
, so it fails. I also dove into Databricks' SDK source code and found the place [2] where the string is generated.[1] Golang source - convertAssignRows
[2] Databricks SDK - listValueContainer.Value
Workaround
I created a custom type for the fields I have that use arrays:
So my field
is now
and I call
Amount.Slice()
when I want to read its value.The text was updated successfully, but these errors were encountered: