Schema creation based on SQL Query
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
Often times citus users share a query with us that causes an error message. With this query in hand it is time consuming to reproduce the issue as we do not have the schema of the user at hand. Sometimes it takes a lot of back and forth to either get their schema, or let the customer reduce the query in to a minimal viable reproduction of their problem.
Given that the error causing the query is often shared in the initial communication an engineer could also spend time to retrieve table names, column names and infer their types to create a representable schema. Types often don't need to match all to reproduce a problem so this could work but is very time consuming.
If we would have a tool that can assist an engineer in deducting a schema from a query we could speed up this whole process for our engineers and our users. Ideally this tool would be an interactive tool that will seed a partial schema (table names, column names) already. Sometimes it can link columns together as the same type or roughly the same type based on equality filters in the query. With this seeded into the tool the engineer can make some adjustions to the schema, eg. if a column contains the `id` suffix an engineer might decide this column is numeric, before loading the schema into an empty citus installation.
The goal would be to auto generate a schema that can successfully execute the query given at hand, not to make the best possible schema possible.
Contributor guide
Assessment
This issue has not been assessed yet.