yaooqinn commented on code in PR #46092:
URL: https://github.com/apache/spark/pull/46092#discussion_r1568168654
##########
docs/sql-data-sources-jdbc.md:
##########
@@ -1335,3 +1335,109 @@ as the activated JDBC Driver.
</tr>
</tbody>
</table>
+
+### Mapping Spark SQL Data Types to Oracle
+
+The below table describes the data type conversions from Spark SQL Data Types
to Oracle data types,
+when creating, altering, or writing data to an Oracle table using the built-in
jdbc data source with
+the Oracle JDBC as the activated JDBC Driver.
+
+<table>
+ <thead>
+ <tr>
+ <th><b>Spark SQL Data Type</b></th>
+ <th><b>Oracle Data Type</b></th>
+ <th><b>Remarks</b></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>BooleanType</td>
+ <td>NUMBER(1, 0)</td>
+ <td>BooleanType maps to NUMBER(1, 0) as BOOLEAN is introduced since
Oracle Release 23c</td>
+ </tr>
+ <tr>
+ <td>ByteType</td>
+ <td>NUMBER(3)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>ShortType</td>
+ <td>NUMBER(5)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>IntegerType</td>
+ <td>NUMBER(10)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>LongType</td>
+ <td>NUMBER(19)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>FloatType</td>
+ <td>NUMBER(19, 4)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>DoubleType</td>
+ <td>NUMBER(19, 4)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>DecimalType(p, s)</td>
+ <td>NUMBER(p,s)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>DateType</td>
+ <td>DATE</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>TimestampType</td>
+ <td>TIMESTAMP WITH LOCAL TIME ZONE</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>TimestampNTZType</td>
+ <td>TIMESTAMP</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>StringType</td>
+ <td>VARCHAR2(255)</td>
+ <td>For historical reason, a string value has maximum 255 characters</td>
+ </tr>
+ <tr>
+ <td>BinaryType</td>
+ <td>BLOB</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>CharType(n)</td>
+ <td>CHAR(n)</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>VarcharType(n)</td>
+ <td>VARCHAR2(n)</td>
Review Comment:
It's VARCHAR2 after #46091
It does not make any difference to the users, so I didn't add any remarks as
less is more.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]