impala3.0版本使用问题解决

在用impala3版本时,出现了几个问题,以下是问题和解决方法:
1.impala执行出现异步的问题
问题:在impala3.0版本时,采用pyhive,impyla,以及hue这些python lib和命令行执行时,会出现异步执行的情况,具体表现如下:
先drop table a,然后再create table a时,发现在执行create table a时显示table a已经存在,其实在pyhive和impyla中已经设置是同步执行了,但是还会有这种问题,通过查询impala3的文档了解到,impala3是自行刷新元数据库,但是刷新元数据库有延迟,如果是执行连续的一系列的sql,且相互关联时,需要设置一个参数

Note: Because this option can introduce a delay after each write operation, if you are running a sequence of CREATE
DATABASE, CREATE TABLE, ALTER TABLE, INSERT, and similar statements within a setup script, to minimize
the overall delay you can enable the SYNC_DDL query option only near the end, before the final DDL statement.

Type: Boolean; recognized values are 1 and 0, or true and false; any other value interpreted as false

Default: false (shown as 0 in output of SET statement)

参数设置如下:

set SYNC_DDL=1;

这样可以保证连续执行的sql是同步执行的;

2.impala3中的decimal版本问题;
在impala3中,默认采用新的版本的decimal版本, 在采用case when时,需要手工指定前后的版本, 如果不一致的话,会出错;

In Impala, two different implementations of DECIMAL types are supported. Starting in Impala 3.0, DECIMAL V2 is
used by default. See DECIMAL Type for detail information.
If you need to continue using the first version of the DECIMAL type for the backward compatibility of your queries,
set the DECIMAL_V2 query option to FALSE:
SET DECIMAL_V2=FALSE;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值