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 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助