GoogleCloudPlatform / zetasql-toolkit

The ZetaSQL Toolkit is a library that helps users use ZetaSQL Java API to perform SQL analysis for multiple query engines, including BigQuery and Cloud Spanner.
Apache License 2.0
39 stars 10 forks source link

null pointer error for JSON type field in addAllTablesUsedInQuery function. #17

Closed TunahanOcal closed 1 year ago

TunahanOcal commented 1 year ago

Hello everyone, I am using addAllTablesUsedInQuery function to create a catalog. However, if there is a JSON type column in the table, I am getting null pointer exception.

You can see the exception in the screenshot below:

Screenshot 2023-08-08 at 15 08 19

Thans in advance.

ppaglilla commented 1 year ago

Thank you for reporting this!

I found the cause of this bug. I'll address it and release a new version of the toolkit in the next couple of days.

goktugkose commented 1 year ago

Hello @ppaglilla,

Same issue persists with the function addAllFunctionsUsedInQuery when a BigQuery function holds a return type of JSON type. Since you plan to patch a similar bug, I want to contribute by revealing another unexpected behavior.

Thank you for your support 🙏

ppaglilla commented 1 year ago

Thanks for bringing the functions case up as well!

It is caused by the same problem as the tables one, so they'll be resolved together.

ppaglilla commented 1 year ago

Fixed in release 0.4.1. Thank you for reporting and apologies for the delayed release!