-
Notifications
You must be signed in to change notification settings - Fork 614
Issue 2118 #2320
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
Issue 2118 #2320
Conversation
|
|
||
| public enum DefaultValue { | ||
| DEFAULT("Default"), | ||
| MATERIALIZED("MATERIALIZED"), |
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.
Should it be like Default - "Materialized" ?
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.
| EPHEMERAL("EPHEMERAL"), | ||
| ALIAS("ALIAS"); | ||
|
|
||
| public final String defaultValue; |
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.
May be lets rename it to kind or type just to avoid too many defaultValue in one place?
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.
See my last comment, I prefer to stick with ClickHouse documentation language
|


This pull request introduces support for handling default values in ClickHouse columns, including
MATERIALIZED,ALIAS, andEPHEMERALtypes. It adds new functionality to skip these columns during data insertion and ensures proper parsing and testing of default expressions. The most important changes are grouped below:Enhancements to
ClickHouseColumnclass:DefaultValueenum to represent different default types (DEFAULT,MATERIALIZED,EPHEMERAL,ALIAS) and associated fieldsdefaultValueanddefaultExpressionto theClickHouseColumnclass.defaultValueanddefaultExpressionin theClickHouseColumnclass.Changes to data insertion logic:
insertmethod inClient.javato skip columns with default values other thanDEFAULTduring data insertion.commitRowmethod inRowBinaryFormatWriter.javato similarly skip columns withMATERIALIZED,ALIAS, or other non-default values.Schema parsing improvements:
TableSchemaParserto parsedefault_typeanddefault_expressionproperties from table schema and set them inClickHouseColumn.New test cases:
testWriterWithMaterializeto validate insertion behavior with columns having various default types (MATERIALIZED,ALIAS,EPHEMERAL).insertSimplePOJOsWithMaterializeColumntest to verify POJO insertion withMATERIALIZEDandALIAScolumns.Additional utility class:
SimplePOJOclass with a method to generate table creation SQL for testing columns with default values and default expressions.## SummaryCloses #2118 #2025
Checklist
Delete items not relevant to your PR: