Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/18266#discussion_r137717807
--- Diff: examples/src/main/python/sql/datasource.py ---
@@ -177,6 +177,16 @@ def jdbc_dataset_example(spark):
.jdbc("jdbc:postgresql:dbserver", "schema.tablename",
properties={"user": "username", "password": "password"})
+ # Specifying dataframe column data types on read
+ jdbcDF3 = spark.read \
+ .format("jdbc") \
+ .option("url", "jdbc:postgresql:dbserver") \
+ .option("dbtable", "schema.tablename") \
+ .option("user", "username") \
+ .option("password", "password") \
+ .option("customDataFrameColumnTypes", "id DECIMAL(38, 0), name
STRING") \
--- End diff --
`readTableColumnTypes`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]