commit 4168db266aab1a509fbaf50cb637635abe4e16f6 Author: kellyzly Date: Thu Sep 28 16:16:39 2017 +0800 use HiveConf colfetch partitionfetch in RelOptHiveTable diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java index 85aa9b3..f700703 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java @@ -297,6 +297,10 @@ private void updateColStats(Set projIndxLst, boolean allowNullColumnFor colStatsCache.put(partitionList.getKey(), colStatsCached); } + boolean fetchColStats = + HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVE_STATS_FETCH_COLUMN_STATS); + boolean fetchPartStats = + HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVE_STATS_FETCH_PARTITION_STATS); // 2. Obtain Col Stats for Non Partition Cols if (nonPartColNamesThatRqrStats.size() > 0) { List hiveColStats = new ArrayList(); @@ -306,7 +310,7 @@ private void updateColStats(Set projIndxLst, boolean allowNullColumnFor try { Statistics stats = StatsUtils.collectStatistics(hiveConf, null, hiveTblMetadata, hiveNonPartitionCols, nonPartColNamesThatRqrStats, - colStatsCached, nonPartColNamesThatRqrStats, true, true); + colStatsCached, nonPartColNamesThatRqrStats, fetchColStats, fetchPartStats); rowCount = stats.getNumRows(); for (String c : nonPartColNamesThatRqrStats) { ColStatistics cs = stats.getColumnStatisticsFromColName(c); @@ -372,7 +376,7 @@ private void updateColStats(Set projIndxLst, boolean allowNullColumnFor } else { Statistics stats = StatsUtils.collectStatistics(hiveConf, partitionList, hiveTblMetadata, hiveNonPartitionCols, nonPartColNamesThatRqrStats, colStatsCached, - nonPartColNamesThatRqrStats, true, true); + nonPartColNamesThatRqrStats, fetchColStats, fetchPartStats); rowCount = stats.getNumRows(); hiveColStats = new ArrayList(); for (String c : nonPartColNamesThatRqrStats) {