juju4 opened a new issue, #15872:
URL: https://github.com/apache/datafusion/issues/15872

   ### Describe the bug
   
   From https://github.com/openobserve/openobserve/discussions/6584
   regexp_match does not seem to work with length or space matches. see below.
   
   ### To Reproduce
   
   ```
   $ mkdir ~/.cargo/tmp; TMPDIR=~/.cargo/tmp cargo install datafusion-cli
   $ datafusion-cli
   DataFusion CLI v47.0.0
   > select * from 'test-datafusion.csv';
   +---+-------+
   | a | b     |
   +---+-------+
   | 1 | one   |
   | 2 | two   |
   | 3 | three |
   +---+-------+
   3 row(s) fetched.
   Elapsed 0.006 seconds.
   > select * from 'test-datafusion.csv' where regexp_match(a, '(.){4,}');
   Error during planning: Cannot create filter with non-boolean predicate 
'regexp_match(test-datafusion.csv.a, Utf8("(.){4,}"))' returning List(Field { 
name: "item", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: 
false, metadata: {} })
   > select * from 'test-datafusion.csv';
   +---+--------------+
   | a | b            |
   +---+--------------+
   | 1 | one          |
   | 2 | two          |
   | 3 | three        |
   | 3 | four -O test |
   +---+--------------+
   4 row(s) fetched.
   Elapsed 0.010 seconds.
   
   > select * from 'test-datafusion.csv' where regexp_match(b, '(.){4,}');
   Error during planning: Cannot create filter with non-boolean predicate 
'regexp_match(test-datafusion.csv.b, Utf8("(.){4,}"))' returning List(Field { 
name: "item", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: 
false, metadata: {} })
   > select * from 'test-datafusion.csv' where regexp_match(b, '\s-O\s');
   Error during planning: Cannot create filter with non-boolean predicate 
'regexp_match(test-datafusion.csv.b, Utf8("\s-O\s"))' returning List(Field { 
name: "item", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: 
false, metadata: {} })
   
   ```
   
   ### Expected behavior
   
   both should return one result with no error.
   
   ### 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: [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]

Reply via email to