Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-26085

"getTableObjectByName method should ignore it" exception doesn't include cause

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Parser
    • None
    • HDP 3.1.5

    Description

      current logic doesn't contain cause
      https://github.com/apache/hive/blob/a6e93633dc15aba179fb6ad422be4cbc88adf071/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L12208

      but

      throw new SemanticException("Got exception though getTableObjectByName method should ignore it", e)
      

      seems better for troubleshooting.

      We encounter this issue when user access hive view where user doesn't hive permission in original hive table.

      create view aaa_view
      as
      select ... from aaa
      

      "getTableObjectByName" exception happens when user try to access "aaa_view" but doesn't have permission "aaa" table with apache ranger.

      Caused by: java.lang.RuntimeException: org.apache.hadoop.hive.ql.parse.SemanticException:Got exception though getTableObjectByName method should ignore it
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.walkASTMarkTABREF(SemanticAnalyzer.java:12020)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.rewriteASTWithMaskAndFilter(SemanticAnalyzer.java:12139)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.replaceViewReferenceWithDefinition(SemanticAnalyzer.java:2608)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:2192)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:2103)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:2257)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:2088)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genResolvedParseTree(SemanticAnalyzer.java:12234)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12328)
              at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:367)
              at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:290)
              at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:664)
              at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1870)
              at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1817)
              at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1812)
              at org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:126)
              at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:197)
              ... 26 common frames omitted
      

      In this case, we can't see error log like "permission denied" when user try to access "aaa_view".

      So, it would be nice to add cause

      Attachments

        Activity

          People

            Unassigned Unassigned
            wyukawa Wataru Yukawa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: