Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/18266#discussion_r137718217
--- Diff:
examples/src/main/scala/org/apache/spark/examples/sql/SQLDataSourceExample.scala
---
@@ -185,6 +185,10 @@ object SQLDataSourceExample {
connectionProperties.put("password", "password")
val jdbcDF2 = spark.read
.jdbc("jdbc:postgresql:dbserver", "schema.tablename",
connectionProperties)
+ // Specifying dataframe column data types on read
+ connectionProperties.put("customDataFrameColumnTypes", "id DECIMAL(38,
0), name STRING")
--- End diff --
`customSchema `
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]