cxzl25 opened a new pull request #25722: [SPARK-26598] Fix HiveThriftServer2 cannot be modified hiveconf/hivevar variables URL: https://github.com/apache/spark/pull/25722 ### What changes were proposed in this pull request? The intent to use the --hiveconf/--hivevar parameter is just an initialization value, so setting it once in ```SparkSQLSessionManager#openSession``` is sufficient, and each time the ```SparkExecuteStatementOperation``` setting causes the variable to not be modified. ### Why are the changes needed? It is wrong to set the --hivevar/--hiveconf variable in every ```SparkExecuteStatementOperation```, which prevents variable updates. ### Does this PR introduce any user-facing change? ``` cat <<EOF > test.sql select '\${a}', '\${b}'; set b=bvalue_MOD_VALUE; set b; EOF beeline -u jdbc:hive2://localhost:10000 --hiveconf a=avalue --hivevar b=bvalue -f test.sql ``` current result: ``` +-----------------+-----------------+--+ | avalue | bvalue | +-----------------+-----------------+--+ | avalue | bvalue | +-----------------+-----------------+--+ +-----------------+-----------------+--+ | key | value | +-----------------+-----------------+--+ | b | bvalue | +-----------------+-----------------+--+ 1 row selected (0.022 seconds) ``` after modification: ``` +-----------------+-----------------+--+ | avalue | bvalue | +-----------------+-----------------+--+ | avalue | bvalue | +-----------------+-----------------+--+ +-----------------+-----------------+--+ | key | value | +-----------------+-----------------+--+ | b | bvalue_MOD_VALUE| +-----------------+-----------------+--+ 1 row selected (0.022 seconds) ``` ### How was this patch tested? modified the existing unit test
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
