天天看点

impala常见错误

1、使用insert插入字符串报错

ERROR: AnalysisException: Possible loss of precision for target table 'test.student'.

Expression ''e'' (type: STRING) would need to be cast to VARCHAR(22) for column 'name'

解决办法:

insert into student values(123, CAST('aaa' AS varchar(22)));

字符串转换下:CAST('xxx' AS varchar(12))

2、

E0127 19:28:25.289991 13469 impala-server.cc:339] ERROR: short-circuit local reads is disabled because

 - Impala cannot read or execute the parent directory of dfs.domain.socket.path

 - dfs.client.read.shortcircuit is not enabled.

ERROR: block location tracking is not properly enabled because

 - dfs.client.file-block-storage-locations.timeout is too low. It should be at least 3000.

E0127 19:28:25.290117 13469 impala-server.cc:341] Aborting Impala Server startup due to improper configuration

hdfs的配置文件hdfs-site.xml增加如下内容:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

<

property

>

<

name

>dfs.client.read.shortcircuit</

name

>

<

value

>true</

value

>

</

property

>

<

property

>

<

name

>dfs.domain.socket.path</

name

>

<

value>

/var/hdfs-sockets/dn

</value>   #手动只需要创建

/var/hdfs-sockets目录,dn会自动创建

</

property

>

<

property

>

<

name

>dfs.client.file-block-storage-locations.timeout</

name

>

<

value

>3000</

value

>

</

property

>

<

property

>

<

name

>dfs.datanode.hdfs-blocks-metadata.enabled</

name

>

<

value

>true</

value

>

</

property

>