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

Needs to capture input/output entities in explain



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.4, 3.1.1, 3.2.0, 4.0.0
    • Component/s: None
    • Labels:
    • Target Version/s:
    • Hadoop Flags:


      With Sentry enabled, commands like explain drop table foo fail with explain drop table foo;

      Error: Error while compiling statement: FAILED: SemanticException No valid privileges
       Required privilege( Table) not available in input privileges
       The required privileges: (state=42000,code=40000)

      Sentry fails to authorize because the ExplainSemanticAnalyzer uses an instance of DDLSemanticAnalyzer to analyze the explain query.

      BaseSemanticAnalyzer sem = SemanticAnalyzerFactory.get(conf, input);
      sem.analyze(input, ctx);

      The inputs/outputs entities for this query are set in the above code. However, these are never set on the instance of ExplainSemanticAnalyzer itself and thus is not propagated into the HookContext in the calling Driver code.

      sem.analyze(tree, ctx); --> this results in calling the above code that uses DDLSA
      hookCtx.update(sem); --> sem is an instance of ExplainSemanticAnalyzer, this code attempts to update the HookContext with the input/output info from ESA which is never set.


        1. HIVE-18778_TestCliDriver.patch
          1.67 MB
          Daniel Dai
        2. HIVE-18778.1.branch-2.patch
          2 kB
          Daniel Dai
        3. HIVE-18778.1.patch
          4 kB
          Daniel Dai
        4. HIVE-18778.10.branch-3.patch
          7.18 MB
          Daniel Dai
        5. HIVE-18778.11.branch-3.1.patch
          6.63 MB
          Daniel Dai
        6. HIVE-18778.11.branch-3.patch
          7.18 MB
          Daniel Dai
        7. HIVE-18778.12.branch-3.1.patch
          7.06 MB
          Daniel Dai
        8. HIVE-18778.2.branch-2.patch
          2 kB
          Daniel Dai
        9. HIVE-18778.2.patch
          4 kB
          Daniel Dai
        10. HIVE-18778.3.branch-2.patch
          2 kB
          Daniel Dai
        11. HIVE-18778.3.patch
          1.34 MB
          Naveen Gangam
        12. HIVE-18778.4.patch
          4 kB
          Daniel Dai
        13. HIVE-18778.5.patch
          5.41 MB
          Daniel Dai
        14. HIVE-18778.6.patch
          5.38 MB
          Daniel Dai
        15. HIVE-18778.7.patch
          7.30 MB
          Daniel Dai
        16. HIVE-18778.8.patch
          7.40 MB
          Daniel Dai
        17. HIVE-18778.9.branch-3.patch
          6.93 MB
          Daniel Dai
        18. HIVE-18778.9.patch
          7.44 MB
          Daniel Dai
        19. HIVE-18778-SparkPositive.patch
          1.24 MB
          Naveen Gangam
        20. HIVE-18788_SparkNegative.patch
          2 kB
          Naveen Gangam
        21. HIVE-18788_SparkPerf.patch
          104 kB
          Naveen Gangam

          Issue Links



              • Assignee:
                daijy Daniel Dai
                daijy Daniel Dai
              • Votes:
                0 Vote for this issue
                6 Start watching this issue


                • Created: