This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new d60de1fac30 HIVE-27714: Addendum: Iceberg: metadata location overrides
can cause data breach - handling default locations. (#4921). (Ayush Saxena,
reviewed by Sourabh Badhya)
d60de1fac30 is described below
commit d60de1fac30d0d11783ade6e0b101a59c8ce80da
Author: Ayush Saxena <[email protected]>
AuthorDate: Thu Dec 7 10:46:59 2023 +0530
HIVE-27714: Addendum: Iceberg: metadata location overrides can cause data
breach - handling default locations. (#4921). (Ayush Saxena, reviewed by
Sourabh Badhya)
---
.../java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java | 2 +-
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java | 3 +--
ql/src/java/org/apache/hadoop/hive/ql/session/SessionStateUtil.java | 1 +
.../org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java | 2 --
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git
a/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
b/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
index e3336437c77..8cfbf66240b 100644
---
a/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
+++
b/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
@@ -1092,7 +1092,7 @@ public class HiveIcebergStorageHandler implements
HiveStoragePredicateHandler, H
String getPathForAuth(String locationProperty) {
return getPathForAuth(locationProperty,
- SessionStateUtil.getProperty(conf,
hive_metastoreConstants.DEFAULT_TABLE_LOCATION).orElse(null));
+ SessionStateUtil.getProperty(conf,
SessionStateUtil.DEFAULT_TABLE_LOCATION).orElse(null));
}
String getPathForAuth(String locationProperty, String defaultTableLocation) {
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 8cdba7fd8df..0823b6d9ba4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -25,7 +25,6 @@ import static
org.apache.hadoop.hive.conf.HiveConf.ConfVars.DYNAMICPARTITIONCONV
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVEARCHIVEENABLED;
import static
org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_DEFAULT_STORAGE_HANDLER;
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVESTATSDBCLASS;
-import static
org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.DEFAULT_TABLE_LOCATION;
import static
org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_LOCATION;
import static
org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_STORAGE;
import static
org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.TABLE_IS_CTAS;
@@ -13803,7 +13802,7 @@ public class SemanticAnalyzer extends
BaseSemanticAnalyzer {
}
if (isIcebergTable(retValue)) {
- SessionStateUtil.addResourceOrThrow(conf,
hive_metastoreConstants.DEFAULT_TABLE_LOCATION,
+ SessionStateUtil.addResourceOrThrow(conf,
SessionStateUtil.DEFAULT_TABLE_LOCATION,
getDefaultLocation(qualifiedTabName[0], qualifiedTabName[1], true));
}
return retValue;
diff --git
a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionStateUtil.java
b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionStateUtil.java
index f831f0920b6..0009a54c3a3 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionStateUtil.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionStateUtil.java
@@ -31,6 +31,7 @@ public class SessionStateUtil {
private static final Logger LOG =
LoggerFactory.getLogger(SessionStateUtil.class);
private static final String COMMIT_INFO_PREFIX = "COMMIT_INFO.";
+ public static final String DEFAULT_TABLE_LOCATION = "defaultLocation";
private SessionStateUtil() {
diff --git
a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java
b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java
index 776683b882f..f5a102ab964 100644
---
a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java
+++
b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java
@@ -97,6 +97,4 @@ package org.apache.hadoop.hive.metastore.api;
public static final java.lang.String EXPECTED_PARAMETER_VALUE =
"expected_parameter_value";
- public static final java.lang.String DEFAULT_TABLE_LOCATION =
"defaultLocation";
-
}