You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "JayjeetAtGithub (via GitHub)" <gi...@apache.org> on 2023/08/21 06:00:13 UTC
[GitHub] [arrow-datafusion] JayjeetAtGithub opened a new issue, #7343: Invalid argument error: the data type binary has no natural order
JayjeetAtGithub opened a new issue, #7343:
URL: https://github.com/apache/arrow-datafusion/issues/7343
### Describe the bug
### Describe the bug
On running the 4 queries below on the Clickbench multi file dataset,
```
SELECT "SearchPhrase", MIN("URL"), COUNT(*) AS c FROM hits WHERE "URL" LIKE '%google%' AND "SearchPhrase" <> '' GROUP BY "SearchPhrase" ORDER BY c DESC LIMIT 10;
DataFusion CLI v29.0.0
SELECT "SearchPhrase", MIN("URL"), MIN("Title"), COUNT(*) AS c, COUNT(DISTINCT "UserID") FROM hits WHERE "Title" LIKE '%Google%' AND "URL" NOT LIKE '%.google.%' AND "SearchPhrase" <> '' GROUP BY "SearchPhrase" ORDER BY c DESC LIMIT 10;
SELECT * FROM hits WHERE "URL" LIKE '%google%' ORDER BY to_timestamp_seconds("EventTime") LIMIT 10;
SELECT "SearchPhrase" FROM hits WHERE "SearchPhrase" <> '' ORDER BY to_timestamp_seconds("EventTime") LIMIT 10;
```
we get this error,
```bash
type_coercion caused by Error during planning: There isn't a common type to coerce Binary and Utf8 in LIKE expression
```
### To Reproduce
Download the data using,
```bash
./benchmarks/bench.sh data clickbench_partitioned
```
A `hits_multi` directory with the parquet files will be created.
Execute the above queries,
```bash
datafusion-cli -c "CREATE EXTERNAL TABLE hits STORED AS PARQUET LOCATION 'hits_multi';" "{query}"
```
### Expected behavior
The queries should run successfully without erroring.
### Additional context
_No response_
### To Reproduce
_No response_
### Expected behavior
_No response_
### Additional context
_No response_
--
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Invalid argument error: the data type binary has no natural order [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #7343:
URL: https://github.com/apache/arrow-datafusion/issues/7343#issuecomment-1765259256
I have verified that this now works in datafusion 34. Tests added in https://github.com/apache/arrow-datafusion/pull/7839
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb commented on issue #7343: Invalid argument error: the data type binary has no natural order
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #7343:
URL: https://github.com/apache/arrow-datafusion/issues/7343#issuecomment-1686119971
This looks similar to https://github.com/apache/arrow-datafusion/issues/7039 which @jonahgao fixed by adding a coercion from binary --> UTF8 for comparison. I think we could do something similar 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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] tustvold commented on issue #7343: Invalid argument error: the data type binary has no natural order
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on issue #7343:
URL: https://github.com/apache/arrow-datafusion/issues/7343#issuecomment-1686565981
This may be fixed in the next arrow release, which adds Binary support to lexsort
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb commented on issue #7343: Invalid argument error: the data type binary has no natural order
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #7343:
URL: https://github.com/apache/arrow-datafusion/issues/7343#issuecomment-1686121515
Marking as a good first issue as there is a reproducer and I think the fix should be relatively straightforward
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] yjshen commented on issue #7343: Invalid argument error: the data type binary has no natural order
Posted by "yjshen (via GitHub)" <gi...@apache.org>.
yjshen commented on issue #7343:
URL: https://github.com/apache/arrow-datafusion/issues/7343#issuecomment-1694725645
A slightly simpler way to reproduce without the need for datafusion-cli:
```rs
#[tokio::test]
async fn binary_order() -> Result<()> {
let schema = Arc::new(Schema::new(vec![
Field::new("a", DataType::Binary, false),
Field::new("b", DataType::Int32, false),
]));
let batch = RecordBatch::try_new(
schema.clone(),
vec![Arc::new(BinaryArray::from(vec![
"a".as_bytes(),
"b".as_bytes(),
"c".as_bytes(),
])),
Arc::new(Int32Array::from(vec![1, 2, 3]))],
)?;
let ctx = SessionContext::new();
ctx.register_batch("aa", batch)?;
let result = ctx.sql("select a from aa where a <> '' order by b, a").await?;
let result = result.collect().await?;
let expected = vec![
"+----+",
"| a |",
"+----+",
"| 61 |",
"| 62 |",
"| 63 |",
"+----+",
];
assert_batches_eq!(expected, &result);
Ok(())
}
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Invalid argument error: the data type binary has no natural order [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #7343: Invalid argument error: the data type binary has no natural order
URL: https://github.com/apache/arrow-datafusion/issues/7343
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org