File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed
main/scala/org/apache/spark/sql/execution/datasources/jdbc
test/scala/org/apache/spark/sql/jdbc Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,9 @@ the following case-insensitive options:
64
64
Example:<br>
65
65
<code>
66
66
spark.read.format("jdbc")<br>
67
-    .option("dbtable ", "(select c1, c2 from t1) as subq" )<br>
68
-    .option("partitionColumn ", "subq.c1" <br>
69
-    .load()
67
+ .option("url ", jdbcUrl )<br>
68
+ .option("query ", "select c1, c2 from t1") <br>
69
+ .load()
70
70
</code></li>
71
71
</ol>
72
72
</td>
Original file line number Diff line number Diff line change @@ -137,9 +137,13 @@ class JDBCOptions(
137
137
|the partition columns using the supplied subquery alias to resolve any ambiguity.
138
138
|Example :
139
139
|spark.read.format("jdbc")
140
- | .option("dbtable", "(select c1, c2 from t1) as subq")
141
- | .option("partitionColumn", "subq.c1"
142
- | .load()
140
+ | .option("url", jdbcUrl)
141
+ | .option("dbtable", "(select c1, c2 from t1) as subq")
142
+ | .option("partitionColumn", "c1")
143
+ | .option("lowerBound", "1")
144
+ | .option("upperBound", "100")
145
+ | .option("numPartitions", "3")
146
+ | .load()
143
147
""" .stripMargin
144
148
)
145
149
Original file line number Diff line number Diff line change @@ -1348,9 +1348,13 @@ class JDBCSuite extends QueryTest
1348
1348
|the partition columns using the supplied subquery alias to resolve any ambiguity.
1349
1349
|Example :
1350
1350
|spark.read.format("jdbc")
1351
- | .option("dbtable", "(select c1, c2 from t1) as subq")
1352
- | .option("partitionColumn", "subq.c1"
1353
- | .load()
1351
+ | .option("url", jdbcUrl)
1352
+ | .option("dbtable", "(select c1, c2 from t1) as subq")
1353
+ | .option("partitionColumn", "c1")
1354
+ | .option("lowerBound", "1")
1355
+ | .option("upperBound", "100")
1356
+ | .option("numPartitions", "3")
1357
+ | .load()
1354
1358
""" .stripMargin
1355
1359
val e5 = intercept[RuntimeException ] {
1356
1360
sql(
You can’t perform that action at this time.
0 commit comments