You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "zhuliquan (via GitHub)" <gi...@apache.org> on 2024/10/15 02:15:35 UTC

[I] there is something wrong using contains udf [datafusion]

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

   ### Describe the bug
   
   Here, I want to find whether a string contain a substring. I using contain udf. I run below case, I got error
   ```shell
   > select contains(lower('$SE=@(('), '$se=@(');
   Execution error: Regular expression did not compile: Syntax(
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   regex parse error:
       $se=@(
            ^
   error: unclosed group
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   )
   >
   ```
   I'm confused about why regex compilation is needed in the contains UDF. The contains UDF should perform a simple string match rather than using regex_match, according to the documentation on [contains](https://datafusion.apache.org/user-guide/sql/scalar_functions_new.html#contains) and its name.
   
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _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] there is something wrong using contains udf [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #12930: there is something wrong using contains udf
URL: https://github.com/apache/datafusion/issues/12930


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