Skip to content

Conversation

@mariusvniekerk
Copy link
Member

Reference: https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor
In order for PostgreSQL to honor the fetchSize non-zero setting, its Connection.autoCommit needs to be set to false. Otherwise, it will just quietly ignore the fetchSize setting.

This adds a new side-effecting dialect specific beforeFetch method that will fire before a select query is ran.

Reference: https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor
In order for PostgreSQL to honor the fetchSize non-zero setting, its Connection.autoCommit needs to be set to false. Otherwise, it will just quietly ignore the fetchSize setting.

This adds a new side-effecting dialect specific beforeFetch method that will fire before a select query is ran.
@marmbrus
Copy link
Contributor

ok to test

@SparkQA
Copy link

SparkQA commented Nov 20, 2015

Test build #46446 has finished for PR 9861 at commit 4649766.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this will fail to close the connection now if a Throwable occurs during commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to do anything special for throwable vs Exception or just change it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just thinking of using finally, and bringing the inner if statement inside the try to keep it tidy.

@SparkQA
Copy link

SparkQA commented Nov 23, 2015

Test build #46538 has finished for PR 9861 at commit dbb2a64.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should catch nonfatal - i will fix it when merging.

@rxin
Copy link
Contributor

rxin commented Nov 27, 2015

LGTM - going to merge it.

asfgit pushed a commit that referenced this pull request Nov 27, 2015
Reference: https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor
In order for PostgreSQL to honor the fetchSize non-zero setting, its Connection.autoCommit needs to be set to false. Otherwise, it will just quietly ignore the fetchSize setting.

This adds a new side-effecting dialect specific beforeFetch method that will fire before a select query is ran.

Author: mariusvniekerk <[email protected]>

Closes #9861 from mariusvniekerk/SPARK-11881.

(cherry picked from commit b63938a)
Signed-off-by: Reynold Xin <[email protected]>
@asfgit asfgit closed this in b63938a Nov 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants