You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ai...@apache.org on 2016/12/27 15:31:34 UTC
hive git commit: HIVE-15476: ObjectStore.getMTableColumnStatistics()
should check if colNames is empty (Aihua Xu, reviewed by Naveen Gangam)
Repository: hive
Updated Branches:
refs/heads/master 3c1344490 -> 943e31349
HIVE-15476: ObjectStore.getMTableColumnStatistics() should check if colNames is empty (Aihua Xu, reviewed by Naveen Gangam)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/943e3134
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/943e3134
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/943e3134
Branch: refs/heads/master
Commit: 943e31349163a0aa3dd3aff37d9f89f79f8821e1
Parents: 3c13444
Author: Aihua Xu <ai...@apache.org>
Authored: Tue Dec 20 16:28:30 2016 -0500
Committer: Aihua Xu <ai...@apache.org>
Committed: Tue Dec 27 10:29:07 2016 -0500
----------------------------------------------------------------------
.../apache/hadoop/hive/metastore/MetaStoreDirectSql.java | 11 ++++++++++-
.../org/apache/hadoop/hive/metastore/ObjectStore.java | 4 ++++
2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/943e3134/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
index dadc6f6..be67ccc 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
@@ -1144,9 +1144,18 @@ class MetaStoreDirectSql {
}
}
+ /**
+ * Retrieve the column statistics for the specified columns of the table. NULL
+ * is returned if the columns are not provided.
+ * @param dbName the database name of the table
+ * @param tableName the table name
+ * @param colNames the list of the column names
+ * @return the column statistics for the specified columns
+ * @throws MetaException
+ */
public ColumnStatistics getTableStats(final String dbName, final String tableName,
List<String> colNames) throws MetaException {
- if (colNames.isEmpty()) {
+ if (colNames == null || colNames.isEmpty()) {
return null;
}
final boolean doTrace = LOG.isDebugEnabled();
http://git-wip-us.apache.org/repos/asf/hive/blob/943e3134/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
index 1aa3e1a..a308970 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
@@ -7176,6 +7176,10 @@ public class ObjectStore implements RawStore, Configurable {
private List<MTableColumnStatistics> getMTableColumnStatistics(Table table, List<String> colNames, QueryWrapper queryWrapper)
throws MetaException {
+ if (colNames == null || colNames.isEmpty()) {
+ return null;
+ }
+
boolean committed = false;
try {