NVIDIA / NVIDIA/cudf

[FEA] Java AST should allow passing Scalar instance as literal

Open
#10,002 5 comments 0 reactions 0 assignees View on GitHub
feature request Java Spark
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
When building a cudf AST expression in Java, sometimes there are cases where a `Scalar` instance already exists for a literal. The current Java bindings do not allow a `Scalar` to be used directly, so one must synchronize and fetch the validity and value to manually construct a corresponding AST `Literal` instance.

**Describe the solution you'd like**
The Java bindings should allow for an AST `Literal` instance to take a `Scalar` argument as the literal value to use, which will include both the validity and value. No synchronization is necessary for this constructor. When compiled, the resulting `CompiledExpression` instance should increment the reference count of the `Scalar` instance, as it is being actively referenced by the compiled AST, and closing the `CompiledExpression` should close the corresponding `Scalar` instance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.