You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Tzu-Li (Gordon) Tai (JIRA)" <ji...@apache.org> on 2018/03/12 15:43:01 UTC

[jira] [Reopened] (FLINK-7939) DataStream of atomic type cannot be converted to Table with time attributes

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

Tzu-Li (Gordon) Tai reopened FLINK-7939:
----------------------------------------

> DataStream of atomic type cannot be converted to Table with time attributes
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-7939
>                 URL: https://issues.apache.org/jira/browse/FLINK-7939
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; SQL
>    Affects Versions: 1.4.0, 1.3.3
>            Reporter: Fabian Hueske
>            Assignee: Fabian Hueske
>            Priority: Major
>             Fix For: 1.4.0, 1.3.4
>
>
> A DataStream of an atomic type, such as {{DataStream<String>}} or {{DataStream<Long>}} cannot be converted into a {{Table}} with a time attribute.
> {code}
> DataStream<String> stream = ...
> Table table = tEnv.fromDataStream(stream, "string, rowtime.rowtime")
> {code}
> yields
> {code}
> Exception in thread "main" org.apache.flink.table.api.TableException: Field reference expression requested.
>     at org.apache.flink.table.api.TableEnvironment$$anonfun$1.apply(TableEnvironment.scala:630)
>     at org.apache.flink.table.api.TableEnvironment$$anonfun$1.apply(TableEnvironment.scala:624)
>     at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
>     at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
>     at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
>     at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
>     at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
>     at scala.collection.mutable.ArrayOps$ofRef.flatMap(ArrayOps.scala:186)
>     at org.apache.flink.table.api.TableEnvironment.getFieldInfo(TableEnvironment.scala:624)
>     at org.apache.flink.table.api.StreamTableEnvironment.registerDataStreamInternal(StreamTableEnvironment.scala:398)
>     at org.apache.flink.table.api.scala.StreamTableEnvironment.fromDataStream(StreamTableEnvironment.scala:85)
> {code}
> As a workaround the atomic type can be wrapped in {{Tuple1}}, i.e., convert a {{DataStream<String>}} into a {{DataStream<Tuple1<String>>}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)