In fact, a spark is not yet capable of compressing a predicate limit.
, , , , , , . .
:
val jdbcDF = spark.read.format("jdbc").options(
Map("url" -> "jdbc:oracle:thin:...",
"dbtable" -> "(select * from schema.table limit 200) as t",
"fetchSize" -> "5000",
"partitionColumn" -> "my_row_id",
"numPartitions" -> "16",
"lowerBound" -> "0",
"upperBound" -> "9999999"
)).load()
, , , .
:
val n : Int = ???
val jdbcDF = spark.read.format("jdbc").options(
Map("url" -> "jdbc:oracle:thin:...",
"dbtable" -> s"(select * from schema.table limit $n) as t",
"fetchSize" -> "5000",
"partitionColumn" -> "my_row_id",
"numPartitions" -> "16",
"lowerBound" -> "0",
"upperBound" -> "9999999"
)).load()
JIRA (SPARK-10899) , .
EDIT:. JIRA . - SPARK-12126.
, .