teragrep / pth_10

Data Processing Language (DPL) translator for Apache Spark
GNU Affero General Public License v3.0
0 stars 2 forks source link

timechart span=1y results in NPE #259

Open 51-code opened 3 months ago

51-code commented 3 months ago

Describe the bug

When running the following query: %dpl index=abc earliest=-5y | timechart span=1y count(x)

it results in the following NullPointerException: java.lang.NullPointerException at com.teragrep.pth_07.DPLExecutor$2.syntaxError(DPLExecutor.java:161) at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41) at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544) at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.DefaultErrorStrategy.reportUnwantedToken(DefaultErrorStrategy.java:377) at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.DefaultErrorStrategy.sync(DefaultErrorStrategy.java:275) at com.teragrep.pth_03.antlr.DPLParser.timechartTransformation(DPLParser.java) at com.teragrep.pth_03.antlr.DPLParser.transformStatement(DPLParser.java:9185) at com.teragrep.pth_03.antlr.DPLParser.root(DPLParser.java:3128) at com.teragrep.pth_07.DPLExecutor.interpret(DPLExecutor.java:170) at com.teragrep.pth_07.DPLInterpreter.internalInterpret(DPLInterpreter.java:159) at org.apache.zeppelin.interpreter.AbstractInterpreter.interpret(AbstractInterpreter.java:47) at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:110) at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:860) at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:752) at org.apache.zeppelin.scheduler.Job.run(Job.java:172) at org.apache.zeppelin.scheduler.AbstractScheduler.runJob(AbstractScheduler.java:132) at org.apache.zeppelin.scheduler.FIFOScheduler.lambda$runJobInScheduler$0(FIFOScheduler.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)

Expected behavior

Using years in span is indeed not supported, but the correct behavior would be to give a better error message to the user and list the valid arguments.

How to reproduce

Run the query seen above.

Screenshots

Software version

pth_10 version: 5.3.0-4-g618d4a95 pth_03 version: 5.11.0

Desktop (please complete the following information if relevant):

Additional context