kosiew opened a new pull request, #23475:
URL: https://github.com/apache/datafusion/pull/23475
### Which issue does this PR close?
* Closes #23086
### Rationale for this change
ClickBench Q27 and Q28 are intended to aggregate the **byte length** of
string values, while DataFusion intentionally defines `length` as an alias for
`character_length`, which counts UTF-8 characters rather than bytes. This
change updates the in-repo ClickBench SQL to use `octet_length(...)`
explicitly, aligning these benchmark queries with ClickBench's intended
semantics without changing DataFusion's SQL behavior.
### What changes are included in this PR?
* Updated ClickBench Q27 to use `AVG(octet_length("URL"))` instead of
`AVG(length("URL"))` in:
* `benchmarks/queries/clickbench/queries/q27.sql`
* `benchmarks/sql_benchmarks/clickbench/benchmarks/q27.benchmark`
* Updated ClickBench Q28 to use `AVG(octet_length("Referer"))` instead of
`AVG(length("Referer"))` in:
* `benchmarks/queries/clickbench/queries/q28.sql`
* `benchmarks/sql_benchmarks/clickbench/benchmarks/q28.benchmark`
* Updated the corresponding SQLLogicTest (`clickbench.slt`) queries and
expected `EXPLAIN` output so the logical and physical plans reference
`octet_length(...)` rather than `character_length(...)` or `length(...)`.
* Added brief comments in the benchmark SQL noting that `length(...)` in
DataFusion counts characters and that `octet_length(...)` is used to preserve
ClickBench byte-length semantics.
### Are these changes tested?
The patch updates the expected SQLLogicTest
(`datafusion/sqllogictest/test_files/clickbench.slt`) output for Q27 and Q28 to
reflect the new `octet_length(...)` plans.
No test execution or benchmark results are included in this patch.
Performance was **not measured** as part of this change.
### Are there any user-facing changes?
There are no user-facing API or SQL semantic changes. This change only
updates the in-repo ClickBench benchmark queries and their corresponding
SQLLogicTest expectations to use explicit byte-length semantics.
### LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated content
has been manually reviewed.
--
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]