Uh oh!
There was an error while loading. Please reload this page.
[Spark-10625] [SQL] Spark SQL JDBC read/write is unable to handle JDBC Drivers that adds unserializable objects into connection properties - #8785
Conversation
There was a problem hiding this comment.
The indentation here seems off (you may wish to run ./dev/lint-scala)
JoshRosen
commented
Sep 17, 2015
Hey, do you mind giving this PR a descriptive title? Makes the PR queue easier to scan. |
tribbloid
commented
Sep 17, 2015
Does it look any better now? |
There was a problem hiding this comment.
this indentation is still a little funky, see https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide
There was a problem hiding this comment.
@tribbloid I think Holden's comment still stands -- see how other methods wrap args. I also don't think you need to fully-qualify scala.collection.Map here?
There was a problem hiding this comment.
+1 on Sean's comments. Also, could you add a one- or two-line comment to explain what's going on here? Maybe give this method Scaladoc?
holdenk
commented
Sep 18, 2015
Looks like good improvements, less duplicated code, although there are still some minor style issues. You might want to merge in the latest master branch so that tests can be run. |
tribbloid
commented
Sep 18, 2015
all fixed (except the PR, will fix soon), thanks a lot for pointing them out! |
tribbloid
commented
Sep 22, 2015
PR fixed as well, thanks a lot Holden! |
There was a problem hiding this comment.
Why does this need to be created twice? isn't props the same?
srowen
commented
Nov 27, 2015
I guess I'm missing why a deep copy solves a problem of an unserializable property value. It still exists in the copy right? |
tribbloid
commented
Nov 27, 2015
Hi Sean, the property value can only be mutated by JDBC driver's function to fetch the schema on Spark driver, after which it's no longer serializable. My deep copy is made before the mutation |
There was a problem hiding this comment.
Nit: most of the import changes in this PR are actually the wrong way; can you restore the ordering?
srowen
commented
Dec 5, 2015
@tribbloid are you still working on this? I had an outstanding question or two here |
tribbloid
commented
Dec 7, 2015
@srowen yeah, I'll reply shortly, sorry wasn't aware of the email for a week |
7f5df5e to
267afcaComparetribbloid
commented
Dec 7, 2015
@srowen thanks a lot for posting the problem in import declarations, I've already correct it and won't optimize import habitually. |
tribbloid
commented
Dec 7, 2015
@srowen for you second question: the connection property is deep copied twice to ensure that the original object is immutable. Reverting it breaks the scenario where a property is used in 2 JDBC write in short sequence. I haven't include this scenario into unit test yet, do you prefer me doing it? or this is not expected? |
srowen
commented
Dec 7, 2015
I don't get that -- what does the original object matter if it's copied here? and how would the copy change? |
tribbloid
commented
Dec 10, 2015
@srowen Sorry you are right, there is already a deep copy and I should just use that, will correct immediately |
There was a problem hiding this comment.
Same here; move this to the top with the other Scala import.
There was a problem hiding this comment.
OK, I'll merge after #10519 is closed, right now I see some changes that pretty much did what I did
There was a problem hiding this comment.
Hey @tribbloid, #10519 has now been merged, so I think things should be in a much more testable state now in case you want to revive this PR and try to get it merged.
There was a problem hiding this comment.
import scala.collection.JavaConverters._ moved to the top with other non-wildcard imports
tribbloid
commented
Jan 25, 2016
Good! Boots on the ground. |
tribbloid
commented
Jan 25, 2016
Rebased with minimal changes to code style (and reverted whitespace changes as well as correcting import order). All tests passed. Let's finish this |
JoshRosen
commented
Jan 26, 2016
Hey, there's still a bunch of review comments that I left which haven't been acknowledged or addressed! Mind replying to them? |
7a80214 to
7bae97cComparetribbloid
commented
Jan 27, 2016
Yes, all comments resolved. |
tribbloid
commented
Feb 2, 2016
Hi Josh, do you see any problem? The Jenkins should have it tested and its clean to be merged be now |
There was a problem hiding this comment.
scala import should be grouped together with line 22.
https://github.com/apache/spark/pull/8785/files#diff-5f0d0643fcfad315df0fdd7cae52dfaeR22
tribbloid
commented
Jun 14, 2016
Finally someone replied :) |
AmplabJenkins
commented
Jun 30, 2016
Can one of the admins verify this patch? |
tribbloid
commented
Jul 1, 2016
Please wait for me to address the conflicts, will do this after 2.0.0 preview main component become stable enough |
holdenk
commented
Jul 6, 2016
So 2.0.0-preview is already out and we are in RC2 so I wouldn't expect any big changes happening right now if you want to take the time to update the PR :) |
tribbloid
commented
Jul 6, 2016
Absolutely lady, & welcome to Toronto. On 2016-07-06 04:56 PM, Holden Karau wrote:
|
tribbloid
commented
Jul 9, 2016
All conflict fixed with minimal changes to original patch that has been peer-reviewed in Jan 2016. Request for merging. WARNING: DataFrameWriter Line 402 (https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala#L402) can use JDBCRelation.getEffectiveProperties Line106 but I didn't change it to minimize diff. Please advise if it has to be corrected. |
Spark SQL JDBC read/write is unable to handle JDBC Drivers that adds unserializable objects into connection properties add one more unit test fix JDBCRelation & DataFrameWriter to pass all tests revise scala style put driver replacement code into a shared function fix styling upgrade to master and resolve all related issues remove the useless second deep copy of properties rename test names to be more explicit minor refactoring based on Sean's suggestion move JavaConverters import to under object remove the redundant toSeq and pull up lines in brackets improve styling in UnserializableDriverHelper and JDBCRelation remove whitespace in JDBCRelation line 42 add back type qualifiers of parameter of getEffectiveProperties into JDBCRelation to allow mutable Map being used. fix a unit test error: DriverManager.getDrivers.asScala returns an iterator that can only be iterated once, this commit cast it into a list to be reusable reformat import & styling fix a API invocation errors remove several getEffectiveProperties invocations as deep copies are already implemented in some functions. change test name to start with "SPARK-10625"
rxin
commented
Dec 7, 2016
@tribbloid is this a problem that needs to be fixed? |
tribbloid
commented
Dec 7, 2016
via email
Hi Reynold,
Yes, by 1.6.2 it made some of the JDBC drivers (notably the one for SAP
HANA) to malfunction.
The fix is easy, though I haven't test if its already fixed in 2.0+.
Yours Peng …On 2016-12-07 12:04 AM, Reynold Xin wrote:
@tribbloid <https://github.com/tribbloid> is this a problem that needs
to be fixed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8785 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSDBd9p7cLc8MmfVv9-6WBhcwHpsz-2ks5rFj5cgaJpZM4F-xmq>.
|
srowen
commented
Dec 7, 2016
This needs a rebase and there are still outstanding review comments (minor ones) |
HyukjinKwon
commented
Feb 9, 2017
ping @tribbloid. Are you able to proceed the review comments? If not, it'd be better closed for now. |
@HyukjinKwon yeah, just need to rebase on 2.2-SNAPSHOT+ |
HyukjinKwon
commented
Feb 11, 2017
I am not supposed to decide what to merge but I left the command as I just found this seems not active to the review comments and I assumed that this PR is currently abandoned which the author happened to be not able to proceed further for now. I'd rebase/address the review comments and keep pinging the related guys here. |
Closesapache#16819Closesapache#13467Closesapache#16083Closesapache#17135Closesapache#8785Closesapache#16278Closesapache#16997Closesapache#17073Closesapache#17220
Closesapache#16819Closesapache#13467Closesapache#16083Closesapache#17135Closesapache#8785Closesapache#16278Closesapache#16997Closesapache#17073Closesapache#17220 Added: Closesapache#12059Closesapache#12524Closesapache#12888Closesapache#16061 Author: Sean Owen <sowen@cloudera.com> Closesapache#17386 from srowen/StalePRs.
Connection properties are now deep copied before they are used by JDBC Drivers, this solvs all problems in unit tests