rahil-c commented on code in PR #17904:
URL: https://github.com/apache/hudi/pull/17904#discussion_r2757363751
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/lance/SparkLanceReaderBase.scala:
##########
@@ -133,12 +147,19 @@ class SparkLanceReaderBase(enableVectorizedReader:
Boolean) extends SparkColumna
// Append partition values to each row using JoinedRow, then convert
to UnsafeRow
val joinedRow = new JoinedRow()
- iter.map(row => unsafeProjection(joinedRow(row,
file.partitionValues)))
+ projectedIter.map(row => unsafeProjection(joinedRow(row,
file.partitionValues)))
}
} catch {
case e: Exception =>
- allocator.close()
+ // Only clean up if listener wasn't registered
+ if (!cleanupRegistered) {
Review Comment:
Let me simplify
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/lance/SparkLanceReaderBase.scala:
##########
@@ -133,12 +147,19 @@ class SparkLanceReaderBase(enableVectorizedReader:
Boolean) extends SparkColumna
// Append partition values to each row using JoinedRow, then convert
to UnsafeRow
val joinedRow = new JoinedRow()
- iter.map(row => unsafeProjection(joinedRow(row,
file.partitionValues)))
+ projectedIter.map(row => unsafeProjection(joinedRow(row,
file.partitionValues)))
}
} catch {
case e: Exception =>
- allocator.close()
+ // Only clean up if listener wasn't registered
+ if (!cleanupRegistered) {
Review Comment:
Let me simplify
--
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]