简体   繁体   English

删除Hive UDF中的无用依赖项

[英]Remove useless dependencies in Hive UDF

I'm writing a set of User Defined Functions (UDF) for Hive in a Java Maven project. 我正在Java Maven项目中为Hive编写一组用户定义函数(UDF)。

I'm using maven assembly plugin to generate an uber-jar. 我正在使用maven程序集插件生成一个超级jar。 However, I'm also including tons of dependencies I'm sure hive already has on it's classpath, SLF4j for instance. 但是,我还包括很多依赖项,我确定hive已经在它的类路径上,例如SLF4j。

Is there a simple way (tool) to know what's already on the hive classpath ? 是否有一种简单的方法(工具)来了解蜂巢类路径中已有的内容? I'm using HDP 2.2 from Horton Works 我正在使用Horton Works的HDP 2.2

dependency:analyze in Maven Dependency Plugin will help. 依赖:在Maven Dependency Plugin中分析会有所帮助。

dependency:analyze analyzes the dependencies of this project and determines which are: used and declared; dependency:analyze分析这个项目的依赖关系,并确定哪些是:used和声明的; used and undeclared; 使用和未声明; unused and declared. 未使用和声明。

dependency:analyze 依赖性:分析

dependency:tree is another thing that might help. 依赖:树是另一个可能有用的东西。 This has tools to allow you to do the analysis yourself. 这有工具可以让您自己进行分析。

dependency:tree displays the dependency tree for this project. dependency:tree显示该项目的依赖关系树。

dependency:tree 依赖性:树

The Query to get a list of all jars that are included in the ClassPath of Hive is: 获取Hive的ClassPath中包含的所有jar的列表的Query是:

hive> list jars;

The output will look like 输出看起来像

file:/usr/local/…..*.jar
/usr/local/…..*.jar

The jar location with file: prefix is the one which was available in the ClassPath by default. 带有file:前缀的jar位置是默认情况下ClassPath中可用的位置。 The others were added explicitly by users using the add jar command. 其他用户使用add jar命令显式添加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM