Dev
Dev

Reputation: 71

Synapse External table issue

I have this error yhen i do a select in a external table (it's ok when i see the data review debug result in the dataflow synapse) error : Column 'ASSET_TYPE_CODE' of type 'INT' is not compatible with external data type 'Parquet physical type: BYTE_ARRAY, logical type: UTF8', please try with 'VARCHAR(8000)'. File/External table name: 'refine_table.FOREX_EOD'.

Upvotes: 0

Views: 2467

Answers (1)

  • The error message you received indicates that there is a mismatch between the expected data type of the 'ASSET_TYPE_CODE' column in your external table and the actual data type found in the Parquet file.
  • The data in the Parquet file for the 'ASSET_TYPE_CODE' column is stored as a byte array representing UTF-8 encoded characters.

Here you can find more about types supported.

Here is how you can do a select in a external table. enter image description here SELECT Query:

SELECT  CAST(ASSET_TYPE_CODE AS  VARCHAR(8000)) AS ASSET_TYPE_CODE, OTHER_COLUMN_1, OTHER_COLUMN_2
FROM
OPENROWSET(
BULK  'https://<xxxxxxxx>.xxxx.core.windows.net/xxxxx/xxx.Table_asset.parquet',
FORMAT='PARQUET'
) AS [result];

enter image description here

Or

select  *
FROM
OPENROWSET(
BULK  'https://xxxxx.dfs.core.windows.net/xxxxxx/xxx.Table_asset.parquet',
FORMAT='PARQUET'
) AS [result];

enter image description here

Upvotes: 1

Related Questions