不支持Hive方法

编程入门 行业动态 更新时间:2024-10-13 06:18:53
本文介绍了不支持Hive方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图使用Hive作为基础数据存储来运行SQl查询,查询调用Big Decimal函数并引发以下错误:

方法不支持

org.apache.hadoop.hive.jdbc.HivePreparedStatement.setBigDecimal(HivePreparedStatement.java:317) code>

这仅仅是因为Hive不支持如下:

public void setBigDecimal(int parameterIndex,BigDecimal x)throws SQLException { // TODO自动生成的方法存根抛出新的SQLException(Method not supported); }

请提出其他解决方法或修补程序可用于解决此类问题

原文Hive JDBC驱动程序仅支持少数JDBC接口,请参阅 / jira / browse / HIVE-48rel =nofollow> HIVE-48:支持JDBC连接以实现Hive和RDBMS之间的互操作性。因此,提交会留下自动生成的不支持代码,用于像 CallableStatement 或 PreparedStatement 。

使用 HIVE-2158:add基于当前HIVE支持的数据类型的HivePreparedStatement实现部分方法已经充实,请参阅提交。但是没有添加像Blob,AsciiStream,二进制流和... bigDecimal这样的类型。当HIVE-2158得到解决时( 2011-06-15 )在蜂巢中对DECIMAL的支持不在,它附带 HIVE-2693:添加DECIMAL数据类型,于2013-01-17 。在添加对DECIMAL的支持时,看起来像JDBC驱动程序接口未更新。

因此,基本上JDBC驱动程序需要使用支持的新类型进行更新。您应该为此提交 JIRA 。解决方法:不要使用DECIMAL,也不要使用PrepareStatement。

I am trying to run a SQl query using Hive as an underlying data store, the query invokes Big Decimal function and throws the following error :

Method not supported at

org.apache.hadoop.hive.jdbc.HivePreparedStatement.setBigDecimal(HivePreparedStatement.java:317)

That is simply because Hive does not support as follows :

public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Method not supported"); }

Please suggest what can be other workarounds or fixes available to counter such an issue

解决方案

The original Hive JDBC driver only supported few of the JDBC interfaces, see HIVE-48: Support JDBC connections for interoperability between Hive and RDBMS. So the commit left auto-generated "not supported" code for interfaces like CallableStatement or PreparedStatement.

With HIVE-2158: add the HivePreparedStatement implementation based on current HIVE supported data-type some of the methods were fleshed out, see the commit. But types like Blob, AsciiStream, binary stream and ... bigDecimal were not added. When HIVE-2158 was resolved (2011-06-15) the support for DECIMAL in Hive was not in, it came with HIVE-2693: Add DECIMAL data type, on 2013-01-17. When support for DECIMAL was added, looks like the JDBC driver interface was not updated.

So basically the JDBC driver needs to be updated with the new types supported. You should file a JIRA for this. Workaround: don't use DECIMAL, or don't use PrepareStatement.

更多推荐

不支持Hive方法

本文发布于:2023-06-11 00:13:07,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不支持   方法   Hive

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!