KurtYoung commented on a change in pull request #10239: [Flink-11491][Test] 
Support all TPC-DS queries
URL: https://github.com/apache/flink/pull/10239#discussion_r347718586
 
 

 ##########
 File path: 
flink-end-to-end-tests/flink-tpcds-test/src/main/java/org/apache/flink/table/tpcds/stats/CatalogTableStats.java
 ##########
 @@ -0,0 +1,50 @@
+/*
+ * 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.tpcds.stats;
+
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.catalog.ObjectPath;
+import org.apache.flink.table.catalog.stats.CatalogColumnStatistics;
+import org.apache.flink.table.catalog.stats.CatalogTableStatistics;
+
+/**
+ * Class to save catalog table statistics.
+ * Consist ofÄ {@link CatalogTableStatistics} and {@link 
CatalogTableStatistics}.
+ */
+public class CatalogTableStats {
+       private CatalogTableStatistics catalogTableStatistics;
+       private CatalogColumnStatistics catalogColumnStatistics;
+
+       public CatalogTableStats(CatalogTableStatistics catalogTableStatistics, 
CatalogColumnStatistics catalogColumnStatistics) {
+               this.catalogTableStatistics = catalogTableStatistics;
+               this.catalogColumnStatistics = catalogColumnStatistics;
+       }
+
+       public void register2Catalog(TableEnvironment tEnv, String table) {
+               try {
+                       tEnv.getCatalog(tEnv.getCurrentCatalog()).get()
+                               .alterTableStatistics(new 
ObjectPath(tEnv.getCurrentDatabase(), table), catalogTableStatistics, false);
+                       tEnv.getCatalog(tEnv.getCurrentCatalog()).get()
 
 Review comment:
   ditto

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to