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



##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/data/util/MapDataUtil.java
##########
@@ -16,44 +16,34 @@
  * limitations under the License.
  */
 
-package org.apache.flink.table.dataformat;
+package org.apache.flink.table.data.util;
 
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.MapData;
 import org.apache.flink.table.types.logical.LogicalType;
 
+import java.util.HashMap;
 import java.util.Map;
 
 /**
- * A GenericMap is a map where all the keys have the same type, and all the 
values have the same type.
- * It can be considered as a wrapper class of the normal java map.
+ * Utilities for {@link MapData}.
  */
-public class GenericMap implements BaseMap {
-
-       private final Map<Object, Object> map;
-
-       public GenericMap(Map<Object, Object> map) {
-               this.map = map;
-       }
-
-       @Override
-       public int numElements() {
-               return map.size();
-       }
-
-       @Override
-       public Map toJavaMap(LogicalType keyType, LogicalType valueType) {
-               return map;
-       }
-
-       public Object get(Object key) {
-               return map.get(key);
-       }
-
-       @Override
-       public String toString() {
-               return map.toString();
-       }
-
-       public Map<Object, Object> getMap() {
-               return map;
+public final class MapDataUtil {
+
+       /**
+        * Converts a {@link MapData} into Java {@link Map}, the keys and 
values of the Java map
+        * still holds objects of internal data structures.
+        */
+       public static Map<Object, Object> convertToJavaMap(

Review comment:
       This is also used in code generation: 
   
https://github.com/wuchong/flink/blob/744983929e464758baad98bf73cba9601eac48c5/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala#L2179




----------------------------------------------------------------
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