You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/10/02 18:48:11 UTC

[PR] [WIP][MINOR][SQL] Fix `sql()` of the `Like` expression [spark]

MaxGekk opened a new pull request, #43196:
URL: https://github.com/apache/spark/pull/43196

   ### What changes were proposed in this pull request?
   In the PR, I propose to fix the `sql()` method of the `Like` expression, and append the `ESCAPE` clause when the `escapeChar` is not the default one `\\`.
   
   ### Why are the changes needed?
   1. To be consistent to the `toString()` method
   2. To distinguish column names when the escape argument is set. Before the changes, the columns might conflict, and that could confuse users:
   ```sql
   spark-sql (default)> create temp view tbl as (SELECT 'a|_' like 'a||_' escape '|', 'a|_' like 'a||_' escape 'a');
   [COLUMN_ALREADY_EXISTS] The column `a|_ like a||_` already exists. Consider to choose another name or rename the existing column.
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   Should not.
   
   ### How was this patch tested?
   Manually checking the column name by:
   ```
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45398][SQL] Append `ESCAPE` in `sql()` of the `Like` expression [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #43196:
URL: https://github.com/apache/spark/pull/43196#issuecomment-1746394883

   Merging to master. Thank you, @cloud-fan for review.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45398][SQL] Append `ESCAPE` in `sql()` of the `Like` expression [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk closed pull request #43196: [SPARK-45398][SQL] Append `ESCAPE` in `sql()` of the `Like` expression
URL: https://github.com/apache/spark/pull/43196


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org