FAQ
Repository: hive
Updated Branches:
   refs/heads/master cb42b090e -> fb5b0955c


HIVE-10465 : whitelist restrictions don't get initialized in new copy of HiveConf (Thejas Nair, reviewed by Daniel Dai)


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

Branch: refs/heads/master
Commit: fb5b0955caf8f320cbe68ccfa68bb037888c9a40
Parents: cb42b09
Author: Thejas Nair <thejas@hortonworks.com>
Authored: Mon Apr 27 13:38:32 2015 -0700
Committer: Thejas Nair <thejas@hortonworks.com>
Committed: Mon Apr 27 13:38:32 2015 -0700

----------------------------------------------------------------------
  .../org/apache/hadoop/hive/conf/HiveConf.java | 1 +
  .../TestJdbcWithSQLAuthorization.java | 25 ++++++++++++++++++++
  2 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fb5b0955/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
----------------------------------------------------------------------
diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index c9ee423..b713bc9 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -2610,6 +2610,7 @@ public class HiveConf extends Configuration {
      auxJars = other.auxJars;
      origProp = (Properties)other.origProp.clone();
      restrictList.addAll(other.restrictList);
+ modWhiteListPattern = other.modWhiteListPattern;
    }

    public Properties getAllProperties() {

http://git-wip-us.apache.org/repos/asf/hive/blob/fb5b0955/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
----------------------------------------------------------------------
diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
index 6f1a8b2..bd0ba0e 100644
--- a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
+++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
@@ -175,4 +175,29 @@ public class TestJdbcWithSQLAuthorization {
      fail("Message [" + message + "] does not contain substring [" + expectedSubString + "]");
    }

+ @Test
+ public void testConfigWhiteList() throws Exception {
+
+ // create tables as user1
+ Connection hs2Conn = getConnection("user1");
+
+ Statement stmt = hs2Conn.createStatement();
+ try {
+ stmt.execute("set hive.metastore.uris=x");
+ fail("exception expected");
+ } catch (SQLException e) {
+ String msg = "Cannot modify hive.metastore.uris at runtime. "
+ + "It is not in list of params that are allowed to be modified at runtime";
+ assertTrue(e.getMessage().contains(msg));
+ }
+
+ stmt.execute("set hive.exec.reducers.bytes.per.reducer=10000");
+ //no exception should be thrown
+
+ stmt.close();
+ hs2Conn.close();
+ }
+
+
+
  }

Search Discussions

  • Thejas at Apr 27, 2015 at 8:39 pm
    Repository: hive
    Updated Branches:
       refs/heads/branch-1.2 4f3adbc71 -> a58fa6d19


    HIVE-10465 : whitelist restrictions don't get initialized in new copy of HiveConf (Thejas Nair, reviewed by Daniel Dai)


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

    Branch: refs/heads/branch-1.2
    Commit: a58fa6d191a6baed02a63d0ed0335f90c66a7d28
    Parents: 4f3adbc
    Author: Thejas Nair <thejas@hortonworks.com>
    Authored: Mon Apr 27 13:38:32 2015 -0700
    Committer: Thejas Nair <thejas@hortonworks.com>
    Committed: Mon Apr 27 13:38:56 2015 -0700

    ----------------------------------------------------------------------
      .../org/apache/hadoop/hive/conf/HiveConf.java | 1 +
      .../TestJdbcWithSQLAuthorization.java | 25 ++++++++++++++++++++
      2 files changed, 26 insertions(+)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/hive/blob/a58fa6d1/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    ----------------------------------------------------------------------
    diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    index c9ee423..b713bc9 100644
    --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    @@ -2610,6 +2610,7 @@ public class HiveConf extends Configuration {
          auxJars = other.auxJars;
          origProp = (Properties)other.origProp.clone();
          restrictList.addAll(other.restrictList);
    + modWhiteListPattern = other.modWhiteListPattern;
        }

        public Properties getAllProperties() {

    http://git-wip-us.apache.org/repos/asf/hive/blob/a58fa6d1/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
    ----------------------------------------------------------------------
    diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
    index 6f1a8b2..bd0ba0e 100644
    --- a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
    +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java
    @@ -175,4 +175,29 @@ public class TestJdbcWithSQLAuthorization {
          fail("Message [" + message + "] does not contain substring [" + expectedSubString + "]");
        }

    + @Test
    + public void testConfigWhiteList() throws Exception {
    +
    + // create tables as user1
    + Connection hs2Conn = getConnection("user1");
    +
    + Statement stmt = hs2Conn.createStatement();
    + try {
    + stmt.execute("set hive.metastore.uris=x");
    + fail("exception expected");
    + } catch (SQLException e) {
    + String msg = "Cannot modify hive.metastore.uris at runtime. "
    + + "It is not in list of params that are allowed to be modified at runtime";
    + assertTrue(e.getMessage().contains(msg));
    + }
    +
    + stmt.execute("set hive.exec.reducers.bytes.per.reducer=10000");
    + //no exception should be thrown
    +
    + stmt.close();
    + hs2Conn.close();
    + }
    +
    +
    +
      }

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedApr 27, '15 at 8:38p
activeApr 27, '15 at 8:39p
posts2
users1
websitehive.apache.org

1 user in discussion

Thejas: 2 posts

People

Translate

site design / logo © 2021 Grokbase