MaxGekk opened a new pull request #27323: [SPARK-30606][SQL] Fix the `like` 
function with 2 parameters
URL: https://github.com/apache/spark/pull/27323
 
 
   ### What changes were proposed in this pull request?
   In the PR, I propose to add additional constructor in the `Like` expression. 
The constructor can be used on applying the `like` function with 2 parameters.
   
   ### Why are the changes needed?
   `FunctionRegistry` cannot find a constructor if the `like` function is 
applied to 2 parameters.
   
   ### Does this PR introduce any user-facing change?
   Yes, before:
   ```sql
   spark-sql> SELECT like('Spark', '_park');
   
   Invalid arguments for function like; line 1 pos 7
   org.apache.spark.sql.AnalysisException: Invalid arguments for function like; 
line 1 pos 7
        at 
org.apache.spark.sql.catalyst.analysis.FunctionRegistry$.$anonfun$expression$7(FunctionRegistry.scala:618)
        at scala.Option.getOrElse(Option.scala:189)
        at 
org.apache.spark.sql.catalyst.analysis.FunctionRegistry$.$anonfun$expression$4(FunctionRegistry.scala:602)
        at 
org.apache.spark.sql.catalyst.analysis.SimpleFunctionRegistry.lookupFunction(FunctionRegistry.scala:121)
        at 
org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupFunction(SessionCatalog.scala:1412)
   ```
   After:
   ```sql
   spark-sql> SELECT like('Spark', '_park');
   true
   ```
   
   ### How was this patch tested?
   By running `check outputs of expression examples` from `SQLQuerySuite`.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to