tustvold commented on code in PR #7376:
URL: https://github.com/apache/arrow-datafusion/pull/7376#discussion_r1301982657
##########
datafusion/core/tests/memory_limit.rs:
##########
@@ -68,12 +68,12 @@ async fn oom_sort() {
#[tokio::test]
async fn group_by_none() {
TestCase::new()
- .with_query("select median(image) from t")
+ .with_query("select median(request_bytes) from t")
Review Comment:
Changed to request_bytes as median isn't well defined for string types, this
would only "work" if there happened to be an odd number of values, or the query
errored (as in this case)
```
❯ create table test(c varchar) as values ('foo'), ('world'), ('hello');
0 rows in set. Query took 0.005 seconds.
❯ select median(c) from test;
+----------------+
| MEDIAN(test.c) |
+----------------+
| hello |
+----------------+
1 row in set. Query took 0.005 seconds.
❯ insert into test values ('bar');
+-------+
| count |
+-------+
| 1 |
+-------+
1 row in set. Query took 0.002 seconds.
❯ select median(c) from test;
Internal error: Operator + is not implemented for types Utf8("foo") and
Utf8("hello"). This was likely caused by a bug in DataFusion's code and we
would welcome that you file an bug report in our issue tracker
```
##########
datafusion/core/tests/memory_limit.rs:
##########
@@ -68,12 +68,12 @@ async fn oom_sort() {
#[tokio::test]
async fn group_by_none() {
TestCase::new()
- .with_query("select median(image) from t")
+ .with_query("select median(request_bytes) from t")
Review Comment:
Changed to request_bytes as median isn't well defined for string types, this
would only "work" if there happened to be an odd number of values, or the query
errored (as in this case)
```
❯ create table test(c varchar) as values ('foo'), ('world'), ('hello');
0 rows in set. Query took 0.005 seconds.
❯ select median(c) from test;
+----------------+
| MEDIAN(test.c) |
+----------------+
| hello |
+----------------+
1 row in set. Query took 0.005 seconds.
❯ insert into test values ('bar');
+-------+
| count |
+-------+
| 1 |
+-------+
1 row in set. Query took 0.002 seconds.
❯ select median(c) from test;
Internal error: Operator + is not implemented for types Utf8("foo") and
Utf8("hello"). This was likely caused by a bug in DataFusion's code and we
would welcome that you file an bug report in our issue tracker
```
--
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]