bowenli86 commented on a change in pull request #8314: [FLINK-12365][table] Add stats related catalog APIs URL: https://github.com/apache/flink/pull/8314#discussion_r279504357
########## File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogColumnStatistics.java ########## @@ -0,0 +1,125 @@ +/* + * 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.catalog; + +import java.util.HashMap; +import java.util.Map; + +/** + * Column statistics a non-partitioned table or a partition of a partitioned table. + */ +public class CatalogColumnStatistics { + + /** + * number of distinct values. + */ + private final Long ndv; + + /** + * number of nulls. + */ + private final Long nullCount; + + /** + * average length of column values. + */ + private final Double avgLen; + + /** + * max length of column values. + */ + private final Integer maxLen; + + /** + * max value of column values. + */ + private final Number max; Review comment: do we need to make min/max type `Object`? For string and date columns, the min/max would be String and Date, it's always been a bit tricky on stats definition. Hive handles stats for different typed columns in a different way by having individual classes for different typed stats, e.g. DecimalColumnStatsData, StringColumnStatsData, and DateColumnStatsData. I'm ok to leave this as-is for now, but want to bring up the potential issues and the need for a solution soon. ---------------------------------------------------------------- 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 With regards, Apache Git Services