[
https://issues.apache.org/jira/browse/FLINK-5481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15842408#comment-15842408
]
ASF GitHub Bot commented on FLINK-5481:
---------------------------------------
Github user tonycox commented on the issue:
https://github.com/apache/flink/pull/3127
I think all it's just a syntax sugar
```scala
val data = List(
Row.of(Row.of("data_1", "dob"), Row.of("info_4", "dub")),
Row.of(Row.of("data_1", "dob"), Row.of("info_4", "dub")),
Row.of(Row.of("data_1", "dob"), Row.of("info_4", "dub")))
val info= RowTypeInfo.from(
RowTypeInfo.from(classOf[String], classOf[String]),
RowTypeInfo.from(classOf[String], classOf[String])
)
execEnv.fromCollection(data, info)
```
instead of
```scala
val info = new RowTypeInfo(
Array[TypeInformation[_]](
new RowTypeInfo(
Array[TypeInformation[_]](
BasicTypeInfo.STRING_TYPE_INFO,
BasicTypeInfo.STRING_TYPE_INFO),
Array("name", "age")),
new RowTypeInfo(
Array[TypeInformation[_]](
BasicTypeInfo.STRING_TYPE_INFO,
BasicTypeInfo.STRING_TYPE_INFO),
Array("more_info", "and_so_on"))),
Array("person", "additional")
)
execEnv.fromCollection(data, info)
```
> Cannot create Collection of Row
> --------------------------------
>
> Key: FLINK-5481
> URL: https://issues.apache.org/jira/browse/FLINK-5481
> Project: Flink
> Issue Type: Bug
> Affects Versions: 1.2.0
> Reporter: Anton Solovev
> Assignee: Anton Solovev
> Priority: Trivial
>
> When we use {{ExecutionEnvironment#fromElements(X... data)}} it takes first
> element of {{data}} to define a type. If first Row in collection has wrong
> number of fields (there are nulls) TypeExtractor returns not RowTypeInfo, but
> GenericType<Row>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)