Unable to create the external table

MadhuVamsi 32 Reputation points
2022-08-04T17:41:44.563+00:00

Hi team ,

I am unable to create an external table even when I created correct data source and file format , the table is creating but when reading the data facing the error as below -

Msg 107090, Level 16, State 1, Line 23
HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: HadoopSqlException: String or binary data would be truncated.

228246-inkederror-ss-1.jpg

Can some one please help me with the error ,

Thanks in advance

Azure SQL Database
Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
{count} vote

Answer accepted by question author
  1. Alberto Morillo 35,401 Reputation points MVP Volunteer Moderator
    2022-08-04T18:55:39.15+00:00

    You need to create a file format. For example:

    CREATE EXTERNAL FILE FORMAT fmtFile  
    WITH (  
        FORMAT_TYPE = DELIMITEDTEXT,  
        FORMAT_OPTIONS (  
          FIELD_TERMINATOR = ',',  
          STRING_DELIMITER = '"',  
          FIRST_ROW = 2,  
          USE_TYPE_DEFAULT = TRUE,  
          ENCODING = 'UTF8' )  
    );  
    

    Then on the definition of the External table you do the following:

    FILE_FORMAT = fmtFile  
    

1 additional answer

Sort by: Most helpful
  1. Isabellaz-1451 3,616 Reputation points
    2022-08-05T03:05:06.127+00:00

    Hi @MadhuVamsi

    Maybe you need to change the field type as nvarchar(MAX)
    Please refer to this thread to see if field type is correct fit :
    https://learn.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/design-elt-data-loading#define-the-tables

    Best Regards,
    Isabella

    0 comments No comments

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.