You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by pn...@apache.org on 2018/07/25 08:31:28 UTC

flink git commit: [FLINK-9694][table] Fix NPE in CRowSerializerConfigSnapshot constructor

Repository: flink
Updated Branches:
  refs/heads/master 378cbb7c2 -> cc5c85547


[FLINK-9694][table] Fix NPE in CRowSerializerConfigSnapshot constructor

This closes #6392.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/cc5c8554
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/cc5c8554
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/cc5c8554

Branch: refs/heads/master
Commit: cc5c8554740f8a5e554d98de236ca9e17bf2c67a
Parents: 378cbb7
Author: Piotr Nowojski <pi...@gmail.com>
Authored: Mon Jul 23 15:27:03 2018 +0200
Committer: Piotr Nowojski <pi...@gmail.com>
Committed: Wed Jul 25 10:30:57 2018 +0200

----------------------------------------------------------------------
 .../table/runtime/types/CRowSerializer.scala    |  8 ++---
 .../runtime/types/CRowSerializerTest.scala      | 34 ++++++++++++++++++++
 2 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/cc5c8554/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/types/CRowSerializer.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/types/CRowSerializer.scala b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/types/CRowSerializer.scala
index caf346c..9418095 100644
--- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/types/CRowSerializer.scala
+++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/types/CRowSerializer.scala
@@ -115,12 +115,8 @@ class CRowSerializer(val rowSerializer: TypeSerializer[Row]) extends TypeSeriali
 
 object CRowSerializer {
 
-  class CRowSerializerConfigSnapshot(
-      private val rowSerializer: TypeSerializer[Row])
-    extends CompositeTypeSerializerConfigSnapshot(rowSerializer) {
-
-    /** This empty nullary constructor is required for deserializing the configuration. */
-    def this() = this(null)
+  class CRowSerializerConfigSnapshot(rowSerializers: TypeSerializer[Row]*)
+    extends CompositeTypeSerializerConfigSnapshot(rowSerializers: _*) {
 
     override def getVersion: Int = CRowSerializerConfigSnapshot.VERSION
   }

http://git-wip-us.apache.org/repos/asf/flink/blob/cc5c8554/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/types/CRowSerializerTest.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/types/CRowSerializerTest.scala b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/types/CRowSerializerTest.scala
new file mode 100644
index 0000000..7483b04d
--- /dev/null
+++ b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/types/CRowSerializerTest.scala
@@ -0,0 +1,34 @@
+/*
+ * 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.table.runtime.types
+
+import org.apache.flink.util.TestLogger
+import org.junit.Test
+
+class CRowSerializerTest extends TestLogger {
+
+  /**
+    * This empty constructor is required for deserializing the configuration.
+    */
+  @Test
+  def testDefaultConstructor(): Unit = {
+    new CRowSerializer.CRowSerializerConfigSnapshot()
+  }
+
+}