andygrove commented on issue #4462:
URL:
https://github.com/apache/datafusion-comet/issues/4462#issuecomment-4565528926
Not reproducible against current `main` — DataFusion's `repeat` already
returns the empty string for `n <= 0` in both the scalar and array paths (see
`datafusion-functions-53.1.0/src/string/repeat.rs`: `compute_repeat`
short-circuits with `if count <= 0 { return Ok(String::new()); }`, and
`repeat_impl` guards each row with `if count > 0 { ... } else {
append_value("") }`).
The SQL fixture
`spark/src/test/resources/sql-tests/expressions/string/string_repeat.sql`
already exercises the column path with `('a', -1)` and passes. I added an
explicit literal-literal case (`SELECT repeat('abc', -1), repeat('abc', -100)`)
as regression coverage and confirmed `CometSqlFileTestSuite` is green.
Closing as already fixed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]