You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2023/09/04 06:51:09 UTC

[GitHub] [spark] panbingkun opened a new pull request, #42797: [SPARK-45068][SQL] Make function output column name consistent in case

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

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   <!--
   If generative AI tooling has been used in the process of authoring this patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   


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


[GitHub] [spark] panbingkun commented on pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

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

   > Let me double check again.
   
   Done.


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


[GitHub] [spark] panbingkun commented on a diff in pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1320918163


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -880,7 +885,7 @@ case class IntegralDivide(
     DecimalType.bounded(if (intDig == 0) 1 else intDig, 0)
   }
 
-  override def sqlOperator: String = "div"
+  override def sqlOperator: String = "DIV"

Review Comment:
   If we change it to lowercase, there will be approximately `55` file changes, as shown in: https://github.com/apache/spark/pull/42865
   
   The original intention of this PR is to maintain consistency, whether it is lowercase or uppercase (Currently, it seems that using uppercase letters to display mathematical function names is more in line with common practice). Two confusing cases are described in the PR.
   - Inconsistent case of alias
      <img width="560" alt="image" src="https://github.com/apache/spark/assets/15246973/5e073f37-0767-4922-b62a-b3a54fb9fb80">
   
   - The number of function parameters also leads to inconsistent capitalization
      <img width="649" alt="image" src="https://github.com/apache/spark/assets/15246973/3c52395f-5805-4f67-9dd2-3a32bea46dcd">
   
   



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


[GitHub] [spark] panbingkun commented on pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

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

   > #42869
   
   Okay, let me wait for it.


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


[GitHub] [spark] cloud-fan commented on a diff in pull request #42797: [SPARK-45068][SQL] Make function output column name consistent in case

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1315476814


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:
##########
@@ -67,7 +67,8 @@ abstract class UnaryMathExpression(val f: Double => Double, name: String)
   override def dataType: DataType = DoubleType
   override def nullable: Boolean = true
   override def toString: String = s"$prettyName($child)"
-  override def prettyName: String = getTagValue(FunctionRegistry.FUNC_ALIAS).getOrElse(name)
+  override def prettyName: String = getTagValue(FunctionRegistry.FUNC_ALIAS).
+    getOrElse(name.toLowerCase(Locale.ROOT))

Review Comment:
   is this the only place that need to change? `LeafMathExpression` does not lower-case the name either.



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


[GitHub] [spark] panbingkun commented on pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

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

   Although this change involves a lot of files, I think it should be made, such as:
   <img width="658" alt="image" src="https://github.com/apache/spark/assets/15246973/1a8f3127-afdf-4ddc-b35a-cba88b8f4c92">
   


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


[GitHub] [spark] zhengruifeng commented on pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

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

   please rebase after https://github.com/apache/spark/pull/42869 get merged


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


[GitHub] [spark] panbingkun commented on pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

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

   Let me double check again.


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


[GitHub] [spark] panbingkun commented on pull request #42797: [SPARK-45068][SQL] Make function output column name consistent in case

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

   cc @HyukjinKwon @zhengruifeng @cloud-fan 


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


[GitHub] [spark] panbingkun commented on pull request #42797: [SPARK-45068][SQL] Make function output column name consistent in case

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

   > given the amount of changes, I'm rethinking about what's the right behavior. Looking at `Expression#prettyName`, it does seem like we prefer lower-cased names for functions. But we can't say that it's wrong to use upper-cased names for math functions.
   > 
   > Shall we just follow the existing naming style? Math functions prefer upper-cased names and we should update `UnaryMathExpression#prettyName` instead.
   
   Okay, that's fine. Let's show all the mathematical functions in uppercase form, which is also reasonable. We need to maintain consistency.
   Let me to do it!


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


[GitHub] [spark] cloud-fan commented on pull request #42797: [SPARK-45068][SQL] Make function output column name consistent in case

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

   given the amount of changes, I'm rethinking about what's the right behavior. Looking at `Expression#prettyName`, it does seem like we prefer lower-cased names for functions. But we can't say that it's wrong to use upper-cased names for math functions.
   
   Shall we just follow the existing naming style? Math functions prefer upper-cased names and we should update `UnaryMathExpression#prettyName` instead.


