Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-38915

Log executed SQL queries

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.2.1
    • None
    • Spark Core
    • None

    Description

      When Spark issues an SQL query to the database through JDBC, log (at debug or info level) this query in order to be able to grab it. This is useful to check the performance of this query, running a SQL explain plan with the appropriate tool.
      As SQL queries are sometimes generated, it is sometimes hard to predict what query Spark will sent to the database.

      Example: I would like to watch this query https://github.com/apache/spark/blob/v3.2.1/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala#L352

      Attachments

        Activity

          People

            Unassigned Unassigned
            gquintana GĂ©rald Quintana
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: