mbutrovich commented on code in PR #3410:
URL: https://github.com/apache/datafusion-comet/pull/3410#discussion_r2770404586


##########
common/src/main/java/org/apache/comet/parquet/NativeBatchReader.java:
##########
@@ -154,6 +154,13 @@ public URI pathUri() throws URISyntaxException {
   protected static final BufferAllocator ALLOCATOR = new RootAllocator();
   private NativeUtil nativeUtil = new NativeUtil();
 
+  /**
+   * Thread-local holding the native BatchContext handle of the current 
reader. Set during
+   * nextBatch() in passthrough mode so that 
CometBatchIterator.advancePassthrough() can retrieve
+   * it.
+   */
+  public static final ThreadLocal<Long> CURRENT_READER_HANDLE = 
ThreadLocal.withInitial(() -> 0L);

Review Comment:
   Claude really loves thread local variables and I always need to sit and 
think for a long time how it could blow up in our faces.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to