apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
5.48k stars 1.01k forks source link

`stride` arg of `array_slice()` should be optional #10740

Closed yutannihilation closed 1 month ago

yutannihilation commented 1 month ago

Describe the bug

Currently, all args of array_slice() is mandatory, but stride seems optional.

https://docs.rs/datafusion/38.0.0/datafusion/functions_array/expr_fn/fn.array_slice.html:

pub fn array_slice(array: Expr, begin: Expr, end: Expr, stride: Expr) -> Expr

code: https://github.com/apache/datafusion/blob/09dde27be39ad054f85dfb5c37b7468a3f68d652/datafusion/functions-array/src/extract.rs#L296-L305

To Reproduce

n/a

Expected behavior

n/a

Additional context

n/a

jonahgao commented 1 month ago

Hi @yutannihilation , this has been fixed on the main branch. https://github.com/apache/datafusion/blob/09dde27be39ad054f85dfb5c37b7468a3f68d652/datafusion/functions-array/src/extract.rs#L224-L231

yutannihilation commented 1 month ago

Oh, great! Sorry that I didn't look at the latest code. I'm closing.