kestra-io / plugin-jdbc

https://kestra.io/plugins/
Apache License 2.0
13 stars 12 forks source link

[DuckDB] Unable to upgrade to version 0.9.0 #165

Open loicmathieu opened 1 year ago

loicmathieu commented 1 year ago

Issue description

See upstream issue https://github.com/duckdb/duckdb-java/issues/14

anna-geller commented 1 year ago

https://github.com/duckdb/duckdb-java/issues/14

loicmathieu commented 11 months ago

Possible workaround: rebuilding the DuckDB driver.

git clone https://github.com/duckdb/duckdb.git
git checkout v0.9.2
GEN=ninja BUILD_ICU=1 BUILD_JDBC=1 BUILD_JEMALLOC=1 BUILD_JSON=1 STATIC_LIBCPP=1  make
mvn install:install-file -Dfile=build/debug/tools/jdbc/duckdb_jdbc.jar -DgroupId=org.duckdb  -DartifactId=duckdb_jdbc -Dversion=0.9.2-custombuild -Dpackaging=jar
richard-lennox commented 3 months ago

Are we able to give a try updating the org.duckdb::duckdb_jdbc drivers to the 1.0.0 release? I need some feature sets from the 1.0.0 release of duckdb, but unable to use. I've reverted to using a python script in the meantime, but ideally would prefer to use this plugin.

loicmathieu commented 3 months ago

@richard-lennox the upsteam issue at DuckDB side is not fixed in the new driver so we still cannot upgrade the driver

Ben8t commented 1 month ago

@loicmathieu @fhussonnois has a PR looking at PluginClassLoader 🤔 Does it open a new way to solve this ? https://github.com/kestra-io/kestra/issues/4621

loicmathieu commented 1 month ago

@Ben8t see my comment before yours, the issue is upstream, there is nothing we can do at our side except the workaround the DuckDB team give us which is literally to build the driver by ourself and embedds our own version which is a very bad idea.

Ben8t commented 3 weeks ago

Current Workaround for Open Source Users

Note: this is the current workaround, we're looking for a solution for the upstream issue on DuckDB Java driver. Please upvote there.

  1. Fork https://github.com/kestra-io/plugin-jdbc
  2. Change plugin-jdbc-duckdb/build.gradle plugin-jdbc-duckdb/build.gradle

implementation("org.duckdb:duckdb_jdbc:0.8.1") to implementation("org.duckdb:duckdb_jdbc:<DUCKDB_VERSION>")

Then you can build plugin jar with ./gradlew shadowJar. It created a plugin-jdbc-duckdb/build/libs/plugin-jdbc-duckdb-0.<VERSION>.0.jar.

Then you can build your own version of Kestra with this built plugin (see documentation).

Alternatively, using docker-compose, you can bind volumes like this:

...
services:
  kestra:
    volumes:
      - ./libs/plugin-jdbc-duckdb-0.17.0.jar:/app/plugins/plugin-jdbc-duckdb-0.<VERSION>.0.jar
     ...