Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

批量写入时设置了SetReturnPk并没有返回主键 #86

Open
lhlyu opened this issue Oct 17, 2021 · 0 comments
Open

批量写入时设置了SetReturnPk并没有返回主键 #86

lhlyu opened this issue Oct 17, 2021 · 0 comments

Comments

@lhlyu
Copy link

lhlyu commented Oct 17, 2021

  • go版本: 1.17
  • sdk版本: v5.0.6
  • 代码如下
batchWriteReq := &tablestore.BatchWriteRowRequest{}

for _, data := range datas {
      putRowChange := new(tablestore.PutRowChange)
      putRowChange.TableName = table_im_user_pool
      putPk := new(tablestore.PrimaryKey)
      putPk.AddPrimaryKeyColumn("pk1", "xxxx")
      putPk.AddPrimaryKeyColumnWithAutoIncrement("pk2")
      putRowChange.PrimaryKey = putPk
      putRowChange.AddColumn("col", "xxxxx")
      putRowChange.SetCondition(tablestore.RowExistenceExpectation_IGNORE)
      // 这里设置了
      putRowChange.SetReturnPk()
      batchWriteReq.AddRowChange(putRowChange)
}

// resp内并没有返回主键
resp, err := client.BatchWriteRow(batchWriteReq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant