When I used the Hive dialect to parse the following Hive SQL, I encountered the following error.
CREATE TABLE user_info_bucketed(user_id BIGINT, firstname STRING, lastname STRING)
COMMENT 'A bucketed copy of user_info'
PARTITIONED BY(ds STRING)
CLUSTERED BY(user_id) INTO 256 BUCKETS;
with error
Err(ParserError("Expected: end of statement, found: PARTITIONED at Line: 4, Column: 5"))
Here is the code I tested.
use sqlparser::dialect::HiveDialect;
use sqlparser::parser::Parser;
fn main() {
let query = r#"
CREATE TABLE user_info_bucketed(user_id BIGINT, firstname STRING, lastname STRING)
COMMENT 'A bucketed copy of user_info'
PARTITIONED BY(ds STRING)
CLUSTERED BY(user_id) INTO 256 BUCKETS;"#;
let dialect = HiveDialect {};
let ast = Parser::parse_sql(&dialect, query);
println!("ast={:?}", ast);
}
