-
Notifications
You must be signed in to change notification settings - Fork 56
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
JSONB, is not being set to its default value #1071
Conversation
Signed-off-by: msvinaykumar <[email protected]>
@chandrams this issue not able to reproduce locally as it requires DB size increase to existing DB without clean up command. |
create table IF NOT EXISTS kruize_recommendations (interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255), extended_data jsonb, version varchar(255), primary key (experiment_name, interval_end_time)) PARTITION BY RANGE (interval_end_time); | ||
create table IF NOT EXISTS kruize_results (interval_start_time timestamp(6) not null, interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255) , duration_minutes float(53) not null, extended_data jsonb, meta_data jsonb, version varchar(255), primary key (experiment_name, interval_end_time, interval_start_time)) PARTITION BY RANGE (interval_end_time); | ||
create table IF NOT EXISTS kruize_recommendations (interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255), extended_data jsonb , version varchar(255), primary key (experiment_name, interval_end_time)) PARTITION BY RANGE (interval_end_time); | ||
create table IF NOT EXISTS kruize_results (interval_start_time timestamp(6) not null, interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255) , duration_minutes float(53) not null, extended_data jsonb, meta_data jsonb DEFAULT NULL, version varchar(255), primary key (experiment_name, interval_end_time, interval_start_time)) PARTITION BY RANGE (interval_end_time); |
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.
Do we need to set DEFAULT NULL or extended_data jsonb as well?
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.
no extended_data cannot be set DEFAULT NULL, It should have values always.
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
@@ -312,6 +314,7 @@ public static KruizeResultsEntry convertExperimentResultToExperimentResultsTable | |||
Double.valueOf((experimentResultData.getIntervalEndTime().getTime() - | |||
experimentResultData.getIntervalStartTime().getTime()) / (60 * 1000)) | |||
); | |||
kruizeResultsEntry.setMeta_data(null); |
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.
Do we need to check datasource
here and set it to null if the user has not set it
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.
Yes, however, the 'datasource' element has not been implemented at the code level; it was only conceptualized during the design phase. To verify the existence of the datasource, we would need to declare that variable in the API object and handle JSON parsing accordingly. All these modifications can be implemented once the datasource is active. Currently, we have chosen to minimize changes to focus on bug fixes.
merged into MVP |
The potential issue is that after an increase in database size, the DataSource column, which is of type JSONB, is not being set to its default value. However, it allows for this if we perform a database cleanup. Therefore, the solution is to set the default value of the JSONB-type column to null.
created issue for same
#1065