Skip to content

Commit

Permalink
Fix error example
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyum committed Nov 28, 2018
1 parent 09a91d9 commit e2d8229
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/sql-data-sources-jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ the following case-insensitive options:
Example:<br>
<code>
spark.read.format("jdbc")<br>
&nbsp&nbsp .option("dbtable", "(select c1, c2 from t1) as subq")<br>
&nbsp&nbsp .option("partitionColumn", "subq.c1"<br>
&nbsp&nbsp .load()
.option("url", jdbcUrl)<br>
.option("query", "select c1, c2 from t1")<br>
.load()
</code></li>
</ol>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ class JDBCOptions(
|the partition columns using the supplied subquery alias to resolve any ambiguity.
|Example :
|spark.read.format("jdbc")
| .option("dbtable", "(select c1, c2 from t1) as subq")
| .option("partitionColumn", "subq.c1"
| .load()
| .option("url", jdbcUrl)
| .option("dbtable", "(select c1, c2 from t1) as subq")
| .option("partitionColumn", "c1")
| .option("lowerBound", "1")
| .option("upperBound", "100")
| .option("numPartitions", "3")
| .load()
""".stripMargin
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1348,9 +1348,13 @@ class JDBCSuite extends QueryTest
|the partition columns using the supplied subquery alias to resolve any ambiguity.
|Example :
|spark.read.format("jdbc")
| .option("dbtable", "(select c1, c2 from t1) as subq")
| .option("partitionColumn", "subq.c1"
| .load()
| .option("url", jdbcUrl)
| .option("dbtable", "(select c1, c2 from t1) as subq")
| .option("partitionColumn", "c1")
| .option("lowerBound", "1")
| .option("upperBound", "100")
| .option("numPartitions", "3")
| .load()
""".stripMargin
val e5 = intercept[RuntimeException] {
sql(
Expand Down

0 comments on commit e2d8229

Please sign in to comment.