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

demandé il y a un an975 vues
2 réponses
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
EXPERT
répondu il y a un an
  • 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
INGÉNIEUR EN ASSISTANCE TECHNIQUE
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions