Skip to content
Advertisement

HIVE-SQL_SERVER: HadoopExecutionException: Not enough columns in this line

I have a hive table with the following structure and data:

Table structure:

Trying to push this data into the SQL Server. But while doing so, getting the following error message:

What I tried:

There’s an online article where the author has documented similar kind of issues. I tried to implement one of them Looked in Excel and found two columns that had carriage returns but this also doesn’t come handy.

Any suggestion/help would be really appreciated. Thanks

Advertisement

Answer

If I’m able to understand your issue, then it seems that your , separated data is getting divided into various columns rather one column on the SQL-SERVER, something like:

So, if you look on Hive there are only 5 columns. While on SQL-SERVER the same. This I presume as you haven’t shared the schema. But if that’s the case, then you see that there are more than 5 values are being passed. While the schema definition is only of 5 columns. So the error is populating.

Refer this Document by MS and try to create a FILE_FORMAT with FIELD_TERMINATOR ='t', like:

Hope that helps to resolve to your issue 🙂

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement