prestodb / presto-go-client

A Presto client for the Go programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

please support nested structures

chch-onjack opened this issue · comments

presto supports the ROW type.
It seems it is not supported by this go driver, yet no error is reported to the caller.
I test all error code and nothing happens. It seems to be ignoring the data and be happy about it.
I've been able to use it without issues on other tables with simpler schema. :/

The row type is currently not supported. If anything, we should at least make it return an error.

About supporting nested structures: it's definitely possible but requires time for getting the code right and testing properly. I suspect that this opens doors to so many possible combinations that it may be hard to achieve decent support and stability.

That said, feel free to send PRs and we'll be happy to review and advice.

has there been any headway on this? Running into this issue.... Could you return a JSON of the nested object and then its on the user to implement the scan?

AFAIK there hasn't been any progress on this, but we're definitely open to contributions.

While the driver is dealing with the Presto response, that raw JSON is already available to the driver. It would be possible to allow users to Scan(emptyInterface) and get that raw JSON.

For some reason when I'm trying to parse things like ObjectIDs (mongo) or a couple other stuff (nested objects, "row" types, etc) it just fails silently and doesn't return anything. Having a JSON string be returned you could use the scan. I forked and I'm working on some of that now... I'll put a PR out if that seems like a decent solution.

Have you tried casting to string, and scanning on a string or []byte? At least that should serve as a temporary workaround.

Yeah that seems to be the direction i'm going.

Did it work? lmk if you have plans to contribute a patch or close this issue.

Going to close this issue with no resolution. Unless there is a backing PR there's no plan to work on this.