New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong results returned when querying a RECORD column #265
Comments
The behaviour for TIMESTAMP fields of records is also affected (and maybe also others) In this case, selecting the record returns '2023-08-01T21:22:23Z' for the inserted timestamp value
|
Thank you for the detailed report. I briefly investigated the cause and would like to document it. Internally, in go-zetasqlite which we use for constructing responses, there is a difference in the method of construction for structured and non-structured data. For Numeric types, we convert to a string using In the case of a Struct, we first convert it to a Then, we use The definition of On the other hand, the definition of Due to these differences, it seems that outputs within structures are different for other types as well. |
I can take a look at this soon if you could assign it to me @totem3. |
Thank you for your response. As I haven’t started working on it yet, I would be grateful if you could address this issue. |
I haven't taken a look at this yet. If you have some time @totem3, that'd be appreciated. |
What happened?
Step 1: Create a table
record_test
with a record column containing a numeric fieldStep 2: Insert a row
INSERT INTO record_test (rec) VALUES (STRUCT(47.123456789 AS value))
Step 3: Query the table using the
bq
toolSELECT * FROM record_test
SELECT rec FROM record_test
SELECT rec.* FROM record_test
SELECT rec.value FROM record_test
Selecting
rec.value
with the Java BigQuery client works, but selectingrec
or*
fails with the error that47123456789/1000000000
can't be parsed when iterating the field value lists.What did you expect to happen?
Step 3: Query the table using the
bq
toolThe following results are returned when using BigQuery instead of the emulator.
SELECT * FROM record_test
SELECT rec FROM record_test
SELECT rec.* FROM record_test
SELECT rec.value FROM record_test
Also iterating via BigQuery client libraries should work as expected for all the statements.
Note that also the returned column names are different.
How can we reproduce it (as minimally and precisely as possible)?
Follow the steps as described above
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: