You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Synapse外部表部分列返回空值问题及解决方法

解决Azure Synapse外部表查询Parquet文件时部分列全为空的问题

问题场景

在Azure Synapse中创建外部表后,执行查询发现product_id和location_id列返回全空值,但使用OPENROWSET直接读取同一份Parquet文件时,这两列能返回正确数据。

外部表创建语句

create external table my_table (
    date datetime2,
    product_id varchar(32),
    location_id varchar(32),
    visits int
) with (
    location = 'file.parquet',
    data_source = my_data_source,
    file_format = my_parquet_format
);

OPENROWSET查询语句

select top 100 * from openrowset(
    bulk 'file.parquet',
    data_source = 'my_data_source',
    format='PARQUET'
) as [result];

问题根源

创建外部表时指定的列名与Parquet文件中实际存储的列名不一致,导致Synapse无法正确映射列数据,从而返回空值。

解决步骤

  1. 执行OPENROWSET查询,查看Parquet文件的实际列名和数据结构
  2. 严格匹配Parquet文件的实际列名,重新创建外部表

完成上述操作后,外部表查询即可返回正确的非空数据。

内容的提问来源于stack exchange,提问作者Rob M

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 18:32:41