You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2018/05/28 16:37:19 UTC
[4/4] hive git commit: HIVE-19691: Start SessionState in materialized
views registry (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)
HIVE-19691: Start SessionState in materialized views registry (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/780b0127
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/780b0127
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/780b0127
Branch: refs/heads/master
Commit: 780b0127fd22ec95a6b225a493872bcec364ef76
Parents: 619f79d
Author: Jesus Camacho Rodriguez <jc...@apache.org>
Authored: Mon May 28 09:31:29 2018 -0700
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Mon May 28 09:35:13 2018 -0700
----------------------------------------------------------------------
.../hive/ql/metadata/HiveMaterializedViewsRegistry.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/780b0127/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java
index 960ad76..98c9ce9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java
@@ -51,6 +51,7 @@ import org.apache.hadoop.hive.conf.Constants;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.DefaultMetaStoreFilterHookImpl;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
import org.apache.hadoop.hive.ql.Context;
import org.apache.hadoop.hive.ql.QueryState;
import org.apache.hadoop.hive.ql.exec.ColumnInfo;
@@ -66,6 +67,7 @@ import org.apache.hadoop.hive.ql.parse.ColumnStatsList;
import org.apache.hadoop.hive.ql.parse.ParseUtils;
import org.apache.hadoop.hive.ql.parse.PrunedPartitionList;
import org.apache.hadoop.hive.ql.parse.RowResolver;
+import org.apache.hadoop.hive.ql.session.SessionState;
import org.apache.hadoop.hive.serde2.SerDeException;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
@@ -126,7 +128,7 @@ public final class HiveMaterializedViewsRegistry {
// Create a new conf object to bypass metastore authorization, as we need to
// retrieve all materialized views from all databases
HiveConf conf = new HiveConf();
- conf.set(HiveConf.ConfVars.METASTORE_FILTER_HOOK.varname,
+ conf.set(MetastoreConf.ConfVars.FILTER_HOOK.getVarname(),
DefaultMetaStoreFilterHookImpl.class.getName());
init(Hive.get(conf));
} catch (HiveException e) {
@@ -159,6 +161,7 @@ public final class HiveMaterializedViewsRegistry {
@Override
public void run() {
try {
+ SessionState.start(db.getConf());
for (String dbName : db.getAllDatabases()) {
for (Table mv : db.getAllMaterializedViewObjects(dbName)) {
addMaterializedView(db.getConf(), mv, OpType.LOAD);
@@ -413,7 +416,7 @@ public final class HiveMaterializedViewsRegistry {
return analyzer.genLogicalPlan(node);
} catch (Exception e) {
// We could not parse the view
- LOG.error(e.getMessage());
+ LOG.error("Error parsing original query for materialized view", e);
return null;
}
}