This is an automated email from the ASF dual-hosted git repository.
taiyang-li pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 4017ec94d3 [GLUTEN][CORE] Expose
ColumnarBatches.isLightBatch/ensureOffloaded as public (#12431)
4017ec94d3 is described below
commit 4017ec94d34cf2bdaa80b0be61af980a8cdc1959
Author: 李扬 <[email protected]>
AuthorDate: Tue Jul 7 18:29:58 2026 +0800
[GLUTEN][CORE] Expose ColumnarBatches.isLightBatch/ensureOffloaded as
public (#12431)
These two helpers are needed by out-of-package callers that produce or
consume native-based columnar batches (e.g. a custom parquet batch
writer under org.apache.spark.sql.execution.datasources), which cannot
reach the package-private methods. Promote them to public so backends
can reuse the batch type check and offload logic without duplicating it.
Generated-by: TraeCli openrouter-3o
Change-Id: I9ec9927cff51f967ae807f9b755c63776b3f8127
Co-authored-by: Aime <[email protected]>
---
.../main/java/org/apache/gluten/columnarbatch/ColumnarBatches.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git
a/gluten-arrow/src/main/java/org/apache/gluten/columnarbatch/ColumnarBatches.java
b/gluten-arrow/src/main/java/org/apache/gluten/columnarbatch/ColumnarBatches.java
index 40b931d92a..879d38f001 100644
---
a/gluten-arrow/src/main/java/org/apache/gluten/columnarbatch/ColumnarBatches.java
+++
b/gluten-arrow/src/main/java/org/apache/gluten/columnarbatch/ColumnarBatches.java
@@ -95,8 +95,7 @@ public final class ColumnarBatches {
* Light batch: Data is not readable from JVM, a long int handle (which is a
pointer usually) is
* used to bind the batch to a native side implementation.
*/
- @VisibleForTesting
- static boolean isLightBatch(ColumnarBatch batch) {
+ public static boolean isLightBatch(ColumnarBatch batch) {
return identifyBatchType(batch) == BatchType.LIGHT;
}
@@ -128,7 +127,7 @@ public final class ColumnarBatches {
* Ensure the input batch is offloaded as native-based columnar batch (See
{@link IndicatorVector}
* and {@link PlaceholderVector}). This method will close the input column
batch after offloaded.
*/
- static ColumnarBatch ensureOffloaded(BufferAllocator allocator,
ColumnarBatch batch) {
+ public static ColumnarBatch ensureOffloaded(BufferAllocator allocator,
ColumnarBatch batch) {
if (ColumnarBatches.isLightBatch(batch)) {
return batch;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]