chore: Use native impl of elt function - #5040
Conversation
This reverts commit 768b3e9.
|
Thanks @comphead! |
andygrove
left a comment
There was a problem hiding this comment.
I don't think the upstream elt implementation is Spark-compatible? It doesn't implement ANSI mode, for example.
From DF 54.1.0:
// TODO: if spark.sql.ansi.enabled is true,
// throw ArrayIndexOutOfBoundsException for invalid indices;
// if false, return NULL instead (current behavior).
if index < 1 || (index as usize) > num_values {
builder.append_null();
continue;
}
One option would be to mix in |
Thanks @andygrove for catching this. for ANSI we should start an epic there. The ANSI flag is already there, and we can try it on |
|
Created apache/datafusion#23928 |
Which issue does this PR close?
Rationale for this change
This PR migrates the elt string function from Comet's codegen-based dispatch path to the shared datafusion-spark implementation, registering it as a native scalar UDF.
What changes are included in this PR?
CometEltfromCometCodegenDispatch[Elt]toCometScalarFunction[Elt]("elt")How are these changes tested?
Significantly expand the test coverage with many additional inputs to exercise edge cases