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

ASF GitHub Bot commented on FLINK-2203:
---------------------------------------

Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/831#discussion_r32371128
  
    --- Diff: 
flink-staging/flink-table/src/test/scala/org/apache/flink/api/table/typeinfo/RowSerializerTest.scala
 ---
    @@ -0,0 +1,70 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.api.table.typeinfo
    +
    +import org.apache.flink.api.common.ExecutionConfig
    +import org.apache.flink.api.common.typeinfo.{BasicTypeInfo, 
TypeInformation}
    +import org.apache.flink.api.common.typeutils.{SerializerTestInstance, 
TypeSerializer}
    +import org.apache.flink.api.table.Row
    +import org.junit.Assert._
    +import org.junit.Test
    +
    +class RowSerializerTest {
    +
    +  class RowSerializerTestInstance(serializer: TypeSerializer[Row],
    +                                  testData: Array[Row])
    +    extends SerializerTestInstance(serializer, classOf[Row], -1, testData: 
_*) {
    +
    +    override protected def deepEquals(message: String, should: Row, is: 
Row): Unit = {
    +      val arity = should.productArity
    +      assertEquals(message, arity, is.productArity)
    +      var index = 0
    +      while (index < arity) {
    +        val copiedValue: Any = should.productElement(index)
    +        val element: Any = is.productElement(index)
    +        assertEquals(message, element, copiedValue)
    +        index += 1
    +      }
    +    }
    +  }
    +
    +  @Test
    +  def testRowSerializer(): Unit ={
    +
    +    val rowInfo: TypeInformation[Row] = new RowTypeInfo(
    +      Seq(BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO), 
Seq("id", "name"))
    +
    +    val row1 = new Row(2)
    +    row1.setField(0, 1)
    +    row1.setField(1, "a")
    +
    +    val row2 = new Row(2)
    +    row2.setField(0, 2)
    +    row2.setField(1, "hello")
    +
    +    val testData: Array[Row] = Array(row1, row2)
    --- End diff --
    
    I think it would be good to also add a row that has null values, since the 
change actually introduces that.


> Add Support for Null-Values in RowSerializer
> --------------------------------------------
>
>                 Key: FLINK-2203
>                 URL: https://issues.apache.org/jira/browse/FLINK-2203
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API
>            Reporter: Aljoscha Krettek
>            Assignee: Shiti Saxena
>            Priority: Minor
>              Labels: Starter
>
> This would be a start towards proper handling of null values. We would still 
> need to add support for null values in aggregations.



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

Reply via email to