• datart导入hive连接包


      datart读取hive数据时,需要先在datart的lib目录下导入hive jdbc相关的包,这里面有几个坑记录下:

    1.和springboot中commons-lang3冲突

    2.hive中带的jetty和springboot冲突

    3.hive jdbc的包的版本号一定要小于登录hive服务端的版本,否则会报Required field ‘client_protocol’ is unset的错误,在引入hive jdbc包的时候,要先查看hive的版本,具体方法:可以找到hive的安装目录 whereis hive,查看hive lib目录下相关包的版本或者执行hive后,通过查看日志得到hive的版本。

    最后在导入包的时候,一个个导比较麻烦,而且针对jar包冲突请求也不好处理,所以新建了个项目将所需的包引入,使用maven-shade-plugin插件进行打包并对冲突了的jar包进行重命名,消除冲突,最后的pom文件如下:

    1. "1.0" encoding="UTF-8"?>
    2. <project xmlns="http://maven.apache.org/POM/4.0.0"
    3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    5. <modelVersion>4.0.0modelVersion>
    6. <groupId>org.examplegroupId>
    7. <artifactId>hive-dependencyartifactId>
    8. <version>1.0-SNAPSHOTversion>
    9. <properties>
    10. <maven.compiler.source>8maven.compiler.source>
    11. <maven.compiler.target>8maven.compiler.target>
    12. <hive.version>1.1.0hive.version>
    13. properties>
    14. <dependencies>
    15. <dependency>
    16. <groupId>org.apache.hivegroupId>
    17. <artifactId>hive-jdbcartifactId>
    18. <version>${hive.version}version>
    19. dependency>
    20. <dependency>
    21. <groupId>org.apache.hadoopgroupId>
    22. <artifactId>hadoop-commonartifactId>
    23. <version>2.6.0version>
    24. dependency>
    25. <dependency>
    26. <groupId>org.apache.hadoopgroupId>
    27. <artifactId>hadoop-clientartifactId>
    28. <version>2.7.1version>
    29. dependency>
    30. <dependency>
    31. <groupId>org.apache.hivegroupId>
    32. <artifactId>hive-execartifactId>
    33. <version>${hive.version}version>
    34. <exclusions>
    35. <exclusion>
    36. <artifactId>commons-lang3artifactId>
    37. <groupId>org.apache.commonsgroupId>
    38. exclusion>
    39. exclusions>
    40. dependency>
    41. dependencies>
    42. <build>
    43. <plugins>
    44. <plugin>
    45. <artifactId>maven-compiler-pluginartifactId>
    46. <configuration>
    47. <source>1.8source>
    48. <target>1.8target>
    49. <encoding>UTF-8encoding>
    50. configuration>
    51. plugin>
    52. <plugin>
    53. <groupId>org.apache.maven.pluginsgroupId>
    54. <artifactId>maven-shade-pluginartifactId>
    55. <version>2.4.3version>
    56. <executions>
    57. <execution>
    58. <phase>packagephase>
    59. <goals>
    60. <goal>shadegoal>
    61. goals>
    62. <configuration>
    63. <filters>
    64. <filter>
    65. <artifact>*:*artifact>
    66. <excludes>
    67. <exclude>META-INF/*.SFexclude>
    68. <exclude>META-INF/*.DSAexclude>
    69. <exclude>META-INF/*.RSAexclude>
    70. <exclude>org/eclipse/*exclude>
    71. excludes>
    72. filter>
    73. filters>
    74. <relocations>
    75. <relocation>
    76. <pattern>org.apache.commons.lang3pattern>
    77. <shadedPattern>org.apache.commons.hive.lang3shadedPattern>
    78. relocation>
    79. <relocation>
    80. <pattern>org.eclipse.jettypattern>
    81. <shadedPattern>org.eclipse.hive.jettyshadedPattern>
    82. relocation>
    83. <relocation>
    84. <pattern>org.mortbaypattern>
    85. <shadedPattern>org.mortbay.hiveshadedPattern>
    86. relocation>
    87. relocations>
    88. configuration>
    89. execution>
    90. executions>
    91. plugin>
    92. plugins>
    93. build>
    94. <repositories>
    95. <repository>
    96. <id>aliyunid>
    97. <name>spring-pluginname>
    98. <url>https://maven.aliyun.com/repository/spring-pluginurl>
    99. <releases>
    100. <enabled>trueenabled>
    101. releases>
    102. <snapshots>
    103. <enabled>falseenabled>
    104. snapshots>
    105. repository>
    106. repositories>
    107. project>

  • 相关阅读:
    box-sizing: border-box;box-sizing:content-box;讲解
    LeetCode235. Lowest Common Ancestor of a Binary Search Tree
    K8S:K8S自动化运维容器
    卡尔曼滤波算法的五大核心公式含义
    使用OpenCV如何确定一个对象的方向
    Win11下无法打开丛林之狐,提示未检测到DirectX 8.1
    Java 实习生(月薪 3k-5k 水平)应具备哪些知识、能力?给学弟学妹们支招
    UE5的引擎初始化流程
    【Go blog】Govulncheck v1.0.0 发布了!
    聊聊HttpClient的重试机制
  • 原文地址:https://blog.csdn.net/Andrew_2018/article/details/133243563