-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-10166][table] Replace commons.codec.binary.Base64 with java.util.Base64 #6863
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
Conversation
… flink-table Change-Id: I3cebb1dd9fa708c93186e31a3117f05a8059ba8c
|
cc @StefanRRichter @tillrohrmann . Plz help review on the fix of hadoopless sqlClient classNotFound issue. thanks |
|
Hi @leanken . Thank you for your contribution. I am afraid though it is not the right way to proceed with this bug. I think we should rather cut off usage of Also just to clarify why we relocate dependencies. The reason is not just so they do not clash with other dependencies of ours (e.g. from calcite as you said), but also so that Flink's users can use any arbitrary version of popular libraries. |
|
|
@dawidwys I will first have a look at the candidate replacement for <org.apache.commons.codec.Base64> for further discussion. |
|
ok. I see your point. I will update in the next commit for Base64 replacement. thanks. |
…mons-lang3 from flink-table
…64 and add TCase Change-Id: Id32aeee1dea89ca9309c67056f4864186823fca6
|
cc @dawidwys Updated commit. Replaced commons.codec.binary.Base64 with java.util.Base64, and basically I've search all reference of commons.codec.binary.Base64, all of them have been replaced with java.util.Base64. And the origin encodeBase64URLSafeString should use Base64.getUrlEncode as replace candidate. |
|
Just to confirm that the change did works. I catch the GeneratedCode from debugging. the origin org.apache.commons.codec.binary.Base64.decodeBase64 did switch into java.util.Base64.getUrlDecoder().decode |
|
let me fix TestCase build break first. |
…encodeBase64URLSafeString Change-Id: Ieb6d33a4c233361560137441c8d03a84207ba6fc
Change-Id: I12dda1a3d196e8e1bb630683572c6338f23ed88d
Change-Id: Idaa30b9b34749220951e15344cc54536fbb0f3f8
|
Kindly remind. @dawidwys |
|
Calling @dawidwys |
|
I tried to fix this issue once and for all in #6966. This PR had to be rebased to the new |
What is the purpose of the change
See. FLINK-10166.
Version 1. Fix sqlClient org.apache.commons.codec.binary.Base64 classNotFound issue on hadoopless binary.
Version 2. After discussed with dawidwys, we all agree that replace of the org.apache.commons.codec.binary.Base64 with other implementation to get rid of the dependency on commons-codec is a better approach.
Diagnose
The Exception stacktrace is quite straight-forward.
As I mentioned above, this error only happens at hadoopless binary because the TaskManagerRunner start without flink-shaded-hadoop2-uber-1.6.0.jar, and as for the flink-table component has a shaded relocation on org.apache.commons prefix. so in this case, neither the TaskManagerRunner nor the FlinkUserJar supply valid class definition for org.apache.commons.codec.binary.Base64
Proposal
version 1
I've went through the history code of the flink-table relocation. Supposed the purpose of the origin author is that, to avoid version conflict that Calcite might bring.
But, i have double check on the sub-dependency of calcite-core, only org.apache.commons.lang is sub-dependency of calcite-core, org.apache.commons.codec and org.apache.commons.lang3 in fact are inherited from flink-parent, so i think these two namespace no need to relocation.
In genernal, my proposal is to not relocation org.apache.commons.codec and org.apache.commons.lang3
version 2
Replace org.apache.commons.codec.binary.Base64 with java.util.Base64
Brief change log
Verifying this change
select count(distinct name) from (Values ('a'), ('b')) AS NameTable(name)[SUCCESS]Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation