Skip to content

Commit

Permalink
[SPARK-29587][DOC][FOLLOWUP] Add SQL tab in the Data Types page
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Add the new tab `SQL` in the `Data Types` page.

### Why are the changes needed?
New type added in SPARK-29587.

### Does this PR introduce any user-facing change?
No.

### How was this patch tested?
Locally test by Jekyll.
![image](https://user-images.githubusercontent.com/4833765/73908593-2e511d80-48e5-11ea-85a7-6ee451e6b727.png)

Closes apache#27447 from xuanyuanking/SPARK-29587-follow.

Authored-by: Yuanjian Li <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
xuanyuanking authored and dongjoon-hyun committed Feb 8, 2020
1 parent 3db3e39 commit e1cd4d9
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions docs/sql-ref-datatypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,79 @@ from pyspark.sql.types import *
</tr>
</table>
</div>

<div data-lang="sql" markdown="1">

The following table shows the type names as well as aliases used in Spark SQL parser for each data type.

<table class="table">
<tr>
<th style="width:40%">Data type</th>
<th>SQL name</th></tr>
<tr>
<td> <b>BooleanType</b> </td>
<td> BOOLEAN </td>
</tr>
<tr>
<td> <b>ByteType</b> </td>
<td> BYTE, TINYINT </td>
</tr>
<tr>
<td> <b>ShortType</b> </td>
<td> SHORT, SMALLINT </td>
</tr>
<tr>
<td> <b>IntegerType</b> </td>
<td> INT, INTEGER </td>
</tr>
<tr>
<td> <b>LongType</b> </td>
<td> LONG, BIGINT </td>
</tr>
<tr>
<td> <b>FloatType</b> </td>
<td> FLOAT, REAL </td>
</tr>
<tr>
<td> <b>DoubleType</b> </td>
<td> DOUBLE </td>
</tr>
<tr>
<td> <b>DateType</b> </td>
<td> DATE </td>
</tr>
<tr>
<td> <b>TimestampType</b> </td>
<td> TIMESTAMP </td>
</tr>
<tr>
<td> <b>StringType</b> </td>
<td> STRING </td>
</tr>
<tr>
<td> <b>BinaryType</b> </td>
<td> BINARY </td>
</tr>
<tr>
<td> <b>DecimalType</b> </td>
<td> DECIMAL, DEC, NUMERIC </td>
</tr>
<tr>
<td> <b>CalendarIntervalType</b> </td>
<td> INTERVAL </td>
</tr>
<tr>
<td> <b>ArrayType</b> </td>
<td> ARRAY&lt;element_type&gt; </td>
</tr>
<tr>
<td> <b>StructType</b> </td>
<td> STRUCT&lt;field1_name: field1_type, field2_name: field2_type, ...&gt; </td>
</tr>
<tr>
<td> <b>MapType</b> </td>
<td> MAP&lt;key_type, value_type&gt; </td>
</tr>
</table>
</div>
</div>

0 comments on commit e1cd4d9

Please sign in to comment.