alamb commented on code in PR #14268:
URL: https://github.com/apache/datafusion/pull/14268#discussion_r1936187986
##########
datafusion/sqllogictest/test_files/expr.slt:
##########
@@ -571,8 +601,10 @@ select repeat('-1.2', arrow_cast(3, 'Int32'));
----
-1.2-1.2-1.2
-query error DataFusion error: Error during planning: Internal error: Expect
TypeSignatureClass::Native\(LogicalType\(Native\(Int64\), Int64\)\) but
received Float64
+query T
select repeat('-1.2', 3.2);
Review Comment:
In main this query does an internal error
```sql
> select repeat('foo', 3.2);
Error during planning: Internal error: Expect
TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)) but received
Float64.
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 No function matches the given
name and argument types 'repeat(Utf8, Float64)'. You might need to add explicit
type casts.
Candidate functions:
repeat(TypeSignatureClass::Native(LogicalType(Native(String), String)),
TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)))
```
Avoiding an internal error seems like an improvement to me
I agree in general it would likely be better to help people avoid an error
by rejecting non-integer arguments with a nicer error
Filed
- https://github.com/apache/datafusion/issues/14376
I don't understand the implementation implications however
##########
datafusion/sqllogictest/test_files/expr.slt:
##########
@@ -344,6 +344,16 @@ SELECT ascii('💯a')
----
128175
+query I
+SELECT ascii('222')
+----
+50
+
+query I
+SELECT ascii(2)
Review Comment:
I think for now this is ok in my opinion as there is no spark functions
crate yet 😬 Maybe this is yet another example of how it is needed
- https://github.com/apache/datafusion/issues/5600
--
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]