-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use schema registry information in CREATE TABLE (#536)
When ingesting data into ClickHouse via Quesma, the first insert can automatically create a corresponding table in ClickHouse (if a user didn't do it beforehand). That CREATE TABLE statement was previously based solely on the contents of the first inserted data (the first JSON). However, the information in that first JSON is often not sufficient to create a good ClickHouse schema. Prior to this change, the only way for the user to affect the CREATE TABLE was to perform it manually beforehand. Extend the CREATE TABLE generation code to also take into account the information in schema the registry. Therefore the user can have some control over the CREATE TABLE statement via the "mapping" configuration in the config file. In practice this allows for: 1. Overriding the type of column (for example the initial JSON might have int values, but now the user can specify they should be stored as floats instead) 2. Adding columns that are missing in the initial JSON One shortcoming of this solution is missing support for arrays. For example, `products.product_name: "text"` defined in "kibana_sample_data_ecommerce" is actually an array of text, but the configuration is not expressive enough to encode this fact yet. In such case the JSON type takes precedence over the user-specified configuration.
- Loading branch information
1 parent
ebeaa89
commit 7b84d19
Showing
13 changed files
with
164 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.