英文:
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'.
英文:
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'.
答案1
得分: 1
- 你收到的错误消息表明,你的外部表格中的 'ASSET_TYPE_CODE' 列的期望数据类型与 Parquet 文件中实际发现的数据类型不匹配。
- Parquet 文件中 'ASSET_TYPE_CODE' 列的数据以字节数组存储,表示 UTF-8 编码的字符。
你可以在此处了解有关支持的数据类型的更多信息。
以下是在外部表格中执行选择操作的方法:
SELECT 查询:
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];
或者
SELECT *
FROM OPENROWSET(
BULK 'https://xxxxx.dfs.core.windows.net/xxxxxx/xxx.Table_asset.parquet',
FORMAT='PARQUET'
) AS [result];
英文:
- 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.
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];
Or
select *
FROM
OPENROWSET(
BULK 'https://xxxxx.dfs.core.windows.net/xxxxxx/xxx.Table_asset.parquet',
FORMAT='PARQUET'
) AS [result];
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论