Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

Error during CREATE KUDU table using IMPALA

Error during CREATE KUDU table using IMPALA

New Contributor

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

5 REPLIES 5

Re: Error during CREATE KUDU table using IMPALA

Champion

@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

Re: Error during CREATE KUDU table using IMPALA

New Contributor

thanks

Re: Error during CREATE KUDU table using IMPALA

Champion

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;

Re: Error during CREATE KUDU table using IMPALA

New Contributor
yes, i am firing this query on impala shell.

Re: Error during CREATE KUDU table using IMPALA

Champion

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;