1

After reading the parquet data as dataframe, it looks as shown in below image:

Click to see the image

But now I want to read the parquet data using hive. I wrote the create table statement as :

CREATE EXTERNAL TABLE test_13102019 (

        `DeviceInfo` STRUCT<
             `name`: STRING,
             `serialNumber`: STRING
        >
) 
STORED as PARQUET
LOCATION 'x/y';

But when I read the data using select * from test_13102019 limit 10;

I get result as null values.

Click to see the image

Please kindly help me with the same.

Keen_Learner
  • 87
  • 1
  • 8
  • I dont see any partition info details for the same. May be that is why you are ending up having null result set. You always need to add a partition key. – Anirudh Dec 16 '19 at 09:15
  • How to add the partition key for the same. Lets say in this case we have 2 columns only, and they random actually. How to do it sir. – Keen_Learner Dec 16 '19 at 09:48
  • This parquet file is a single file at a particular location, I just want to read it. – Keen_Learner Dec 16 '19 at 09:58
  • Ok.. Lets try with this query while creating CREATE EXTERNAL TABLE test_13102019 ( '`name`' STRING, '`serialNumber`' STRING ) LOCATION 'x/y'; – Anirudh Dec 16 '19 at 10:09
  • I can't change the column name that not allowed for my project – Keen_Learner Dec 16 '19 at 10:16

0 Answers0