Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15975#discussion_r89946224
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala 
---
    @@ -209,6 +209,14 @@ class JDBCSuite extends SparkFunSuite
         conn.close()
       }
     
    +  // Check whether the tables are fetched in the expected degree of 
parallelism
    +  def checkNumPartitions(df: DataFrame, expectedNumPartitions: Int): Unit 
= {
    +    val explain = ExplainCommand(df.queryExecution.logical, extended = 
true)
    +    val plans = spark.sessionState.executePlan(explain).executedPlan
    +    val expectedMsg = 
s"${JDBCOptions.JDBC_NUM_PARTITIONS}=$expectedNumPartitions"
    --- End diff --
    
    instead of matching string, can we call `collect` on the logical plan and 
get the `JDBCRelation` to check the partitions directly?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to