You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ng...@apache.org on 2022/02/24 18:14:27 UTC

[hive] branch master updated: HIVE-25750: [standalone beeline] Fixing the bug in HIVE-24348.(Abhay Chennagiri via Naveen Gangam) Resolved the issues with the file mode on. No dependency on JobConf

This is an automated email from the ASF dual-hosted git repository.

ngangam pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new fe14d02  HIVE-25750: [standalone beeline] Fixing the bug in HIVE-24348.(Abhay Chennagiri via Naveen Gangam) Resolved the issues with the file mode on. No dependency on JobConf
fe14d02 is described below

commit fe14d020470b8494f01ab28afad8ff9abfee0665
Author: Abhay Chennagiri <ac...@cloudera.com>
AuthorDate: Mon Nov 29 09:49:45 2021 -0800

    HIVE-25750: [standalone beeline] Fixing the bug in HIVE-24348.(Abhay Chennagiri via Naveen Gangam)
    Resolved the issues with the file mode on. No dependency on JobConf
---
 beeline/pom.xml                                    | 47 ++++++++++++++++++++++
 .../src/java/org/apache/hive/beeline/BeeLine.java  |  3 +-
 packaging/src/main/assembly/beeline.xml            | 11 ++++-
 3 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/beeline/pom.xml b/beeline/pom.xml
index 131a3f6..c5cac43 100644
--- a/beeline/pom.xml
+++ b/beeline/pom.xml
@@ -226,6 +226,53 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <descriptorRefs>
+                <descriptorRef>jar-with-dependencies</descriptorRef>
+              </descriptorRefs>
+              <finalName>jar-with-dependencies</finalName>
+              <transformers>
+                <transformer implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer" />
+                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <mainClass>org.openjdk.jmh.Main</mainClass>
+                </transformer>
+              </transformers>
+              <filters>
+                <filter>
+                  <!--
+                  Shading signed JARs will fail without this.
+                  http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
+                  -->
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>com.github.edwgiz</groupId>
+            <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
+            <version>2.1</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+
+
     </plugins>
   </build>
 </project>
diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
index 28b5caa..49b5fad 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
@@ -86,6 +86,7 @@ import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.hive.conf.Constants;
@@ -1340,7 +1341,7 @@ public class BeeLine implements Closeable {
       } else {
         org.apache.hadoop.fs.Path path = new org.apache.hadoop.fs.Path(fileName);
         FileSystem fs;
-        HiveConf conf = new HiveConf();
+        Configuration conf = new Configuration();
         if (!path.toUri().isAbsolute()) {
           fs = FileSystem.getLocal(conf);
           path = fs.makeQualified(path);
diff --git a/packaging/src/main/assembly/beeline.xml b/packaging/src/main/assembly/beeline.xml
index f86f57b..d18e327 100644
--- a/packaging/src/main/assembly/beeline.xml
+++ b/packaging/src/main/assembly/beeline.xml
@@ -73,6 +73,15 @@
             </includes>
             <outputDirectory>/</outputDirectory>
         </fileSet>
+
+        <fileSet>
+            <fileMode>755</fileMode>
+            <directory>${project.parent.basedir}/beeline/target</directory>
+            <outputDirectory>lib</outputDirectory>
+            <includes>
+                <include>original-jar-with-dependencies.jar</include>
+            </includes>
+        </fileSet>
     </fileSets>
 
-</assembly>
\ No newline at end of file
+</assembly>