Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable MySQL Streaming #23

Closed
wants to merge 1 commit into from
Closed

Enable MySQL Streaming #23

wants to merge 1 commit into from

Conversation

locked-fg
Copy link

In Issue #21 the problem was that MySQL doesn't stream results.
The key issue here is that statement.setFetchSize(Integer.MIN_VALUE); needs to be performed on the statement in DBInputFormat's inner class DbRecordReader. And in the DBRecordReader's constructor there is the required change.

Before, the MySql client first read the complete result into ram and then handed it over to cascading. What you want is that results are streamed through the connection directly into cascading.

What I did:

  • extract the "create statement" part into a method "createStatement()" so that it can be overriden by subclasses of DBRecordReader
  • Created MySqlDBInputFormat which subclasses DBRecordReader and overloads the createStatement() and returns the according class (in getRecordReaderInternal)
  • change MySqlFactory so that it returns the new MySqlDBInputFormat class

@fs111
Copy link
Contributor

fs111 commented Sep 3, 2014

Thanks. Could you please squash the commits into one and remove commented out lines?

Before we can use your patch, you will have to sign the contributors agreement: http://files.concurrentinc.com/agreements/Concurrent_Contributor_Agreement.doc

Please sign it and send it back to me at andre[at]concurrentinc[dot]com

@locked-fg
Copy link
Author

Ah - can it be that I don't have to make another Pull Request? I just squashed the commits and force-pushed them. I also mailed the contrib.agreement to you

@fs111
Copy link
Contributor

fs111 commented Sep 3, 2014

yes, PR's update themselves.

@locked-fg
Copy link
Author

So - anything left to do for me? Just want to avoid that we're waiting for each other to do something

@fs111
Copy link
Contributor

fs111 commented Sep 3, 2014

I'll try to review and test it in the coming days. I will comment here, if something is missing.

@fs111
Copy link
Contributor

fs111 commented Sep 8, 2014

Integrated with some reformatting. Thanks!

@fs111 fs111 closed this Sep 8, 2014
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.

2 participants