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
35 stars 8 forks source link

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

Closed TunahanOcal closed 9 months ago

TunahanOcal commented 11 months 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 11 months 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 11 months 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 11 months 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 9 months ago

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