IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    A strange error in BigQuery

    RobinDong发表于 2022-09-15 08:08:59
    love 0

    Two days ago we met a weird error when running a select through BigQuery Python API:

    Error : google.api_core.exceptions.BadRequest: 400 Bad int64 value: BA1D

    I checked the select SQL but it doesn’t contain any type like “int64”.

    After “binary search” in the SQL code, I finally found out that the SQL is actually querying a “view” and the code of this view is like:

    SELECT
      cast(col1, int64) AS COL1,
      cast(col2, int64) AS COL2,
    FROM
      table1

    The correct solution is to change “cast” to “safe_cast”.

    Here is the lesson for me: some errors may occur not only in the direct SQL code but in some indirect views…



沪ICP备19023445号-2号
友情链接