JingsongLi commented on code in PR #484:
URL: https://github.com/apache/flink-table-store/pull/484#discussion_r1092828531


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/operation/AppendOnlyFileStoreScan.java:
##########
@@ -102,25 +101,6 @@ protected boolean filterByStats(ManifestEntry entry) {
     /** Note: Keep this thread-safe. */
     private FieldStatsArraySerializer getFieldStatsArraySerializer(long 
schemaId) {
         return schemaRowStatsConverters.computeIfAbsent(

Review Comment:
   Can we just use `FieldStatsConverters` to replace this 
`schemaRowStatsConverters`?



##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/stats/FieldStatsConverters.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.store.file.stats;
+
+import org.apache.flink.table.store.file.casting.CastExecutor;
+import org.apache.flink.table.store.file.schema.SchemaEvolutionUtil;
+import org.apache.flink.table.store.types.DataField;
+import org.apache.flink.table.store.types.RowType;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.function.Function;
+
+/** Converters to create field stats array serializer. */
+public class FieldStatsConverters {
+    private final Function<Long, List<DataField>> schemaFields;
+    private final ConcurrentMap<SchemaIdKey, FieldStatsArraySerializer> 
serializers;
+
+    public FieldStatsConverters(Function<Long, List<DataField>> schemaFields) {
+        this.schemaFields = schemaFields;
+        this.serializers = new ConcurrentHashMap<>();
+    }
+
+    public FieldStatsArraySerializer getOrCreate(long tableSchemaId, long 
dataSchemaId) {

Review Comment:
   What do you think about my original thought:
   ```
   class FieldStatsConverters {
      FieldStatsConverters(Function<Long, List<DataField>> schemas, long 
tableSchemaId) {...}
      FieldStatsArraySerializer get0rCreate(long fileSchemaId);
   }
   ```
   
   Maybe we don't need a so flexable `SchemaIdKey`?



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

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

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

Reply via email to