From b5c84f8051cd189e55f8c43ee2b9cc3f3a75e353 Mon Sep 17 00:00:00 2001 From: Sanjay Vasandani Date: Thu, 17 Oct 2024 11:10:08 -0700 Subject: [PATCH] fix!: Ensure that MeasurementIndexShardId is non-negative (#1863) BREAKING CHANGE: This is updating an existing Liquibase changeset, and will therefore require manual adjustments wherever it has been rolled out. This should only have rolled out to Halo test environments. Closes #1862 --- .../spanner/shard-measurements-by-continuation-token.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql b/src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql index c958f8b1835..aa9863a0fac 100644 --- a/src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql +++ b/src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql @@ -21,7 +21,7 @@ START BATCH DDL; ALTER TABLE Measurements ADD COLUMN MeasurementIndexShardId INT64 NOT NULL AS ( - MOD(FARM_FINGERPRINT(CAST(MeasurementId AS STRING)), 64) + ABS(MOD(FARM_FINGERPRINT(CAST(MeasurementId AS STRING)), 64)) ) STORED; DROP INDEX MeasurementsByContinuationToken;