I have this error when i try to execute the query (CREATE) below. Any suggest?
ERROR: -------------------------------------------------------------------------
[sshexec] 2022-08-22 11:48:36: >> Query in errore:
[sshexec] CREATE EXTERNAL TABLE OVCDX
[sshexec] (
[sshexec] `AAA...
[sshexec] 2022-08-22 11:48:36: Errore nel parsare la query:line 26:0 missing EOF at 'SORT' near ')'
QUERY: -------------------------------------------------------------------------
CREATE EXTERNAL TABLE OVCDX
(
`AAA` STRING COMMENT '<KEY>|XA',
`BBB` STRING COMMENT '<KEY>|XB',
`CCC` STRING COMMENT '<KEY>|XC',
`DDD` STRING COMMENT '<KEY>|XD',
`EEE` STRING COMMENT '<KEY>|XE',
`FFF` BIGINT COMMENT 'XF'
)
PARTITIONED BY (
`GGG` STRING COMMENT '<KEY>|XG',
`HHH` STRING COMMENT '<KEY>|XH',
`III` STRING COMMENT '<KEY>|XI',
`JJJ` STRING COMMENT '<KEY>|XJ',
`KKK` STRING COMMENT '<KEY>|XK',
`LLL` STRING COMMENT '<KEY>|XL'
)
SORT BY (
`AAA`,
`BBB`,
`CCC`,
`DDD`,
`EEE`
)
COMMENT 'X_ABCDE'
STORED AS PARQUET;
Thx, Luca
Are you sure you are using the correct syntax in your
CREATE
statement? According to the wiki, theSORT BY
has to be used together with theCLUSTERED BY
, in case it's in aCREATE TABLE
statement:Hive Wiki