-- 
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-45068][SQL] Make math function output column name displayed in upper-cased style [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42797:
URL: https://github.com/apache/spark/pull/42797#issuecomment-1867077864

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


-- 
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-45068][SQL] Make math function output column name displayed in upper-cased style [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style
URL: https://github.com/apache/spark/pull/42797


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


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1320899020


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -880,7 +885,7 @@ case class IntegralDivide(
     DecimalType.bounded(if (intDig == 0) 1 else intDig, 0)
   }
 
-  override def sqlOperator: String = "div"
+  override def sqlOperator: String = "DIV"

Review Comment:
   apologies I joined this party late. Seems like doing uppercase also needs a lot of changes? How big is it to make all lowercased? Otherwise, I tend to think that it might not be so worthwhile fixing.



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


[GitHub] [spark] panbingkun commented on a diff in pull request #42797: [SPARK-45068][SQL] Make function output column name consistent in case

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1315497780


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:
##########
@@ -67,7 +67,8 @@ abstract class UnaryMathExpression(val f: Double => Double, name: String)
   override def dataType: DataType = DoubleType
   override def nullable: Boolean = true
   override def toString: String = s"$prettyName($child)"
-  override def prettyName: String = getTagValue(FunctionRegistry.FUNC_ALIAS).getOrElse(name)
+  override def prettyName: String = getTagValue(FunctionRegistry.FUNC_ALIAS).
+    getOrElse(name.toLowerCase(Locale.ROOT))

Review Comment:
   Okay, let me also change LeafMathExpression together. Originally, I thought the subclasses of LeafMathExpression: E and PI to be displayed in uppercase, which may be a better choice.
   Let me to do it.



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


[GitHub] [spark] cloud-fan commented on a diff in pull request #42797: [SPARK-45068][SQL] Make function output column name consistent in case

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1317406794


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:
##########
@@ -1479,6 +1480,10 @@ abstract class RoundBase(child: Expression, scale: Expression,
 
   override def foldable: Boolean = child.foldable
 
+  override def prettyName: String =

Review Comment:
   we can leave a comment to say that other math functions also use upper-cased names.



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


[GitHub] [spark] panbingkun commented on a diff in pull request #42797: [SPARK-45068][SQL] Make function output column name consistent in case

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1318042931


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:
##########
@@ -1479,6 +1480,10 @@ abstract class RoundBase(child: Expression, scale: Expression,
 
   override def foldable: Boolean = child.foldable
 
+  override def prettyName: String =

Review Comment:
   Let me check all the mathematical functions
   https://github.com/apache/spark/blob/56393b90723257a757b7b87fb623847ef03d4bf3/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala#L384-L450



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


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1320899020


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -880,7 +885,7 @@ case class IntegralDivide(
     DecimalType.bounded(if (intDig == 0) 1 else intDig, 0)
   }
 
-  override def sqlOperator: String = "div"
+  override def sqlOperator: String = "DIV"

Review Comment:
   apology I joined this party late. Seems like doing uppercase also needs a lot of changes? How big is it to make all lowercased? Otherwise, I tend to think that it might not be so worthwhile fixing.



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


[GitHub] [spark] panbingkun commented on a diff in pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1320918163


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -880,7 +885,7 @@ case class IntegralDivide(
     DecimalType.bounded(if (intDig == 0) 1 else intDig, 0)
   }
 
-  override def sqlOperator: String = "div"
+  override def sqlOperator: String = "DIV"

Review Comment:
   If we change it to lowercase, there will be approximately `55` file changes, as shown in:
   
   The original intention of this PR is to maintain consistency, whether it is lowercase or uppercase (Currently, it seems that using uppercase letters to display mathematical function names is more in line with common practice). Two confusing cases are described in the PR.
   - Inconsistent case of alias
      <img width="560" alt="image" src="https://github.com/apache/spark/assets/15246973/5e073f37-0767-4922-b62a-b3a54fb9fb80">
   
   - The number of function parameters also leads to inconsistent capitalization
      <img width="649" alt="image" src="https://github.com/apache/spark/assets/15246973/3c52395f-5805-4f67-9dd2-3a32bea46dcd">
   
   



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


[GitHub] [spark] panbingkun commented on a diff in pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #42797:
URL: https://github.com/apache/spark/pull/42797#discussion_r1320918163


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -880,7 +885,7 @@ case class IntegralDivide(
     DecimalType.bounded(if (intDig == 0) 1 else intDig, 0)
   }
 
-  override def sqlOperator: String = "div"
+  override def sqlOperator: String = "DIV"

Review Comment:
   If we change it to lowercase, there will be approximately `55` file changes, as shown in:
   
   The original intention of this PR is to maintain consistency, whether it is lowercase or uppercase (Currently, it seems that using uppercase letters to display mathematical function names is more in line with common practice). Two confusing cases are described in the PR.
   - Inconsistent case of alias
      <img width="560" alt="image" src="https://github.com/apache/spark/assets/15246973/5e073f37-0767-4922-b62a-b3a54fb9fb80">
   
   - The number of function parameters also leads to inconsistent capitalization
   
   
   



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


[GitHub] [spark] panbingkun commented on pull request #42797: [SPARK-45068][SQL] Make math function output column name displayed in upper-cased style

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

   > please rebase after #42869 get merged
   
   Done.


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