[ 
https://issues.apache.org/jira/browse/FLINK-19488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Satyam Shekhar updated FLINK-19488:
-----------------------------------
    Description: 
I have a table T0 with the following schema -

{{root}}
 \{{ |-- C0: BIGINT}}
 \{{ |-- C1: STRING}}
 \{{ |-- blaze_itime: TIMESTAMP(3)}}

 

The following SQL query fails for the above table - 

{{SELECT A.C0 AS output, A.C1 AS dim0 FROM T0 AS A WHERE (A.blaze_itime BETWEEN 
NOW() - INTERVAL '10' MINUTE AND NOW());}}

 

{{The generated code for the above query tries to assign a long value to 
timestamp type and fails to compile with the following exception -}}

 

{{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)}}

 

The generated code is added as an attachment to the issue.

 

  was:
I have a table T0 with the following schema -

{{root}}
 \{{ |-- C0: BIGINT}}
 \{{ |-- C1: STRING}}
 \{{ |-- blaze_itime: TIMESTAMP(3)}}

 

The following SQL query fails for the above table - 

{{SELECT A.C0 AS output, A.C1 AS dim0 FROM T0 AS A WHERE (A.blaze_itime BETWEEN 
NOW() - INTERVAL '10' MINUTE AND NOW());}}

 

{{The generated code for the above query tries to assign a long value to 
timestamp type and fails to compile with the following exception -}}

{{

{{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)}}

}}

 

The generated code is added as an attachment to the issue.

 


> 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
> The Environment has the following configuration parameters -
> {{env.setParallelism(Integer.getInteger("flinkParallelism", 2));}}
> {{env.getConfig().enableObjectReuse();}}
> {{var settings = EnvironmentSettings.newInstance()}}
> {{  .useBlinkPlanner()}}
> {{  .inBatchMode()}}
> {{  .build();}}
>            Reporter: Satyam Shekhar
>            Priority: Major
>         Attachments: code.java
>
>
> I have a table T0 with the following schema -
> {{root}}
>  \{{ |-- C0: BIGINT}}
>  \{{ |-- C1: STRING}}
>  \{{ |-- blaze_itime: TIMESTAMP(3)}}
>  
> The following SQL query fails for the above table - 
> {{SELECT A.C0 AS output, A.C1 AS dim0 FROM T0 AS A WHERE (A.blaze_itime 
> BETWEEN NOW() - INTERVAL '10' MINUTE AND NOW());}}
>  
> {{The generated code for the above query tries to assign a long value to 
> timestamp type and fails to compile with the following exception -}}
>  
> {{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)}}
>  
> The generated code is added as an attachment to the issue.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to