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

Minor performance improvement to JDBC batch inserts

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.1.0
    • Component/s: SQL
    • Labels:

      Description

      JDBC batch inserts currently are set to repeatedly retrieve the number of fields inside the row iterator:

      https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala#L598

      val numFields = rddSchema.fields.length

      This value does not change and can be set prior to the loop.

        Attachments

          Activity

            People

            • Assignee:
              blue666man John Muller
              Reporter:
              blue666man John Muller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified