You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "mbutrovich (via GitHub)" <gi...@apache.org> on 2026/02/05 17:51:54 UTC

Re: [PR] feat: Native batch passthrough for native_iceberg_compat V1 scans [EXPERIMENTAL] [datafusion-comet]

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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org