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 exception sql queries includes unnest expression #51
Hello,
First of all, thank you for the new version of the toolkit.
After changing the version to 5.0, I encountered an error when the SQL code has unnest expression. After debugging the code I see that the ASTPathExpression in ASTTablePathExpression which contains unnest expression is null.
You can see where the null pointer error occurs below.
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "com.google.zetasql.parser.ASTNodes$ASTPathExpression.getParseLocationRange()" because "expression" is null] with root cause
java.lang.NullPointerException: Cannot invoke "com.google.zetasql.parser.ASTNodes$ASTPathExpression.getParseLocationRange()" because "expression" is null
at com.google.zetasql.toolkit.StatementRewriter.lambda$quoteNamePaths$0(StatementRewriter.java:123)
at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:473)
at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:360)
at java.base/java.util.TimSort.sort(TimSort.java:220)
at java.base/java.util.Arrays.sort(Arrays.java:1308)
at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.google.zetasql.toolkit.StatementRewriter.quoteNamePaths(StatementRewriter.java:124)
at com.google.zetasql.toolkit.ZetaSQLToolkitAnalyzer$StatementAnalyzer.next(ZetaSQLToolkitAnalyzer.java:210)
at com.google.zetasql.toolkit.ZetaSQLToolkitAnalyzer$StatementAnalyzer.next(ZetaSQLToolkitAnalyzer.java:148)
Hello, First of all, thank you for the new version of the toolkit. After changing the version to 5.0, I encountered an error when the SQL code has unnest expression. After debugging the code I see that the ASTPathExpression in ASTTablePathExpression which contains unnest expression is null.
You can see where the null pointer error occurs below.
You can see the error below: