[
https://issues.apache.org/jira/browse/FLINK-7939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Fabian Hueske closed FLINK-7939.
--------------------------------
Resolution: Fixed
Fixed for 1.3.3 with 168378d98ddf591f780a939ee74310ec8d04d517
Fixed for 1.4.0 with 505d478d55c93e07a7227e375939eca19ec4d082
> 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 & SQL
> Affects Versions: 1.4.0, 1.3.3
> Reporter: Fabian Hueske
> Assignee: Fabian Hueske
> Priority: Major
> Fix For: 1.4.0, 1.3.3
>
>
> 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
(v6.4.14#64029)