AMashenkov commented on code in PR #1109:
URL: https://github.com/apache/ignite-3/pull/1109#discussion_r977801077
##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/configuration/ColumnTypeValidatorImpl.java:
##########
@@ -53,11 +50,81 @@ public void validate(ColumnTypeValidator annotation,
ValidationContext<ColumnTyp
|| newType.precision() != oldType.precision()
|| newType.scale() != oldType.scale()
|| newType.length() != oldType.length()) {
- ctx.addIssue(new ValidationIssue(ctx.currentKey(), "Unsupported
column type change: " + ctx.currentKey()));
+ ColumnView columnView = ctx.getNewOwner();
+
+ assert columnView != null;
+
+ ctx.addIssue(new ValidationIssue(columnView.name(), "Column type
can't be changed"));
}
}
+ private void validateLength(ValidationContext<ColumnTypeView> ctx,
ColumnTypeView typeView) {
+ switch (typeView.type()) {
+ case "STRING":
+ case "BYTES":
+ case "BITMASK":
+ if (typeView.length() <= 0) {
+ ColumnView columnView = ctx.getNewOwner();
+
+ assert columnView != null;
+
+ ctx.addIssue(new ValidationIssue(columnView.name(),
"Length must by positive"));
Review Comment:
```suggestion
ctx.addIssue(new ValidationIssue(columnView.name(),
"Length must be positive"));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]