[
https://issues.apache.org/jira/browse/FLINK-19488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17227718#comment-17227718
]
Jark Wu edited comment on FLINK-19488 at 11/7/20, 4:03 AM:
-----------------------------------------------------------
[~satyamshekhar], There is a bug when in code generation for NOW() function.
This has been fixed by FLINK-19948 recently.
Could you use {{CURRENT_TIMESTAMP()}} and try again? It has the same semantic
with NOW().
You can also build the latest release-1.11 branch and try the NOW() function
that.
was (Author: jark):
[~satyamshekhar], There is a bug when in code generation for NOW() function.
This has been fixed by FLINK-19948 recently.
Could you use {{CURRENT_TIMESTAMP()}} and try again? It has the same semantic
with NOW(). You can also build the latest release-1.11 branch and try on that.
> Failed compilation of generated class
> -------------------------------------
>
> Key: FLINK-19488
> URL: https://issues.apache.org/jira/browse/FLINK-19488
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Runtime
> Affects Versions: 1.11.1
> Environment: Flink version: 1.11.1
>
> Reporter: Satyam Shekhar
> Priority: Major
> Attachments: code.java
>
>
> I have a table T0 with the following schema -
>
> {code:java}
> root
> |-- C0: BIGINT
> |-- C1: STRING
> |-- blaze_itime: TIMESTAMP(3)
> {code}
>
> The following SQL query fails for the above table -
> {code:java}
> SELECT A.C0 AS output, A.C1 AS dim0 FROM T0 AS A WHERE (A.blaze_itime BETWEEN
> NOW() - INTERVAL '10' MINUTE AND NOW());
> {code}
>
> The generated code for the above query tries to assign a long value to
> timestamp type and fails to compile with the following exception -
> {code:java}
> java.lang.RuntimeException: Could not instantiate generated class
> 'BatchCalc$14'java.lang.RuntimeException: Could not instantiate generated
> class 'BatchCalc$14' at
> org.apache.flink.table.runtime.generated.GeneratedClass.newInstance(GeneratedClass.java:67)
> at
> org.apache.flink.table.runtime.operators.CodeGenOperatorFactory.createStreamOperator(CodeGenOperatorFactory.java:40)
> at
> org.apache.flink.streaming.api.operators.StreamOperatorFactoryUtil.createOperator(StreamOperatorFactoryUtil.java:70)
> at
> org.apache.flink.streaming.runtime.tasks.OperatorChain.createChainedOperator(OperatorChain.java:470)
> at
> ...
> Caused by: org.codehaus.commons.compiler.CompileException: Line 55, Column
> 21: Assignment conversion not possible from type "long" to type
> "org.apache.flink.table.data.TimestampData"Caused by:
> org.codehaus.commons.compiler.CompileException: Line 55, Column 21:
> Assignment conversion not possible from type "long" to type
> "org.apache.flink.table.data.TimestampData" at
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12124) at
> org.codehaus.janino.UnitCompiler.assignmentConversion(UnitCompiler.java:10975)
> at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3788) at
> org.codehaus.janino.UnitCompiler.access$6100(UnitCompiler.java:215)
> {code}
>
> The generated code is added as an attachment to the issue.
>
> The Environment has the following configuration parameters -
> {code:java}
> env.setParallelism(Integer.getInteger("flinkParallelism", 2));
> env.getConfig().enableObjectReuse();
> var settings = EnvironmentSettings.newInstance()
> .useBlinkPlanner()
> .inBatchMode()
> .build();
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)