Yohahaha commented on code in PR #2987:
URL: https://github.com/apache/fluss/pull/2987#discussion_r3043423544


##########
fluss-spark/fluss-spark-common/src/main/scala/org/apache/fluss/spark/utils/LogChangesIterator.scala:
##########
@@ -48,10 +48,15 @@ case class LogChangesIterator(
     comparator: Comparator[InternalRow]
 ) extends CloseableIterator[KeyValueRow] {
 
+  private val projectRow1 = ProjectedRow.from(pkProjection)
+  private val projectRow2 = ProjectedRow.from(pkProjection)
+
   // Sort the records by primary key and then by offset
   private val sortedLogRecords = logRecords.sortWith {
     case (record1, record2) =>
-      val keyComparison = comparator.compare(record1.getRow, record2.getRow)
+      val keyComparison = comparator.compare(

Review Comment:
   SortMergeReader compare row with pk, but here compare with full row, so ut 
failed when pk col was not at begining.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to