This is an automated email from the ASF dual-hosted git repository.
sankarh pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-3 by this push:
new b7316374cb3 HIVE-27888: Backport of HIVE-22429, HIVE-14898,
HIVE-22231, HIVE-20507, HIVE-24786 to branch-3 (#4878)
b7316374cb3 is described below
commit b7316374cb35988ebb4bed3c96262b85bba22fc2
Author: Aman Raj <104416558+amanraj2...@users.noreply.github.com>
AuthorDate: Mon Nov 20 17:43:13 2023 +0530
HIVE-27888: Backport of HIVE-22429, HIVE-14898, HIVE-22231, HIVE-20507,
HIVE-24786 to branch-3 (#4878)
* HIVE-22429: Migrated clustered tables using bucketing_version 1 on hive 3
uses bucketing_version 2 for inserts (Ramesh Kumar Thangarajan, reviewed by
Jesus Camacho Rodriguez)
* HIVE-14898: HS2 shouldn't log callstack for an empty auth header error
* HIVE-22231: Hive query with big size via knox fails with Broken pipe
Write failed (Denys Kuzmenko via Peter Vary)
* HIVE-20507: Beeline: Add a utility command to retrieve all uris from
beeline-site.xml
* HIVE-24786: JDBC HttpClient should retry for idempotent and unsent http
methods (#1983)
* HIVE-24786: JDBC HttpClient should retry for idempotent and unsent http
methods
-
Co-authored-by: Ramesh Kumar Thangarajan
Co-authored-by: Daniel Dai
Co-authored-by: denys kuzmenko
Co-authored-by: Vaibhav Gumashta
Co-authored-by: Prasanth Jayachandran
Co-authored-by: Prasanth Jayachandran
-
Signed-off-by: Sankar Hariappan
Closes (#4878)
---
.../src/java/org/apache/hive/beeline/BeeLine.java | 57 ++-
.../java/org/apache/hive/beeline/BeeLineOpts.java | 10 ++
beeline/src/main/resources/BeeLine.properties | 1 +
.../java/org/apache/hive/jdbc/HiveConnection.java | 186 -
jdbc/src/java/org/apache/hive/jdbc/Utils.java | 2 +-
.../apache/hadoop/hive/ql/parse/TezCompiler.java | 3 -
.../ldap/HttpEmptyAuthenticationException.java | 23 +++
.../hive/service/cli/thrift/ThriftHttpServlet.java | 22 ++-
8 files changed, 291 insertions(+), 13 deletions(-)
diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
index 73653d4217e..01adb1e1ff5 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
@@ -65,6 +65,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.ServiceLoader;
@@ -94,6 +95,7 @@ import
org.apache.hive.beeline.hs2connection.HS2ConnectionFileUtils;
import org.apache.hive.beeline.hs2connection.HiveSiteHS2ConnectionFileParser;
import org.apache.hive.beeline.hs2connection.UserHS2ConnectionFileParser;
import org.apache.hive.common.util.ShutdownHookManager;
+import org.apache.hive.jdbc.HiveConnection;
import org.apache.hive.jdbc.JdbcUriParseException;
import org.apache.hive.jdbc.Utils;
import org.apache.hive.jdbc.Utils.JdbcConnectionParams;
@@ -389,6 +391,12 @@ public class BeeLine implements Closeable {
.withLongOpt("help")
.withDescription("Display this message")
.create('h'));
+
+// -getUrlsFromBeelineSite
+options.addOption(OptionBuilder
+.withLongOpt("getUrlsFromBeelineSite")
+.withDescription("Print all urls from beeline-site.xml, if it is
present in the classpath")
+.create());
// Substitution option --hivevar
options.addOption(OptionBuilder
@@ -712,7 +720,7 @@ public class BeeLine implements Closeable {
private boolean isBeeLineOpt(String arg) {
return arg.startsWith("--") && !(HIVE_VAR_PREFIX.equals(arg) ||
(HIVE_CONF_PREFIX.equals(arg))
- || "--help".equals(arg) || PROP_FILE_PREFIX.equals(arg));
+ || "--help".equals(arg) || PROP_FILE_PREFIX.equals(arg) ||
"--getUrlsFromBeelineSite".equals(arg));
}
}
@@ -843,6 +851,12 @@ public class BeeLine implements Closeable {
getOpts().setHelpAsked(true);
return true;
}
+
+if (cl.hasOption("getUrlsFromBeelineSite")) {
+ printBeelineSiteUrls();
+ getOpts().setBeelineSiteUrlsAsked(true);
+ return true;
+}
Properties hiveVars = cl.getOptionProperties("hivevar");
for (String key : hiveVars.stringPropertyNames()) {
@@ -919,6 +933,44 @@ public class BeeLine implements Closeable {
return false;
}
+ private void printBeelineSiteUrls() {
+BeelineSiteParser beelineSiteParser = getUserBeelineSiteParser();
+if (!beelineSiteParser.configExists()) {
+ output("No beeline-site.xml in the path", true);
+}
+if (beelineSiteParser.configExists()) {
+ // Get the named url from user specific config file if present
+