Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13.0
    • Component/s: Authorization
    • Labels:
      None

      Description

      The username of the user of hiveserver2 client should be passed to SessionState, to be used by SQL Standard authorization.

      1. HIVE-6478.1.patch
        20 kB
        Thejas M Nair
      2. HIVE-6478.2.patch
        21 kB
        Thejas M Nair

        Issue Links

          Activity

          Hide
          Thejas M Nair added a comment - - edited

          There are two changes
          1. Pass username when SessionState is created from HiveSessionImpl.
          2. Pass HiveConf from SessionManager to HiveSessionImplwithUGI/HiveSessionImpl, and in HiveSessionImplwithUGI/HiveSessionImpl to create a HiveConf that is a copy of the passed HiveConf. This was made to be able to test the SQL std auth with HS2 properly. This will help in general with testing and with embedded HS2, as you want to be able to set the default configuration for a session. This is not an issue with standalone HS2 as HiveSessionImpl as both HS2 configuration and HiveSessionImpl would pick conf from hive-site.xml . See the new TestMiniHS2 test for example of use case.

          Show
          Thejas M Nair added a comment - - edited There are two changes 1. Pass username when SessionState is created from HiveSessionImpl. 2. Pass HiveConf from SessionManager to HiveSessionImplwithUGI/HiveSessionImpl, and in HiveSessionImplwithUGI/HiveSessionImpl to create a HiveConf that is a copy of the passed HiveConf. This was made to be able to test the SQL std auth with HS2 properly. This will help in general with testing and with embedded HS2, as you want to be able to set the default configuration for a session. This is not an issue with standalone HS2 as HiveSessionImpl as both HS2 configuration and HiveSessionImpl would pick conf from hive-site.xml . See the new TestMiniHS2 test for example of use case.
          Hide
          Ashutosh Chauhan added a comment -

          +1

          Show
          Ashutosh Chauhan added a comment - +1
          Hide
          Hive QA added a comment -

          Overall: -1 at least one tests failed

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12630205/HIVE-6478.1.patch

          ERROR: -1 due to 1 failed/errored test(s), 5177 tests executed
          Failed tests:

          org.apache.hadoop.hive.ql.parse.authorization.TestSessionUserName.testSessionConstructorUser
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1454/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1454/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          Tests exited with: TestsFailedException: 1 tests failed
          

          This message is automatically generated.

          ATTACHMENT ID: 12630205

          Show
          Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12630205/HIVE-6478.1.patch ERROR: -1 due to 1 failed/errored test(s), 5177 tests executed Failed tests: org.apache.hadoop.hive.ql.parse.authorization.TestSessionUserName.testSessionConstructorUser Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1454/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1454/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 1 tests failed This message is automatically generated. ATTACHMENT ID: 12630205
          Hide
          Thejas M Nair added a comment -

          HIVE-6478.2.patch - minor update to fix testcase. The HIVE_AUTHENTICATOR_MANAGER config parameter needs to be explicitly set .

          Show
          Thejas M Nair added a comment - HIVE-6478 .2.patch - minor update to fix testcase. The HIVE_AUTHENTICATOR_MANAGER config parameter needs to be explicitly set .
          Hide
          Thejas M Nair added a comment -

          Calling the rb link "review board link" instead of the jira num!

          Show
          Thejas M Nair added a comment - Calling the rb link "review board link" instead of the jira num!
          Hide
          Ashutosh Chauhan added a comment -

          +1 for .2 patch

          Show
          Ashutosh Chauhan added a comment - +1 for .2 patch
          Hide
          Thejas M Nair added a comment -

          The .2 patch only involves a small change to a test case. I have verified that that test passes. I don't think we need to to run the whole unit test suite on the .2 patch again. I will commit it after a couple of hours.

          Show
          Thejas M Nair added a comment - The .2 patch only involves a small change to a test case. I have verified that that test passes. I don't think we need to to run the whole unit test suite on the .2 patch again. I will commit it after a couple of hours.
          Hide
          Thejas M Nair added a comment -

          Patch committed to trunk. Thanks for the review Ashutosh!

          Show
          Thejas M Nair added a comment - Patch committed to trunk. Thanks for the review Ashutosh!

            People

            • Assignee:
              Thejas M Nair
              Reporter:
              Thejas M Nair
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development