Reply
New Contributor
Posts: 3
Registered: ‎11-17-2017

Error during CREATE KUDU table using IMPALA

[ Edited ]

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

Posts: 394
Topics: 11
Kudos: 60
Solutions: 35
Registered: ‎09-02-2016

Re: Error during CREATE KUDU table using IMPALA

@Saca

 

The following Impala keywords are not supported for Kudu tables:

  • PARTITIONED
  • STORED AS
  • LOCATION
  • ROWFORMAT

Pls refer the link

https://www.cloudera.com/documentation/kudu/0-5-0/topics/kudu_impala.html#concept_r3t_vtz_kt__sectio...

 

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

Champion
Posts: 601
Registered: ‎05-16-2016

Re: Error during CREATE KUDU table using IMPALA

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;
New Contributor
Posts: 3
Registered: ‎11-17-2017

Re: Error during CREATE KUDU table using IMPALA

yes, i am firing this query on impala shell.
New Contributor
Posts: 3
Registered: ‎11-17-2017

Re: Error during CREATE KUDU table using IMPALA

thanks

Highlighted
Champion
Posts: 601
Registered: ‎05-16-2016

Re: Error during CREATE KUDU table using IMPALA

[ Edited ]

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;

 

Announcements