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

使用Athena从MongoDB同步数据到QuickSight遇COLUMN_NOT_FOUND错误

解决方案:Athena查询MongoDB新增字段提示COLUMN_NOT_FOUND

问题根源

Athena依赖AWS Glue Data Catalog获取MongoDB(DocDB)表的结构定义。你新增的imageLink字段仅存在于部分Mongo文档中,且未被同步到Glue Data Catalog,因此Athena无法识别该字段;而createdAt能正常使用是因为它从一开始就被包含在Catalog的表结构里。

解决步骤

  • 重新运行Glue Crawler
    找到对应DocDB数据源的Glue Crawler,手动触发一次运行。确保Crawler的「Schema change policy」设置为Update the table definition in the Data Catalog,这样会自动添加新发现的字段,不会覆盖现有表结构。

  • 调整Crawler抽样比例(若首次爬取未检测到字段)
    当新字段仅存在于部分文档时,Crawler默认的抽样规则可能没抽到包含该字段的文档。进入Crawler配置页面,将「Table level configuration」中的抽样比例调高(例如设为100%),再重新运行Crawler。

  • 手动更新Glue表Schema
    如果Crawler仍未识别到imageLink,直接在Glue控制台找到对应的数据表docdb.label_db.labels,进入「编辑表」页面,在Schema区域添加一行:

    • 字段名:imageLink
    • 类型:string
      保存后再执行Athena或QuickSight查询。
  • 验证配置
    在Glue Data Catalog中确认表的Schema已包含imageLink字段后,再回到Athena/QuickSight测试查询是否正常运行。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.20 22:59:57