You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/08/07 22:05:26 UTC
[I] Cast Utf8 -> Utf8View (not the other way around) for binary operators [datafusion]
alamb opened a new issue, #11881:
URL: https://github.com/apache/datafusion/issues/11881
### Is your feature request related to a problem or challenge?
In https://github.com/apache/datafusion/pull/11796 @dharanad added a rule for binary operators such that if `Utf8View` is in any side, we coerce to `Utf8`.
I think it would be better to coerce to Utf8View as that coercsion will often be faster (it is faster to cast Utf8 -> Utf8View than the other way around)
@XiangpengHao notes: https://github.com/apache/datafusion/pull/11796#discussion_r1705034145
> Agree, similar to this policy:
https://github.com/apache/datafusion/blob/b50887f00a1e6009d5ee01c9194ac5ea3269ed8b/datafusion/expr/src/type_coercion/binary.rs#L935-L947
### Describe the solution you'd like
Cast to Utf8View rather than Utf8 in the aforementioned code
### Describe alternatives you've considered
_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@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Cast Utf8 -> Utf8View (not the other way around) for binary operators [datafusion]
Posted by "dharanad (via GitHub)" <gi...@apache.org>.
dharanad commented on issue #11881:
URL: https://github.com/apache/datafusion/issues/11881#issuecomment-2274776271
take
--
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@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Cast Utf8 -> Utf8View (not the other way around) for binary operators [datafusion]
Posted by "dharanad (via GitHub)" <gi...@apache.org>.
dharanad commented on issue #11881:
URL: https://github.com/apache/datafusion/issues/11881#issuecomment-2308281287
I think we can close this issue
--
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@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Cast Utf8 -> Utf8View (not the other way around) for binary operators [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #11881:
URL: https://github.com/apache/datafusion/issues/11881#issuecomment-2308785130
Thank you @dharanad - I just doubled checked an indeed this is fixed now:
```sql
> create table foo as values (arrow_cast('foo', 'Utf8View'));
0 row(s) fetched.
Elapsed 0.014 seconds.
> explain select column1 || 'bar' from foo;
+---------------+--------------------------------------------------------------------------+
| plan_type | plan |
+---------------+--------------------------------------------------------------------------+
| logical_plan | Projection: foo.column1 || Utf8View("bar") AS foo.column1 || Utf8("bar") |
| | TableScan: foo projection=[column1] |
| physical_plan | ProjectionExec: expr=[column1@0 || bar as foo.column1 || Utf8("bar")] |
| | MemoryExec: partitions=1, partition_sizes=[1] |
| | |
+---------------+--------------------------------------------------------------------------+
2 row(s) fetched.
Elapsed 0.006 seconds.
> explain select 'bar' || column1 from foo;
+---------------+--------------------------------------------------------------------------+
| plan_type | plan |
+---------------+--------------------------------------------------------------------------+
| logical_plan | Projection: Utf8View("bar") || foo.column1 AS Utf8("bar") || foo.column1 |
| | TableScan: foo projection=[column1] |
| physical_plan | ProjectionExec: expr=[bar || column1@0 as Utf8("bar") || foo.column1] |
| | MemoryExec: partitions=1, partition_sizes=[1] |
| | |
+---------------+--------------------------------------------------------------------------+
2 row(s) fetched.
Elapsed 0.001 seconds.
>
```
--
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@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Cast Utf8 -> Utf8View (not the other way around) for binary operators [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #11881: Cast Utf8 -> Utf8View (not the other way around) for binary operators
URL: https://github.com/apache/datafusion/issues/11881
--
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@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org