Share via

Getting error with Polybase in synapse analytics

Pavankumar-3526 306 Reputation points
2023-02-09T14:02:03.77+00:00

I am getting this error with the polybase but the bulk insert is working fine.

any idea about this error?

PolybaseOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error happened when loading data into SQL Data Warehouse. Operation: 'Polybase operation'.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: HadoopSqlException: String or binary data would be truncated.,Source=.Net SqlClient Data Provider,SqlErrorNumber=107090,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=107090,State=1,Message=HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: HadoopSqlException: String or binary data would be truncated

Azure Synapse Analytics
Azure Synapse Analytics

An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.

0 comments No comments

Answer accepted by question author

Bhargava-MSFT 31,361 Reputation points Microsoft Employee Moderator
2023-02-10T20:53:59.04+00:00

Hello @anonymous,

Welcome to the MS Q&A platform.

String or binary data would be truncated, which generally means a type mismatch between source and target. The max length of the target is less than the actual source data. As a result, data is truncated, returning this error.

Please try the below.

  1. Check the length of actual data in the source and the length of the column in the target table.
  2. The max length of the intermittent external table in polybase(behind the scenes, PolyBase creates an External Table) is nvarchar(4000). Therefore, if the max length of the source column is greater than nvarchar(4000), polybase option can’t be used.

If this is your case, please try to use the bulk insert option, not the polybase or copy into option in copy activity.

User's image

https://learn.microsoft.com/en-us/azure/data-factory/connector-azure-sql-data-warehouse?tabs=data-factory#use-polybase-to-load-data-into-azure-sql-data-warehouse

A similar thread has been discussed here.
I hope this helps. Please let me know if you have any further questions.

If this answers your question, please consider accepting the answer by hitting the Accept answer and up-vote as it helps the community look for answers to similar questions

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.