0
votes

I declared column as decimal.The data looks like this.

4500.00
5321.00
532.00

column name : area Decimal(9,2)

but in Hive it shows like this:

NULL NULL

If I declare the column as a string it works fine. But I need it in decimal only.

2

2 Answers

0
votes

I believe this could be problem with the external table's delimiter mismatch.

I hope you might have configured different delimiter rather than the actual delimter exist in the file in case if you are using the external table.

Please try to find the actual delimiter and alter the table using the below command,

alter table <table_name> set SERDEPROPERTIES ('field.delim' = '<actual_delimiter>');

0
votes

In create table statement

for example

CREATE TABLE figure(length DOUBLE, width DOUBLE, area DOUBLE) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS TEXTFILE;

You replace '\t' by actual delimiter from your data file.