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

gefragt vor einem Jahr975 Aufrufe
2 Antworten
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
EXPERTE
beantwortet vor einem Jahr
  • 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
SUPPORT-TECHNIKER
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen