kestra-io / kestra-io/plugin-jdbc

DB2 plugin: BLOB/CLOB/NCLOB/XML columns return live JDBC locators instead of materialized content

Open
#1,004 0 comments 0 reactions 1 assignee Claimed by @karthikchundi-commits View on GitHub
area/backend area/plugin
Dominant language
Java
Stars
24
Forks
38
Avg merge
2d 3h
Merged PRs (30d)
22

Description

**Describe the bug**

`Db2CellConverter.convertCell()` returns the raw `java.sql.Blob`/`Clob`/`NClob`/`SQLXML` objects for these column types, instead of reading their actual content:

```java
case "blob" -> rs.getBlob(columnIndex);
case "clob" -> rs.getClob(columnIndex);
case "nclob" -> rs.getNClob(columnIndex);
case "xml" -> rs.getSQLXML(columnIndex);
```

These are live locators backed by the `ResultSet`'s underlying connection/statement, not self-contained values. Once rows are batched up for downstream processing (the normal pattern for a workflow engine reading query results) and the statement/connection has advanced or closed, calling `getBinaryStream()`/`getCharacterStream()`/`getString()` on that locator throws or returns garbage, depending on the DB2 JDBC driver's cursor-holdability configuration.

`OracleCellConverter` in the same plugin family already handles this correctly for BLOB/CLOB — it reads the full stream into a `byte[]`/`String` eagerly, while the `ResultSet` is still positioned on the row. The DB2 converter should do the same for BLOB/CLOB/NCLOB/SQLXML.

**Expected behavior**

BLOB columns should be returned as `byte[]`, and CLOB/NCLOB/XML columns as `String`, with content read immediately rather than deferred via a live locator.

**Additional context**

I have a fix ready (mirrors `OracleCellConverter`'s existing pattern, adds `Db2CellConverterTest` with mocked JDBC objects since the module's existing tests are all Testcontainers-based) and will open a PR referencing this issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.