mpurins-coralogix opened a new issue, #3499:
URL: https://github.com/apache/arrow-datafusion/issues/3499

   **Describe the bug**
   When executing following query field in results has integer datatype instead 
of string.
   `SELECT cast(c as varchar) FROM (SELECT 1 as c)`
   
   **To Reproduce**
   Pickup this commit -- 
https://github.com/coralogix/arrow-datafusion/commit/f5c0fc0ffa56ea9ea02fba60171031bb20a5e7f4
   Run `cast_failure` test.
   
   **Expected behavior**
   I would expect that such test is passing, but currently it fails with 
following error
   ```
   thread 'sql::cast::cast_failure' panicked at 'assertion failed: `(left == 
right)`
     left: `Utf8`,
    right: `Int64`', datafusion/core/tests/sql/cast.rs:32:5
    ```
   
   **Additional context**
   I think this is happening because cast expression is replaced with column 
expression in `columnize_expr` 
(https://github.com/apache/arrow-datafusion/blob/5621e3bbd050eeb79646240ec0a09426badfa162/datafusion/expr/src/utils.rs#L638)
 and I suspect that it started happening for such queries after following 
change -- 
https://github.com/apache/arrow-datafusion/pull/3222/files#diff-204cfc4f999c3d12dc065f323cb952fb0ecb33c5570eed8dc1fb52b806e87004L926


-- 
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]

Reply via email to