-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temporaily patch converters to fix support for LowCardinality strings #857
Conversation
Use the following command to run this PR with Docker at http://localhost:3000:
|
0a93073
to
90cf1e2
Compare
I think |
That is more or less how the original fix worked, however the Unfortunately, this is blocked on some failing tests in CI at the moment, but the test failures are intermittent and do not seem to occur locally, making this quite a tricky one to debug. We'll have more info ASAP, but for now I'm going to move this back to draft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have thoroughly poked through the plugin and sqlds code, and this is clearly the easiest fix for now. We have users who need LowCardinality(Nullable(String))
so we need to get this merged ASAP.
In the future, I would like to see more flexibility with Converter
type in sqlds. Ultimately what we need is a way to strip LowCardinality(
+ )
from the type string BEFORE it goes to sqlds. This could possibly be done in clickhouse-go
, or maybe by making a porxy interface for clickhouse-go
's SQL driver, but this is all so complicated. The easiest solution is to add these converters. Perhaps automatically.
It wouldn't hurt to dynamically build the array of converters and add a copy of each converter that is wrapped in LowCardinality
. Low Cardinality does not affect clients, only how the data is stored on the server.
A temporary workaround is remove LowCardinality
via CAST()
in the user's SQL.
TL;DR: This is good, we need this fix ASAP. Not sure what CI issues are failing but let me know if I can help.
90cf1e2
to
48b50a2
Compare
48b50a2
to
e8c030e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Hopefully we can get a better sqlds API for fixing this, but this works for now. Most LowCardinality
types are String
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just one nit in the comments!
e8c030e
to
5d28c1d
Compare
This is a temporary fix for #833. At the moment, the
sqlutil
package in the Plugin SDK does not correctly handle theLowCardinality
data types. I thought we'd fixed this in #814, but it turns out that theGetConverter()
function is not actually called by anything within the SDK or our code as expected.Until we can patch this upstream, I've added two extra converters for now, that can be removed when we can introduce more generic handling of these types.