3
votes

i have a parquet file stored in hdfs called small in path:

/user/s/file.parquet

and want to create a table in hive containing it's content.

the schema of the file is very complected and i want hive to automatically import the schema from the file.

i want to do something like this:

CREATE EXTERNAL TABLE tableName
STORED AS PARQUET
LOCATION 'file/path'

is this possible?

thank you for your help.

1

1 Answers

1
votes

Unfortunately it's not possible to create external table on a single file in Hive, just for directories. If /user/s/file.parquet is the only file in the directory you can indicate location as /user/s/ and Hive will catch up your file.