Skip to content

Commit

Permalink
fix incorrect row index in MatrixBlockMatrixWriter lowering
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvittal committed Mar 20, 2023
1 parent b1dbae1 commit 58ad36c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hail/src/main/scala/is/hail/expr/ir/MatrixWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1505,12 +1505,12 @@ case class MatrixBlockMatrixWriter(
val rowsInBlockSizeGroups: TableStage = keyedByRowIdx.repartitionNoShuffle(blockSizeGroupsPartitioner)

def createBlockMakingContexts(tablePartsStreamIR: IR): IR = {
flatten(zip2(tablePartsStreamIR, rangeIR(numBlockRows), ArrayZipBehavior.AssertSameLength) { case (tableSinglePartCtx, blockColIdx) =>
flatten(zip2(tablePartsStreamIR, rangeIR(numBlockRows), ArrayZipBehavior.AssertSameLength) { case (tableSinglePartCtx, blockRowIdx) =>
mapIR(rangeIR(I32(numBlockCols))){ blockColIdx =>
MakeStruct(FastIndexedSeq("oldTableCtx" -> tableSinglePartCtx, "blockStart" -> (blockColIdx * I32(blockSize)),
"blockSize" -> If(blockColIdx ceq I32(numBlockCols - 1), I32(lastBlockNumCols), I32(blockSize)),
"blockColIdx" -> blockColIdx,
"blockRowIdx" -> blockColIdx))
"blockRowIdx" -> blockRowIdx))
}
})
}
Expand Down

0 comments on commit 58ad36c

Please sign in to comment.