Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I create external tables with Hive?

This is the script I run on Hive:

CREATE EXTERNAL TABLE 'people'(
    'name' string,
    'surname' string,
    'age' string)
ROW FORMAT SERDE
    'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
STORED AS INPUTFORMAT
    'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
OUTPUTFORMAT
    'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
LOCATION
    'gs://directory/subdirectory/'
TBLPROPERTIES (
    'avro.schema.url'='gs://directory/schema.avsc',
    'transient_lastDdlTime'='1644235388');

I get this error:
Error while compiling statement:

FAILED: ParseException line 1:22 cannot recognize input near ”people” ‘(‘ ”nam” in table name

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

could you pls enclose them with backtick( `)

CREATE EXTERNAL TABLE `people`(
    `name` string,
    `surname` string,
    `age` string)
...
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading