dtx3006 2016-01-06 17:43
浏览 127
已采纳

Golang:Bigquery在插入之前检查唯一键

I am implementing the insertion to google bigquery using golang. The file has duplicates, and needs to be update everyday. However, the duplicates should not be inserted into the bigquery. I use some apis by google cloud platform and golang. However, I have not found any apis can either check if unique before inserting or setting to unique for specific fields in schema. I am using a wrapper api and calling the function directly. However, the function does not check if the field is unique. Please suggest any bigquery apis for golang has unique key checking or unique key setting to the schema. Much appreciate! I will update replies immediately.

  • 写回答

2条回答 默认 最新

  • duan4523 2016-01-06 18:13
    关注

    In BigQuery, there is no any API or Function to specifically do uniqueness check of given field
    You can meet your requirements by constructing your insert as join of source with destination and insert only unique ones
    This might require you first to insert your data into “temp” table and then do above join in GBQ

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据