Skip to content

Conversation

staticlibs
Copy link
Collaborator

This change adjusts the ResultSet#getString() behaviour for columns with composite types like STRUCT or LIST and also for extension types. This method now delegates the cast to the native cast to VARCHAR. When the extension (e.g. spatial) registers a cast for its own types to VARCHAR - this cast now will be triggered.

In many cases, like MAPs, the resulting representation is the same. But in some cases, like spatial's GEOMETRY the resulting string now can be correctly deserialized into its textual representation:

POINT (41.1 42.2)

instead of opaque (and useless one):

DuckDBBlobResult{buffer=java.nio.HeapByteBuffer[pos=0 lim=32 cap=32]}

Fixes: #298

This change adjusts the `ResultSet#getString()` behaviour for columns
with composite types like `STRUCT` or `LIST` and also for extension
types. This method now delegates the cast to the native cast to
`VARCHAR`. When the extension (e.g. `spatial`) registers a cast for its
own types to `VARCHAR` - this cast now will be triggered.

In many cases, like `MAP`s, the resulting representation is the same.
But in some cases, like `spatial`'s `GEOMETRY` the resulting string now
can be correctly deserialized into its textual representation:

```
POINT (41.1 42.2)
```

instead of opaque (and useless one):

```
DuckDBBlobResult{buffer=java.nio.HeapByteBuffer[pos=0 lim=32 cap=32]}
```

Fixes: duckdb#298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DuckDB-1.3.1.0] Geometry Functions return now DuckDBBlobResult instead of Text
1 participant