apache / apache/arrow-java

JDBC driver does not support compressed IPC streams (ZSTD, LZ4) [FlightSQL]

Aperta
#926 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
help wanted Type: bug
Lingua principale
Java
Stelle
94
Fork
152
Merge medio
3g 16h
PR unite (30g)
11

Descrizione

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

**Component:** Flight SQL JDBC Driver
**Version:** 18.3.0

The `flight-sql-jdbc-driver` shaded JAR does not include compression support, causing connection failures when the Flight SQL server sends compressed IPC streams using ZSTD or LZ4 compression.

### Expected Behavior
The JDBC driver should be able to handle compressed IPC streams from Flight SQL servers, similar to how the direct Flight SQL client (`flight-sql` artifact) handles them.

### Actual Behavior
Connection fails with one of these errors depending on compression type used by server:

**ZSTD compression:**
```
java.lang.IllegalArgumentException: Please add arrow-compression module to use CommonsCompressionFactory for ZSTD
at org.apache.arrow.driver.jdbc.shaded.org.apache.arrow.vector.compression.NoCompressionCodec$Factory.createCodec(NoCompressionCodec.java:63)
```

**LZ4 compression:**
```
Arrow error: Invalid argument error: lz4 IPC compression requires the lz4 feature
```

### Steps to Reproduce

1. Set up a Flight SQL server that uses compression (ZSTD or LZ4)
2. Try to connect using the JDBC driver:
String url = "jdbc:arrow-flight-sql://localhost:5127?useEncryption=false";
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM table");
// Fails with compression error
### Workaround
Currently, either:
1. Disable compression on the server side, OR
2. Use the direct Flight SQL client API (`flight-sql` and `flight-core` artifacts) instead of JDBC

### Additional Context
- Direct Flight SQL client works fine with compression
- This affects any Flight SQL server that enables compression by default
- JDBC drivers should be able to handle all protocol features transparently

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia confrontando le dipendenze incluse nello shaded JAR di flight-sql-jdbc-driver con gli artefatti flight-sql e flight-core, quindi riproduci la connessione JDBC a un server che utilizza la compressione ZSTD o LZ4. Il lavoro è completato quando il driver JDBC si connette e legge il risultato senza errori di compressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.