Skip to content

"UTMMedium" field in the hits dataset causes a panic when performing SIMILAR TO. #15461

@acking-you

Description

@acking-you

Describe the bug

The "UTMMedium" field in the hits dataset causes a panic when performing SIMILAR TO.

To Reproduce

Execute the SQL below:

select count(*) from hits where "UTMMedium" SIMILAR TO 'email|social|banner';

And you will got a panic,like this:

thread 'tokio-runtime-worker' panicked at xxx/src/expressions/binary.rs:616:27:
compute_utf8_flag_op_scalar failed to downcast array

Expected behavior

SQL should work or at least return errors properly.

Additional context

  1. I tried to check the data and type of this field as follows:
> select arrow_typeof( "UTMMedium" )  from hits limit 1;
+------------------------------+
| arrow_typeof(hits.UTMMedium) |
+------------------------------+
| Utf8View                     |
+------------------------------+

> select "UTMMedium" from hits;
+---------------+
| UTMMedium     |
+---------------+
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
|               |
| cpc_marketing |
|               |
|               |
|               |
| cpc_marketing |
|               |
|               |
|               |
| cpc_marketing |
|               |
|               |
| .             |
| .             |
| .             |
+---------------+
99997497 row(s) fetched. (First 40 displayed. Use --maxrows to adjust)
  1. I'm using datafusion-cli for testing, version 46.01.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions