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

Needs to capture input/output entities in explain

    XMLWordPrintableJSON

    Details

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

      Description

      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);
      sem.validate()
      

      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.
      

        Attachments

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

          Issue Links

            Activity

              People

              • Assignee:
                daijy Jianyong Dai
                Reporter:
                daijy Jianyong Dai
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: