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

liqi316 updated FLINK-18266:
----------------------------
    Description: 
when I register a stream to  table , and use proctime. if not use cast function 
to change the field (proctime) , it will be some errors . 

my scene is ,when i continues use query, i must be register a new proctime, the 
field proctime cannt be inherited。

for example:

tableEnvironment.registerDataStream("test_table1", row, 
"requestNo,deptName,pdmNo,overFlag,createDate,proctime.proctime");

when i add proctime in test_table1, and then use

Table resTable = tableEnvironment.sqlQuery("select * from test_table1")

the field prctime cannt be a timeattr field

 

errors:

Caused by: java.lang.ClassCastException: java.time.LocalDateTime cannot be cast 
to java.lang.LongCaused by: java.lang.ClassCastException: 
java.time.LocalDateTime cannot be cast to java.lang.Long at 
org.apache.flink.api.common.typeutils.base.LongSerializer.copy(LongSerializer.java:32)
 at 
org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:93)
 at 
org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:44)
 at 
org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.pushToOperator(OperatorChain.java:635)
 ... 51 more

 

  was:
当注册表的时候,指定了proctime,但是在select * from talbe 的时候会报类型无法转换。

Caused by: java.lang.ClassCastException: java.time.LocalDateTime cannot be cast 
to java.lang.LongCaused by: java.lang.ClassCastException: 
java.time.LocalDateTime cannot be cast to java.lang.Long at 
org.apache.flink.api.common.typeutils.base.LongSerializer.copy(LongSerializer.java:32)
 at 
org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:93)
 at 
org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:44)
 at 
org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.pushToOperator(OperatorChain.java:635)
 ... 51 more

 

        Summary: flink sql use proctime, it cannt use timeattr in next table  
(was: 在表中使用proctime时,如果sql中不对强转,任务输出有问题)

> flink sql use proctime, it cannt use timeattr in next table
> -----------------------------------------------------------
>
>                 Key: FLINK-18266
>                 URL: https://issues.apache.org/jira/browse/FLINK-18266
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API, Table SQL / Planner
>    Affects Versions: 1.9.1
>            Reporter: liqi316
>            Priority: Trivial
>
> when I register a stream to  table , and use proctime. if not use cast 
> function to change the field (proctime) , it will be some errors . 
> my scene is ,when i continues use query, i must be register a new proctime, 
> the field proctime cannt be inherited。
> for example:
> tableEnvironment.registerDataStream("test_table1", row, 
> "requestNo,deptName,pdmNo,overFlag,createDate,proctime.proctime");
> when i add proctime in test_table1, and then use
> Table resTable = tableEnvironment.sqlQuery("select * from test_table1")
> the field prctime cannt be a timeattr field
>  
> errors:
> Caused by: java.lang.ClassCastException: java.time.LocalDateTime cannot be 
> cast to java.lang.LongCaused by: java.lang.ClassCastException: 
> java.time.LocalDateTime cannot be cast to java.lang.Long at 
> org.apache.flink.api.common.typeutils.base.LongSerializer.copy(LongSerializer.java:32)
>  at 
> org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:93)
>  at 
> org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:44)
>  at 
> org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.pushToOperator(OperatorChain.java:635)
>  ... 51 more
>  



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

Reply via email to