Created on 11-17-2017 04:15 AM - edited 09-16-2022 05:32 AM
Hi All,
Can anybudy help me in the below.
While creating kudu table i am facing below syntax problem
i am currently using impala version:impalad version 2.3.0-cdh5.5.1 RELEASE
> CREATE TABLE foo1 (
> id INT PRIMARY KEY,
> col1 STRING,
> col2 STRING
> )
> PARTITION BY HASH(id) PARTITIONS 3
> STORED AS KUDU;
Query: create TABLE foo1 (
id INT PRIMARY KEY,
col1 STRING,
col2 STRING
)
PARTITION BY HASH(id) PARTITIONS 3
STORED AS KUDU
ERROR: AnalysisException: Syntax error in line 2:
id INT PRIMARY KEY,
^
Encountered: IDENTIFIER
Expected: COMMENT, INTERMEDIATE, LOCATION, COMMA
CAUSED BY: Exception: Syntax error
Created 11-17-2017 07:04 AM
The following Impala keywords are not supported for Kudu tables:
Pls refer the link
To create table from impala
https://www.cloudera.com/documentation/kudu/0-5-0/topics/kudu_impala.html#concept_g51_5vk_ft
Please make sure to meet the pre-request
Created 11-20-2017 01:11 AM
thanks
Created 11-18-2017 09:57 AM
were are you firing this query ? beeline or impala shell .
just dumb question but i am asking you anyways
your syntax is correct could be some editor issue or space.
try the below format
CREATE TABLE foo1 (id INT PRIMARY KEY, col1 STRING ,col2 STRING ) PARTITION BY HASH(id) PARTITIONS 3 STORED AS KUDU;
Created 11-19-2017 08:50 PM
Created on 11-27-2017 08:12 PM - edited 11-27-2017 08:16 PM
below is the example let me know if that works for you.
You can use Range or hash partition , also we can perform Range as well as hash partition together or just hash partition by using bucket .
Below is the table that has primary key that coloum id we are using for partition (that is a good practice )
CREATE TABLE customersDetails ( state STRING, PRIMARY KEY (state, name) ) PARTITION BY RANGE (state) ( PARTITION VALUE = 'al', PARTITION VALUE = 'ak', PARTITION VALUE = 'wv', PARTITION VALUE = 'wy' ) STORED AS KUDU;