-
Notifications
You must be signed in to change notification settings - Fork 126
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
Named parameters do not work with records/subfields #207
Comments
Can you provide us with the code and BigQuery version you're using for us to reproduce the issue? |
Version 1.106.0. To reproduce, execute a query and get a iterable of FieldValueList. fieldValueList.get("record_field").getRecordValue().get("field_on_record"); The schema object is not passed on to the nested FieldValueList for the field on the record. |
@shollyman PTAL |
Seems like named query parameters are a bit of a red herring here (or the reporter is simply refering to named fields of a record's sub-schema). The issue is all down to nested schema propagation, which we're not doing here correctly. e.g. if you get() a record type from fieldvaluelist and schema is present, we should access the corresponding schema field and propagate the nested schema (or fieldlist) when returning the data object. Unclear without doing more work if we need to consider other accessors/constructors patterns. |
The issue still occurs in com.google.cloud.google-cloud-bigquery:2.38.2. |
Named parameters do not work when executing a query with Record type attributes. The FieldValueList does not pass the schema to the FieldValue and then to the FieldValueList after FieldValue.getRecordValue() is called. This means the schema instance is no longer available and the FieldValueList.get(String name) method no longer works. Also, due to encapsulation, the schema cannot be provided to the FieldValueList once it has been created.
The expected behavior would be passing the schema to the FieldValueList when it is a record type so that named parameters continue to work.
The text was updated successfully, but these errors were encountered: