GitHub user GraceH opened a pull request:
https://github.com/apache/spark/pull/14683
[SPARK-16968]Add additional options in jdbc when creating a new table
## What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
In the PR, we just allow the user to add additional options when create a
new table in JDBC writer.
The options can be table_options or partition_options.
E.g., "CREATE TABLE t (name string) ENGINE=InnoDB DEFAULT CHARSET=utf8"
Here is the usage example:
```
df.write.option("createTableOptions", "ENGINE=InnoDB DEFAULT
CHARSET=utf8").jdbc(...)
```
## How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration
tests, manual tests)
Unit test has been added.
(If this patch involves UI changes, please attach a screenshot; otherwise,
remove this)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/GraceH/spark jdbc_options
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14683.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14683
----
commit b302b1c7ec75ae1e78d132f7ecdb9bb7f33816d4
Author: GraceH <[email protected]>
Date: 2016-08-09T06:47:51Z
Add additional options in jdbc when creating a new table
commit 6a3cb4226027e7d22b7606c0e890d258eb8da138
Author: GraceH <[email protected]>
Date: 2016-08-09T09:57:36Z
organize the code with better format and rename the option name
commit eb0656b1b0723e7e7d2fe9f3f9b0ca339772076f
Author: GraceH <[email protected]>
Date: 2016-08-09T10:09:37Z
fix code style issue
commit 57be055c542d1720bb9fd57810d4c26666593444
Author: GraceH <[email protected]>
Date: 2016-08-11T05:28:06Z
merge jdbc writer options to JDBCOptions
commit 4fb5e55a50531abf255169c275ad2ad2cf2d71f2
Author: GraceH <[email protected]>
Date: 2016-08-12T04:57:19Z
add the unit test for JDBCWriter with createTableOptions
commit 186a5828fddfdd9c6e2d778ff28b30d3b1d2c471
Author: GraceH <[email protected]>
Date: 2016-08-12T05:08:50Z
fix scala style issue
commit d0bdd35acfe8181612efdb22ac96280af70b354e
Author: GraceH <[email protected]>
Date: 2016-08-12T05:19:46Z
fix scala style issue with redundant spaces
commit 21b4278c2e6d46510645464ac083d83108693133
Author: GraceH <[email protected]>
Date: 2016-08-12T05:31:33Z
remove private[sql]
commit 5176fdb90e6ea0bc2b7cc4e1e5d36811d8403b93
Author: GraceH <[email protected]>
Date: 2016-08-12T07:23:34Z
change url and table to jdbcOptions' member var
commit 8360c2911b70aa628f8edba593e3764d3b07ca55
Author: Jie Huang <[email protected]>
Date: 2016-08-17T10:00:46Z
Document JDBC Writer options
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]