aliyun-tablestore-go-sdk icon indicating copy to clipboard operation
aliyun-tablestore-go-sdk copied to clipboard

table update hit 'OTSParameterInvalid TimeToLive cannot be 0 or less than -1.' issue

Open zzxwill opened this issue 6 years ago • 4 comments

I tried to update MaxVersion without changing TimeToLive's value, but it hit 'OTSParameterInvalid TimeToLive cannot be 0 or less than -1.' issue with the code below.

	fmt.Println("UpdateTableSample started")
	updateTableReq := new(tablestore.UpdateTableRequest)
	updateTableReq.TableName = tableName
	updateTableReq.TableOption = new(tablestore.TableOption)
	updateTableReq.TableOption.MaxVersion = 5

	_, err := client.UpdateTable(updateTableReq)

zzxwill avatar Apr 10 '18 12:04 zzxwill

type StreamSpecification struct { EnableStream bool ExpirationTime int32 // must be positive. in hours }

type ReservedThroughput struct { Readcap, Writecap int }

type TableOption struct { TimeToAlive, MaxVersion int }

这三个结构应该在encode的时候做一下判断,当值‘’合法‘’时才序列化

red-chen avatar Apr 11 '18 08:04 red-chen

是指sdk需要优化吗?

zzxwill avatar Apr 11 '18 12:04 zzxwill

是的,需要SDK优化一下

red-chen avatar Apr 16 '18 12:04 red-chen

Thanks.

zzxwill avatar Apr 18 '18 13:04 zzxwill