apache / apache/arrow-java

[Java] JDBC driver too large

未关闭
#120 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
94
派生
152
平均合并
3 天 16 小时
30 天内合并 PR
11

描述

### Describe the bug, including details regarding any error messages, version, and platform.

If you add flight-sql-jdbc-driver as a dependency to a java appllication it pulls in 70MB of dependencies including 8 platform specific versions of netty and 1000s of files. H2 database which includes a JDBC driver and a database engine is 2.5MB. If you want smaller, here is JDBC implemented as a single file (https://github.com/KxSystems/kdb/blob/master/c/jdbc.java), this is used by 100s of users globally.

I admire the idea of a common data format but tying it to a 70MB verbose implementation when someone just wants a java driver isn't convincing me.

Eclipse, apache, google, gson, flatbuffer - it's basically every popular java dependency in the world.

- **There's a 256kb suffix list text file from mozilla in there.** What's that for? No attempt has been made at crafting something beautiful. 256kb is 10% of the size of H2 database and JDBC driver.
- 13 MB for platform specific nettys is larger than 80% of other database drivers alone. (screenshot below)

![image](https://github.com/apache/arrow-java/assets/7273208/0a33e1c5-e6f2-48f0-9936-f8b42a11e64e)

mozilla\public-suffix-list.txt

```
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

// Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat,
// rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported.

// Instructions on pulling and using this list can be found at https://publicsuffix.org/list/.

// ===BEGIN ICANN DOMAINS===

// ac : http://nic.ac/rules.htm
ac
com.ac
edu.ac
gov.ac
net.ac
mil.ac
org.ac

// ad : https://en.wikipedia.org/wiki/.ad
ad
nom.ad

// ae : https://tdra.gov.ae/en/aeda/ae-policies
ae
co.ae
net.ae
org.ae
sch.ae
ac.ae
```

Platform specific netty takes 13MB.

![image](https://github.com/apache/arrow-java/assets/7273208/2cbe8008-b39f-4a37-9e26-b247f0733689)

### Component(s)

Java

贡献指南

打开贡献指南

调研方向

首先检查 flight-sql-jdbc-driver 的依赖树,重点关注 mozilla/public-suffix-list.txt 以及报告中提到的平台特定 Netty 构件。确认哪些依赖导致了报告中的大小,并检查 JDBC 驱动程序的打包入口点。在不破坏 Java JDBC 驱动程序的情况下,实现一项已达成共识且可量化的依赖占用缩减,才算完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
databases
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。