[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
This commit is contained in:
parent
fbb267ed6f
commit
9213f73a8e
|
@ -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 %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue