This is an automated email from the ASF dual-hosted git repository.

sarutak pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new 56f1ee4  [SPARK-36318][SQL][DOCS] Update docs about mapping of ANSI 
interval types to Java/Scala/SQL types
56f1ee4 is described below

commit 56f1ee4b066ca5123c207acd91f27ee80a3bb07b
Author: Max Gekk <max.g...@gmail.com>
AuthorDate: Wed Jul 28 13:42:35 2021 +0900

    [SPARK-36318][SQL][DOCS] Update docs about mapping of ANSI interval types 
to Java/Scala/SQL types
    
    ### What changes were proposed in this pull request?
    1. Update the tables at 
https://spark.apache.org/docs/latest/sql-ref-datatypes.html about mapping ANSI 
interval types to Java/Scala/SQL types.
    2. Remove `CalendarIntervalType` from the table of mapping Catalyst types 
to SQL types.
    
    <img width="1028" alt="Screenshot 2021-07-27 at 20 52 57" 
src="https://user-images.githubusercontent.com/1580697/127204790-7ccb9c64-daf2-427d-963e-b7367aaa3439.png";>
    <img width="1017" alt="Screenshot 2021-07-27 at 20 53 22" 
src="https://user-images.githubusercontent.com/1580697/127204806-a0a51950-3c2d-4198-8a22-0f6614bb1487.png";>
    
    ### Why are the changes needed?
    To inform users which types from language APIs should be used as ANSI 
interval types.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Manually checking by building the docs:
    ```
    $ SKIP_RDOC=1 SKIP_API=1 SKIP_PYTHONDOC=1 bundle exec jekyll build
    ```
    
    Closes #33543 from MaxGekk/doc-interval-type-lang-api.
    
    Authored-by: Max Gekk <max.g...@gmail.com>
    Signed-off-by: Kousuke Saruta <saru...@oss.nttdata.com>
    (cherry picked from commit 1614d004174c1aeda0c1511d3cba92cf55fc14b0)
    Signed-off-by: Kousuke Saruta <saru...@oss.nttdata.com>
---
 docs/sql-ref-datatypes.md | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/sql-ref-datatypes.md b/docs/sql-ref-datatypes.md
index 89ffa34..d699bfe 100644
--- a/docs/sql-ref-datatypes.md
+++ b/docs/sql-ref-datatypes.md
@@ -125,6 +125,8 @@ You can access them by doing
 |**BooleanType**|Boolean|BooleanType|
 |**TimestampType**|java.sql.Timestamp|TimestampType|
 |**DateType**|java.sql.Date|DateType|
+|**YearMonthIntervalType**|java.time.Period|YearMonthIntervalType|
+|**DayTimeIntervalType**|java.time.Duration|DayTimeIntervalType|
 |**ArrayType**|scala.collection.Seq|ArrayType(*elementType*, 
[*containsNull]*)<br/>**Note:** The default value of *containsNull* is true.|
 |**MapType**|scala.collection.Map|MapType(*keyType*, *valueType*, 
[*valueContainsNull]*)<br/>**Note:** The default value of *valueContainsNull* 
is true.|
 |**StructType**|org.apache.spark.sql.Row|StructType(*fields*)<br/>**Note:** 
*fields* is a Seq of StructFields. Also, two fields with the same name are not 
allowed.|
@@ -153,6 +155,8 @@ please use factory methods provided in
 |**BooleanType**|boolean or Boolean|DataTypes.BooleanType|
 |**TimestampType**|java.sql.Timestamp|DataTypes.TimestampType|
 |**DateType**|java.sql.Date|DataTypes.DateType|
+|**YearMonthIntervalType**|java.time.Period|YearMonthIntervalType|
+|**DayTimeIntervalType**|java.time.Duration|DayTimeIntervalType|
 
|**ArrayType**|java.util.List|DataTypes.createArrayType(*elementType*)<br/>**Note:**
 The value of *containsNull* will be 
true.<br/>DataTypes.createArrayType(*elementType*, *containsNull*).|
 |**MapType**|java.util.Map|DataTypes.createMapType(*keyType*, 
*valueType*)<br/>**Note:** The value of *valueContainsNull* will be 
true.<br/>DataTypes.createMapType(*keyType*, *valueType*, *valueContainsNull*)|
 
|**StructType**|org.apache.spark.sql.Row|DataTypes.createStructType(*fields*)<br/>**Note:**
 *fields* is a List or an array of StructFields.Also, two fields with the same 
name are not allowed.|
@@ -230,7 +234,8 @@ The following table shows the type names as well as aliases 
used in Spark SQL pa
 |**StringType**|STRING|
 |**BinaryType**|BINARY|
 |**DecimalType**|DECIMAL, DEC, NUMERIC|
-|**CalendarIntervalType**|INTERVAL|
+|**YearMonthIntervalType**|INTERVAL YEAR, INTERVAL YEAR TO MONTH, INTERVAL 
MONTH|
+|**DayTimeIntervalType**|INTERVAL DAY, INTERVAL DAY TO HOUR, INTERVAL DAY TO 
MINUTE, INTERVAL DAY TO SECOND, INTERVAL HOUR, INTERVAL HOUR TO MINUTE, 
INTERVAL HOUR TO SECOND, INTERVAL MINUTE, INTERVAL MINUTE TO SECOND, INTERVAL 
SECOND|
 |**ArrayType**|ARRAY\<element_type>|
 |**StructType**|STRUCT<field1_name: field1_type, field2_name: field2_type, 
...><br/> **Note:** ':' is optional.|
 |**MapType**|MAP<key_type, value_type>|

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to