HIVE_BAD_DATA: Error Parsing a column in the table: empty String

0

I have an error in athena when select double item.(only a specific field) at some date, there's no error but most of dates I got the error.

HIVE_BAD_DATA: Error Parsing a column in the table: empty String

I migrated data using appflow and cralwed as table using aws glue. please let me know the reason of this error and how to solve it

已提问 1 年前975 查看次数
2 回答
0

as an example if you have a column defined as a "double" in the schema but there's a record in your data that's an empty string, you'll get this error.

to solve this

Check Your Data Check Your Schema

or you can try another SQL server to remove spaces or other irrelevant data from the imported data

SELECT CASE 
    WHEN trim(column_name)='' THEN null 
    ELSE cast(column_name as double) 
    END as column_name
FROM table_name
profile picture
专家
已回答 1 年前
  • Thank you for the answer:) I tried this but I got an error because trim cannot be applied to double.

0

Such error can occur when the table column with "double" data type is having an empty record value in it. Validate your data of the impacted column and replace the empty records with 0 or NULL using SQL statement syntax supported by Presto. Else, if possible you can also try changing the data type of the columns. Similar issues are highlighted in AWS knowledge center article 1 and article 2 also.

AWS
支持工程师
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容