-
Notifications
You must be signed in to change notification settings - Fork 38
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
executeQuery - column type inference #20
Comments
@jbguerraz Can you please assign this issue to me |
WIth pleasure @hardikbajaj :) Here to help as much as needed |
Hey @jbguerraz , I'm thinking of inferring column data type from druid itself. With the help of sqlTypeHeader, I'm thinking of inferring data type as per following algorithm
I'm not sure about Complex data type though. |
Hello @hardikbajaj and thank you!! that enhancement rocks :) Druid Web UI itselfs uses such query to display columns info in datasource details pane:
also, as per https://druid.apache.org/docs/latest/querying/segmentmetadataquery.html :
Interesting bits:
That would probably makes it better to use it to map that way:
Additionally, JSON queries are a bit faster than SQL ones as far as I've seen in past (probably less parsing time). Probably great to cache those datasources definitions for a period of time at least (like let's say 30 minutes by default ? could later be changed at datasource settings level ?) to avoid querying Druid for each request ? That would also be usable later on for providing autocomplete informations. WDYT? |
@hardikbajaj Thanks for working on this. |
Hey @jbguerraz ! Thanks for your feedback! For now I think, the sql api provides us a complete solution, where we can get the data type in Headers from Druid response only. @Ghazanfar-CFLT I'll make sure to refine the number types, and make default type as String |
@jbguerraz , This PR change would be required for making SQL query type asserting column type completely from druid. |
Hey @jbguerraz , in case you missed it, can we release latest go-druid client to be used by plugin? |
Rework the column type detect method. Eventually query Druid for columns data types.
The text was updated successfully, but these errors were encountered: