外部表格问题 Synapse

huangapple go评论68阅读模式
英文:

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 编码的字符。

你可以在此处了解有关支持的数据类型的更多信息。

以下是在外部表格中执行选择操作的方法:
外部表格问题 Synapse
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];

外部表格问题 Synapse

或者

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

外部表格问题 Synapse

英文:
  • 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.
外部表格问题 Synapse
SELECT Query:

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

外部表格问题 Synapse

Or

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

外部表格问题 Synapse

huangapple
  • 本文由 发表于 2023年7月6日 18:40:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76627967.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定