aboutsummaryrefslogtreecommitdiff
path: root/docs/sql-programming-guide.md
diff options
context:
space:
mode:
authorTijo Thomas <tijoparacka@gmail.com>2015-06-30 10:50:45 -0700
committerCheng Lian <lian@databricks.com>2015-06-30 10:50:45 -0700
commit9213f73a8ea09ae343af825a6b576c212cf4a0c7 (patch)
tree093e4f951a877c90f6435e2aeda1d1aff39bfaf7 /docs/sql-programming-guide.md
parentfbb267ed6fe799a58f88c2fba2d41e954e5f1547 (diff)
downloadspark-9213f73a8ea09ae343af825a6b576c212cf4a0c7.tar.gz
spark-9213f73a8ea09ae343af825a6b576c212cf4a0c7.tar.bz2
spark-9213f73a8ea09ae343af825a6b576c212cf4a0c7.zip
[SPARK-8615] [DOCUMENTATION] Fixed Sample deprecated code
Modified the deprecated jdbc api in the documentation. Author: Tijo Thomas <tijoparacka@gmail.com> Closes #7039 from tijoparacka/JIRA_8615 and squashes the following commits: 6e73b8a [Tijo Thomas] Reverted new lines 4042fcf [Tijo Thomas] updated to sql documentation a27949c [Tijo Thomas] Fixed Sample deprecated code
Diffstat (limited to 'docs/sql-programming-guide.md')
-rw-r--r--docs/sql-programming-guide.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/sql-programming-guide.md b/docs/sql-programming-guide.md
index 2786e3d2cd..88c96a9a09 100644
--- a/docs/sql-programming-guide.md
+++ b/docs/sql-programming-guide.md
@@ -1773,9 +1773,9 @@ the Data Sources API. The following options are supported:
<div data-lang="scala" markdown="1">
{% highlight scala %}
-val jdbcDF = sqlContext.load("jdbc", Map(
- "url" -> "jdbc:postgresql:dbserver",
- "dbtable" -> "schema.tablename"))
+val jdbcDF = sqlContext.read.format("jdbc").options(
+ Map("url" -> "jdbc:postgresql:dbserver",
+ "dbtable" -> "schema.tablename")).load()
{% endhighlight %}
</div>
@@ -1788,7 +1788,7 @@ Map<String, String> options = new HashMap<String, String>();
options.put("url", "jdbc:postgresql:dbserver");
options.put("dbtable", "schema.tablename");
-DataFrame jdbcDF = sqlContext.load("jdbc", options)
+DataFrame jdbcDF = sqlContext.read().format("jdbc"). options(options).load();
{% endhighlight %}
@@ -1798,7 +1798,7 @@ DataFrame jdbcDF = sqlContext.load("jdbc", options)
{% highlight python %}
-df = sqlContext.load(source="jdbc", url="jdbc:postgresql:dbserver", dbtable="schema.tablename")
+df = sqlContext.read.format('jdbc').options(url = 'jdbc:postgresql:dbserver', dbtable='schema.tablename').load()
{% endhighlight %}