sql 2023-12-26

Hi, can anyone help me with fetching arrays/JSONs from Snowflake? 🙏 I tried following the documentation but couldn't get it to work, see screenshots

Thanks, that's what I tried to follow, but it's all about Postgress and I'm using Snowflake

sorry, I didn't notice Snowflake. Anyway, I still think you need to extend the protocol as described in the document. You need to check what parameters you have in the read-column-by-label method.

Ok I'll look into it, thanks a lot

namely, the second parameter is ResultSetMeta object, and the third is an integer index. Using these two, you can get a type of the column, and if it's "json" or something, decode the value from a string.

👍 1

Anyone using MySQL and also using virtual threads?

I decided to try the virtual threads option for Jetty 12 and enabled short stacktraces for pinned vthreads... and got thousands of these:

Thread[#62,ForkJoinPool-1-worker-1,5,CarrierThreads]
    com.mysql.cj.protocol.ReadAheadInputStream.read(ReadAheadInputStream.java:180) <== monitors:1
    com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:889) <== monitors:1
    com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:968) <== monitors:1
which suggests that the MySQL DB driver won't play nice with vthreads?

Yeah, just found two bugs in the MySQL driver tracker about it -- and an article saying the MySQL driver is just about the least virtual thread friendly one out there, for now 🙂

At least they're working on it. But I'm already having "fun" with New Relic and Jetty 12 (even without vthreads) so this may end up being moot anyway...