zero-one-group / geni

A Clojure dataframe library that runs on Spark
Apache License 2.0
283 stars 28 forks source link

Error when building uberjar with geni dependencies #281

Closed klausharbo closed 3 years ago

klausharbo commented 3 years ago

Info

Info Value
Operating System MacOS Catalina
Geni Version 0.0.33
JDK openjdk8, openjdk11
Spark Version 3.0.1

Problem / Steps to reproduce

When I try to build an uberjar which depends on geni I get an error

Execution error (NoSuchMethodError) at io.netty.channel.SingleThreadEventLoop/<init> (SingleThreadEventLoop.java:65).
io.netty.util.concurrent.SingleThreadEventExecutor.<init>(Lio/netty/util/concurrent/EventExecutorGroup;Ljava/util/concurrent/Executor;ZLjava/util/Queue;Lio/netty/util/concurrent/RejectedExecutionHandler;)V

The repo https://github.com/klausharbo/geni-uberjar-example reproduces the issue on my machine when I do lein uberjar

klausharbo commented 3 years ago

Just noticing that lein jar produces the same

anthony-khong commented 3 years ago

Hi @klausharbo, this is pretty bizarre, and I can't say I fully understand what's happening. But I believe you can fix it by adding:

io.netty/netty-all                    {:mvn/version "4.1.53.Final"}

to your deps.edn. I believe it has something to do with Clojure CLI tools fetching dependencies differently to Leiningen, because a similar example in lein does not have the same issue. I'll look into how to test for this, and make sure that it's documented on the README.md, so please do not close the issue just yet even if the above solves your problem!

klausharbo commented 3 years ago

It seems that the fix/workaround you propose does indeed address the compile error: I added the dependency you suggest which enables the uberjar to be built. Running

java -jar target/geni-uberjar-example-0.0.1-SNAPSHOT-standalone.jar example

produces a example.parquet file as it would from within the REPL. That is great and allows me to move forward.

Thanks a lot for taking a look at this so quickly.

anthony-khong commented 3 years ago

This should now be covered by this PR: https://github.com/zero-one-group/geni/pull/285

I'm closing this issue. I hope that's okay!