Jefffrey commented on PR #19574: URL: https://github.com/apache/datafusion/pull/19574#issuecomment-3705123005
> Good question @Jefffrey! > > If `preserve_nulls = false` and `preserve_empty_as_null = true`: > > * Empty arrays `[]` are first treated as NULL > > * Then, since `preserve_nulls = false`, NULLs produce 0 output rows > > * So empty arrays would produce 0 rows > > > The two flags work independently: > > 1. `preserve_empty_as_null` converts `[]` → NULL > > 2. `preserve_nulls` determines if NULLs produce output > > > preserve_nulls preserve_empty_as_null Empty [] produces > true true 1 row (NULL) > true false 0 rows > false true 0 rows > false false 0 rows > > Should I add a test case for this combination, or update the documentation to clarify? Having two flags interact in this way doesn't seem intuitive; we might be better off with an enum approach so we have more obvious behaviour states. I also have to ask, how much of this PR (code, PR body + replies) are LLM generated? Please disclose if LLMs are being used here. -- 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]
