You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/25 08:01:58 UTC

[GitHub] [spark] AngersZhuuuu opened a new pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

AngersZhuuuu opened a new pull request #30496:
URL: https://github.com/apache/spark/pull/30496


   ### What changes were proposed in this pull request?
   According  to https://github.com/apache/spark/pull/30421#discussion_r530024114
   Add typed literal in doc
   
   
   ### Why are the changes needed?
   Make user clear about usage of typed literal
   
   
   ### Does this PR introduce _any_ user-facing change?
   NO
   
   ### How was this patch tested?
   NOT need
   


----------------------------------------------------------------
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:
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] AmplabJenkins commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-733726089






----------------------------------------------------------------
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:
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] AmplabJenkins commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734626402






----------------------------------------------------------------
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:
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] SparkQA removed a comment on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734535929


   **[Test build #131855 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131855/testReport)** for PR 30496 at commit [`dc7c3df`](https://github.com/apache/spark/commit/dc7c3df6abc3df82141d78cf5fa5fe97e2db9f55).


----------------------------------------------------------------
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:
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] SparkQA commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734545941


   **[Test build #131855 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131855/testReport)** for PR 30496 at commit [`dc7c3df`](https://github.com/apache/spark/commit/dc7c3df6abc3df82141d78cf5fa5fe97e2db9f55).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
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:
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] AngersZhuuuu closed pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu closed pull request #30496:
URL: https://github.com/apache/spark/pull/30496


   


----------------------------------------------------------------
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:
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] maropu commented on a change in pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #30496:
URL: https://github.com/apache/spark/pull/30496#discussion_r531253301



##########
File path: docs/sql-ref-literals.md
##########
@@ -21,14 +21,74 @@ license: |
 
 A literal (also known as a constant) represents a fixed data value. Spark SQL supports the following literals:
 
