Skip to content

Commit

Permalink
Merge pull request #1135 from cashapp/sumair/7aug2019/fix_bulk_shard_…
Browse files Browse the repository at this point in the history
…migrator_ids

Cast ids to misk.hibernate.Id instead of Long in BulkShardMigrator
  • Loading branch information
surrahman committed Aug 7, 2019
2 parents 4ee2b86 + 214fbcc commit 2c3abf2
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -206,10 +206,9 @@ class BulkShardMigrator<R : DbRoot<R>, C : DbChild<R, C>> private constructor(
"SELECT id FROM $tableName WHERE $rootColumnName = :target AND id IN (:ids)"
).setParameter("target", targetRoot!!.id)
.setParameterList("ids", sourceRecords.keys)
.list()
.stream()
.map { it as Long }
.collect(Collectors.toSet<Long>())
.resultList
.map { (it as Id<*>).id }
.toSet()

logger.info(
"Bulk migrating (distinct shard) ${sourceRecords.size} entities for table $tableName"
Expand Down

0 comments on commit 2c3abf2

Please sign in to comment.