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

Ability to turn off auto commit in JDBC source for read only operations

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • 3.2.1
    • None
    • SQL
    • None

    Description

      Currently, all the jdbc connections on executors side work always with auto commit option set to true.

      However, there are cases where this mode makes hard to use JdbcRelationProvider at all, i.e. reading huge datasets from Postgres (a whole result set is collected regardless of a fetch size when autocommit is set to true https://jdbc.postgresql.org/documentation/91/query.html#query-with-cursor )

      So the proposal is following:

      1. Add a boolean option "autocommit" to JDBC Source allowing a user to turn off autocommit mode for read only operations.
      2. Add guards which prevent using this option in DML operations.  

       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            Koraseg Artem Kupchinskiy

            Dates

              Created:
              Updated:

              Slack

                Issue deployment