+ * [Typed Literal](#typed-literal)
  * [String Literal](#string-literal)
  * [Binary Literal](#binary-literal)
  * [Null Literal](#null-literal)
  * [Boolean Literal](#boolean-literal)
  * [Numeric Literal](#numeric-literal)
+ * [Timestamp Literal](#timestamp-literal)
  * [Datetime Literal](#datetime-literal)
  * [Interval Literal](#interval-literal)
 
+### Typed Literal

Review comment:
       I feel "Typed Literal" is a bit confusing. For example, a numerical literal is also a typed literal, right? How about saying `Typed Literal for Binary, Date, Timestamp, and Interaval` 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.

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] AngersZhuuuu commented on a change in pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on a change in pull request #30496:
URL: https://github.com/apache/spark/pull/30496#discussion_r531333616



##########
File path: docs/sql-ref-literals.md
##########
@@ -21,14 +21,74 @@ license: |
 
 A literal (also known as a constant) represents a fixed data value. Spark SQL supports the following literals:
 
+ * [Typed Literal](#typed-literal)
  * [String Literal](#string-literal)
  * [Binary Literal](#binary-literal)
  * [Null Literal](#null-literal)
  * [Boolean Literal](#boolean-literal)
  * [Numeric Literal](#numeric-literal)
+ * [Timestamp Literal](#timestamp-literal)
  * [Datetime Literal](#datetime-literal)
  * [Interval Literal](#interval-literal)
 
+### Typed Literal

Review comment:
       > I feel "Typed Literal" is a bit confusing. For example, a numerical literal is also a typed literal, right? How about saying `Typed Literal for Binary, Date, Timestamp, and Interaval` instead?
   
   LGTM, changed




----------------------------------------------------------------
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:
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] AmplabJenkins removed a comment on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-733543113






----------------------------------------------------------------
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:
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] SparkQA commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734535929


   **[Test build #131855 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131855/testReport)** for PR 30496 at commit [`dc7c3df`](https://github.com/apache/spark/commit/dc7c3df6abc3df82141d78cf5fa5fe97e2db9f55).


----------------------------------------------------------------
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:
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] maropu commented on a change in pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #30496:
URL: https://github.com/apache/spark/pull/30496#discussion_r531350202



##########
File path: docs/sql-ref-literals.md
##########
@@ -21,14 +21,74 @@ license: |
 
 A literal (also known as a constant) represents a fixed data value. Spark SQL supports the following literals:
 
+ * [Typed Literal for Binary, Date, Timestamp, and Interval](#typed-literal)
  * [String Literal](#string-literal)
  * [Binary Literal](#binary-literal)
  * [Null Literal](#null-literal)
  * [Boolean Literal](#boolean-literal)
  * [Numeric Literal](#numeric-literal)
+ * [Timestamp Literal](#timestamp-literal)
  * [Datetime Literal](#datetime-literal)
  * [Interval Literal](#interval-literal)
 
+### Typed Literal for Binary, Date, Timestamp, and Interval
+
+A typed Literal expression parsing string values to typed Literal 
+
+#### Syntax
+
+```sql
+[TYPE] '[VALUE]'
+```
+
+#### Parameters
+
+* **TYPE**
+   
+    `TYPE` parameter shows which type of Literal we will generate. Currently Date, Timestamp, Interval and Binary typed literal are supported.
+     
+      X: Binary Literal

Review comment:
       Ah, wait.  The `Binary Literal` section already has examples for this case though, why do we need this new section? In my comment https://github.com/apache/spark/pull/30421#discussion_r530024114, I just asked if `a type constructed value` is a common word in the doc.




----------------------------------------------------------------
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:
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] AmplabJenkins removed a comment on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734626402






----------------------------------------------------------------
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:
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] AngersZhuuuu commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-741673699


   Any more update?


----------------------------------------------------------------
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:
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] SparkQA removed a comment on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-733537090


   **[Test build #131752 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131752/testReport)** for PR 30496 at commit [`e3de389`](https://github.com/apache/spark/commit/e3de389280d41c1f8c30569c512a71abff90799b).


----------------------------------------------------------------
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:
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] AmplabJenkins removed a comment on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734546467






----------------------------------------------------------------
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:
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] SparkQA commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-733537090


   **[Test build #131752 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131752/testReport)** for PR 30496 at commit [`e3de389`](https://github.com/apache/spark/commit/e3de389280d41c1f8c30569c512a71abff90799b).


----------------------------------------------------------------
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:
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] AmplabJenkins commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-733543113






----------------------------------------------------------------
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:
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] maropu commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734507508


   cc: @huaxingao 


----------------------------------------------------------------
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:
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] SparkQA commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-733542921


   **[Test build #131752 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131752/testReport)** for PR 30496 at commit [`e3de389`](https://github.com/apache/spark/commit/e3de389280d41c1f8c30569c512a71abff90799b).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
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:
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] AmplabJenkins commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-734546467






----------------------------------------------------------------
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:
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] AngersZhuuuu commented on a change in pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on a change in pull request #30496:
URL: https://github.com/apache/spark/pull/30496#discussion_r531350862



##########
File path: docs/sql-ref-literals.md
##########
@@ -21,14 +21,74 @@ license: |
 
 A literal (also known as a constant) represents a fixed data value. Spark SQL supports the following literals:
 
+ * [Typed Literal for Binary, Date, Timestamp, and Interval](#typed-literal)
  * [String Literal](#string-literal)
  * [Binary Literal](#binary-literal)
  * [Null Literal](#null-literal)
  * [Boolean Literal](#boolean-literal)
  * [Numeric Literal](#numeric-literal)
+ * [Timestamp Literal](#timestamp-literal)
  * [Datetime Literal](#datetime-literal)
  * [Interval Literal](#interval-literal)
 
+### Typed Literal for Binary, Date, Timestamp, and Interval
+
+A typed Literal expression parsing string values to typed Literal 
+
+#### Syntax
+
+```sql
+[TYPE] '[VALUE]'
+```
+
+#### Parameters
+
+* **TYPE**
+   
+    `TYPE` parameter shows which type of Literal we will generate. Currently Date, Timestamp, Interval and Binary typed literal are supported.
+     
+      X: Binary Literal

Review comment:
       > Ah, wait. The `Binary Literal` section already has examples for this case though, why do we need this new section? In my comment [#30421 (comment)](https://github.com/apache/spark/pull/30421#discussion_r530024114), I just asked if `a type constructed value` is a common word in the doc.
   
   That is what I mentioned in  https://github.com/apache/spark/pull/30496#issuecomment-733536446.
   
   We need to introduce typed literal , this special  grammar. right?




----------------------------------------------------------------
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:
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] AngersZhuuuu commented on a change in pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on a change in pull request #30496:
URL: https://github.com/apache/spark/pull/30496#discussion_r530172194



##########
File path: docs/sql-ref-literals.md
##########
@@ -21,14 +21,74 @@ license: |
 
 A literal (also known as a constant) represents a fixed data value. Spark SQL supports the following literals:
 
+ * [Typed Literal](#typed-literal)
  * [String Literal](#string-literal)
  * [Binary Literal](#binary-literal)
  * [Null Literal](#null-literal)
  * [Boolean Literal](#boolean-literal)
  * [Numeric Literal](#numeric-literal)
+ * [Timestamp Literal](#timestamp-literal)

Review comment:
       Missed in current doc




----------------------------------------------------------------
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:
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] AngersZhuuuu commented on pull request #30496: [SPARK-33547][SQL] Add usage of typed literal in doc

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on pull request #30496:
URL: https://github.com/apache/spark/pull/30496#issuecomment-733536446


   FYI @maropu there is many duplicated example between typed literal and corresponding  literal, any suggestion?


----------------------------------------------------------------
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:
users@infra.apache.org



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