JingsongLi commented on a change in pull request #11925:
URL: https://github.com/apache/flink/pull/11925#discussion_r416369014



##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/generated/RecordEqualiser.java
##########
@@ -18,24 +18,18 @@
 
 package org.apache.flink.table.runtime.generated;
 
-import org.apache.flink.table.dataformat.BaseRow;
+import org.apache.flink.table.data.RowData;
 
 import java.io.Serializable;
 
 /**
- * Record equaliser for BaseRow which can compare two BaseRows and returns 
whether they are equal.
+ * Record equaliser for RowData which can compare two RowDatas and returns 
whether they are equal.

Review comment:
       `RowData` data no plurality "s"

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/binary/NestedRowData.java
##########
@@ -0,0 +1,338 @@
+/*
+ * 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.data.binary;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.core.memory.MemorySegmentFactory;
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.DecimalData;
+import org.apache.flink.table.data.MapData;
+import org.apache.flink.table.data.RawValueData;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.data.TimestampData;
+import org.apache.flink.table.data.TypedSetters;
+import org.apache.flink.table.utils.BinarySegmentUtils;
+import org.apache.flink.types.RowKind;
+
+import static 
org.apache.flink.table.data.binary.BinaryRowData.calculateBitSetWidthInBytes;
+import static org.apache.flink.util.Preconditions.checkArgument;
+
+/**
+ * Its memory storage structure is exactly the same with {@link BinaryRowData}.
+ * The only different is that, as {@link NestedRowData} is used
+ * to store row value in the variable-length part of {@link BinaryRowData},
+ * every field (including both fixed-length part and variable-length part) of 
{@link NestedRowData}
+ * has a possibility to cross the boundary of a segment, while the 
fixed-length part of {@link BinaryRowData}
+ * must fit into its first memory segment.
+ */
+@Internal
+public final class NestedRowData extends BinarySection implements RowData, 
TypedSetters {
+
+       private static final long serialVersionUID = 1L;

Review comment:
       Remove it.

##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CodeGeneratorContext.scala
##########
@@ -678,7 +678,7 @@ class CodeGeneratorContext(val tableConfig: TableConfig) {
 
       case None =>
         val term = newName("typeSerializer")
-        val ser = InternalSerializers.create(t, new ExecutionConfig)
+        val ser = InternalSerializers.createInternalSerializer(t, new 
ExecutionConfig)

Review comment:
       `createInternalSerializer` a little redundant

##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala
##########
@@ -132,6 +136,15 @@ object CodeGenUtils {
    * Returns a term for representing the given class in Java code.
    */
   def typeTerm(clazz: Class[_]): String = {
+    if (clazz == classOf[StringData]) {

Review comment:
       Could this put CodeGen at risk of missing cast?
   If possible, I prefer cast in accessing its methods.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to