flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Solovev (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FLINK-5592) Wrong number of RowSerializers with nested Rows in Collection mode
Date Mon, 23 Jan 2017 12:04:26 GMT

    [ https://issues.apache.org/jira/browse/FLINK-5592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15834337#comment-15834337
] 

Anton Solovev edited comment on FLINK-5592 at 1/23/17 12:03 PM:
----------------------------------------------------------------

Hi [~jark], thank you for helping me. I want exactly a row of a number of rows, this case
falls even if 
{code}
override def getReturnType: TypeInformation[Row] = {
      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")
      )
    }
{code}
with {{java.lang.IllegalArgumentException: Number of field types and names is different.}}


was (Author: tonycox):
Hi [~jark], thank you fro helping me. I want exactly a row of a number of rows, this case
falls even if 
{code}
override def getReturnType: TypeInformation[Row] = {
      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")
      )
    }
{code}
with {{java.lang.IllegalArgumentException: Number of field types and names is different.}}

> Wrong number of RowSerializers with nested Rows in Collection mode
> ------------------------------------------------------------------
>
>                 Key: FLINK-5592
>                 URL: https://issues.apache.org/jira/browse/FLINK-5592
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Anton Solovev
>
> {code}
>   @Test
>   def testNestedRowTypes(): Unit = {
>     val env = ExecutionEnvironment.getExecutionEnvironment
>     val tEnv = TableEnvironment.getTableEnvironment(env, config)
>     tEnv.registerTableSource("rows", new MockSource)
>     val table: Table = tEnv.scan("rows")
>     val nestedTable: Table = tEnv.scan("rows").select('person)
>     val collect: Seq[Row] = nestedTable.collect()
>     print(collect)
>   }
>   class MockSource extends BatchTableSource[Row] {
>     import org.apache.flink.api.java.ExecutionEnvironment
>     import org.apache.flink.api.java.DataSet
>     override def getDataSet(execEnv: ExecutionEnvironment): DataSet[Row] = {
>       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")))
>       execEnv.fromCollection(data.asJava, getReturnType)
>     }
>     override def getReturnType: TypeInformation[Row] = {
>       new RowTypeInfo(
>         Array[TypeInformation[_]](
>           new RowTypeInfo(
>             Array[TypeInformation[_]](BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO),
>             Array("name", "age"))),
>         Array("person")
>       )
>     }
>   }
> {code}
> throws {{java.lang.RuntimeException: Row arity of from does not match serializers}}
> stacktrace 
> {code}
> at org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:82)
> 	at org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:36)
> 	at org.apache.flink.api.common.operators.GenericDataSourceBase.executeOnCollections(GenericDataSourceBase.java:234)
> 	at org.apache.flink.api.common.operators.CollectionExecutor.executeDataSource(CollectionExecutor.java:218)
> 	at org.apache.flink.api.common.operators.CollectionExecutor.execute(CollectionExecutor.java:154)
> 	at org.apache.flink.api.common.operators.CollectionExecutor.execute(CollectionExecutor.java:130)
> 	at org.apache.flink.api.common.operators.CollectionExecutor.executeDataSink(CollectionExecutor.java:181)
> 	at org.apache.flink.api.common.operators.CollectionExecutor.execute(CollectionExecutor.java:157)
> 	at org.apache.flink.api.common.operators.CollectionExecutor.execute(CollectionExecutor.java:130)
> 	at org.apache.flink.api.common.operators.CollectionExecutor.execute(CollectionExecutor.java:114)
> 	at org.apache.flink.api.java.CollectionEnvironment.execute(CollectionEnvironment.java:35)
> 	at org.apache.flink.test.util.CollectionTestEnvironment.execute(CollectionTestEnvironment.java:47)
> 	at org.apache.flink.test.util.CollectionTestEnvironment.execute(CollectionTestEnvironment.java:42)
> 	at org.apache.flink.api.scala.ExecutionEnvironment.execute(ExecutionEnvironment.scala:672)
> 	at org.apache.flink.api.scala.DataSet.collect(DataSet.scala:547)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message