FAQ
Repository: hive
Updated Branches:
   refs/heads/master 3b6b56d70 -> a71edcf6a


HIVE-9499 : hive.limit.query.max.table.partition makes queries fail on non-partitioned tables (Navis via Ashutosh Chauhan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a71edcf6
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a71edcf6
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a71edcf6

Branch: refs/heads/master
Commit: a71edcf6a5672452a8e00c2bad4f20cffced26d9
Parents: 3b6b56d
Author: Navis Ryu <navis@apache.org>
Authored: Sun Feb 8 17:57:00 2015 -0800
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Thu Mar 24 19:09:47 2016 -0700

----------------------------------------------------------------------
  .../ql/optimizer/stats/annotation/StatsRulesProcFactory.java | 3 +--
  .../java/org/apache/hadoop/hive/ql/parse/ParseContext.java | 5 +++++
  .../org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java | 8 ++++++--
  3 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/a71edcf6/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
index 4bcf6bf..c4fc5ca 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
@@ -105,8 +105,7 @@ public class StatsRulesProcFactory {
          Object... nodeOutputs) throws SemanticException {
        TableScanOperator tsop = (TableScanOperator) nd;
        AnnotateStatsProcCtx aspCtx = (AnnotateStatsProcCtx) procCtx;
- PrunedPartitionList partList =
- aspCtx.getParseContext().getPrunedPartitions(tsop.getName(), tsop);
+ PrunedPartitionList partList = aspCtx.getParseContext().getPrunedPartitions(tsop);
        Table table = tsop.getConf().getTableMetadata();

        try {

http://git-wip-us.apache.org/repos/asf/hive/blob/a71edcf6/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseContext.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseContext.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseContext.java
index 4f784d1..95c254c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseContext.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseContext.java
@@ -466,6 +466,11 @@ public class ParseContext {
      this.fetchTask = fetchTask;
    }

+ public PrunedPartitionList getPrunedPartitions(TableScanOperator ts)
+ throws SemanticException {
+ return getPrunedPartitions(ts.getConf().getAlias(), ts);
+ }
+
    public PrunedPartitionList getPrunedPartitions(String alias, TableScanOperator ts)
        throws SemanticException {
      PrunedPartitionList partsList = opToPartList.get(ts);

http://git-wip-us.apache.org/repos/asf/hive/blob/a71edcf6/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index d9db1d5..adee14b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -10776,10 +10776,14 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
          // check whether any of them break the limit
          for (Operator<?> topOp : topOps.values()) {
            if (topOp instanceof TableScanOperator) {
- if (((TableScanDesc)topOp.getConf()).getIsMetadataOnly()) {
+ TableScanOperator tsOp = (TableScanOperator) topOp;
+ if (tsOp.getConf().getIsMetadataOnly()) {
+ continue;
+ }
+ PrunedPartitionList parts = pCtx.getPrunedPartitions(tsOp);
+ if (!parts.getSourceTable().isPartitioned()) {
                continue;
              }
- PrunedPartitionList parts = pCtx.getOpToPartList().get(topOp);
              if (parts.getPartitions().size() > scanLimit) {
                throw new SemanticException(ErrorMsg.PARTITION_SCAN_LIMIT_EXCEEDED, ""
                    + parts.getPartitions().size(), "" + parts.getSourceTable().getTableName(), ""

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMar 25, '16 at 2:12a
activeMar 25, '16 at 2:12a
posts1
users1
websitehive.apache.org

1 user in discussion

Hashutosh: 1 post

People

Translate

site design / logo © 2021 Grokbase