Github user MaxGekk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21173#discussion_r184807004
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala 
---
    @@ -1190,4 +1190,20 @@ class JDBCSuite extends SparkFunSuite
           assert(sql("select * from people_view").schema === schema)
         }
       }
    +
    +  test("SPARK-23856 Spark jdbc setQueryTimeout option") {
    +    val numJoins = 100
    +    val longRunningQuery =
    +      s"SELECT t0.NAME AS c0, ${(1 to numJoins).map(i => s"t$i.NAME AS 
c$i").mkString(", ")} " +
    +        s"FROM test.people t0 ${(1 to numJoins).map(i => s"join 
test.people t$i").mkString(" ")}"
    +    val df = spark.read.format("jdbc")
    +      .option("Url", urlWithUserAndPass)
    +      .option("dbtable", s"($longRunningQuery)")
    +      .option("queryTimeout", "1")
    --- End diff --
    
    It could be just `.option("queryTimeout", 1)`


---

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

Reply via email to