Aggarwal-Raghav commented on code in PR #6042:
URL: https://github.com/apache/hive/pull/6042#discussion_r2413709795


##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java:
##########
@@ -6465,6 +6465,21 @@ public List<Function> getFunctionsInDb(String dbName, 
String pattern) throws Hiv
 
   public void setMetaConf(String propName, String propValue) throws 
HiveException {
     try {
+      /*
+       * Updates the 'conf' object with session-level metastore variables
+       * ('metaConfVars'). This object is used to initialize the
+       * Thrift client connection to the Hive Metastore, ensuring that any
+       * session-specific overrides are propagated to the underlying 
connection.
+       *
+       * For reference on how this 'conf' object is consumed, see the client
+       * instantiation logic in:
+       * org.apache.hadoop.hive.ql.metadata.Hive#createMetaStoreClient()
+       */
+      if (Arrays.stream(MetastoreConf.metaConfVars)

Review Comment:
   The updated logic permits only the 'varname' and disallows 'hivename'. For 
example:
   ```
   set metaconf:metastore.try.direct.sql=false; -- this will pass the check
   set metaconf:hive.metastore.try.direct.sql=false; -- this will fail the check
   ```
   **Reason for this change**:
   As conf object is created from HiveConf HS2 side this 
`hive.metastore.try.direct.sql` is present and `set 
metaconf:hive.metastore.try.direct.sql=false` will modify the HS2 conf as well 
resulting in failure of following q files.
   ```
   TestNegativeLlapLocalCliDriver: allow_change_col_type_par_neg.q
   TestMiniLlapLocalCliDriver: allow_change_col_type_par.q
   TestMiniLlapLocalCliDriver: set_metaconf.q 
   ```
   **NOTE**: HS2 side `hive.metastore.try.direct.sql` is marked deprecated and 
used only in test code.
   
   Options:
   1. We can rewrite these q files and their output (q.out) and support both 
varname or hivename.
   2. Only support varname as done in this approach **to keep q files intact** 
but the `set metaconf:hivename=...; ` will not be overlayed on new HMS 
connection. Forcing user to use varname which is better in a way as it isolates 
/shows clear distinction between HiveConf and MetastoreConf.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to