leanken opened a new pull request #6863: [FLINK-10166] skip relocation of commons-codes and commons-lang3 from flink-table URL: https://github.com/apache/flink/pull/6863 ## What is the purpose of the change See. [FLINK-10166](https://issues.apache.org/jira/browse/FLINK-10166). Fix sqlClient **org.apache.commons.codec.binary.Base64** classNotFound issue on hadoopless binary. ## Diagnose The Exception stacktrace is quite straight-forward. ``` ## Exception Message execute SQL statement. Reason: org.codehaus.commons.compiler.CompileException: Line 43, Column 10: Unknown variable or type "org.apache.commons.codec.binary.Base64" ``` 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** ``` <!-- commons-codec, commons-lang3, and commons-lang (from Calcite) --> <relocation> <pattern>org.apache.commons</pattern> <shadedPattern>org.apache.flink.table.shaded.org.apache.commons</shadedPattern> </relocation> ``` ## Proposal 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. * org.apache.commons.codec * org.apache.commons.lang * org.apache.commons.lang3 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** ## Brief change log * not relocation **org.apache.commons.codec** and **org.apache.commons.lang3** ## Verifying this change Since i have change the relocation behavior of **flink-table** component, its relative dependency are: * flink-sql-client * flink-examples-table I've also ran the example case under these two component to make sure the change did works. * sqlClient with hadoopless binary on `select count(distinct name) from (Values ('a'), ('b')) AS NameTable(name)` [SUCCESS] * org.apache.flink.table.examples.scala.WordCountTable [SUCCESS] * org.apache.flink.table.examples.scala.WordCountSQL [SUCCESS] * org.apache.flink.table.examples.scala.StreamTableExample [SUCCESS] * org.apache.flink.table.examples.scala.StreamSQLExample [SUCCESS] ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? (no) - If yes, how is the feature documented? (not documented)
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
