lowka commented on code in PR #5119:
URL: https://github.com/apache/ignite-3/pull/5119#discussion_r1936864798


##########
modules/system-view/src/main/java/org/apache/ignite/internal/systemview/utils/SystemViewUtils.java:
##########
@@ -141,8 +141,10 @@ private static ColumnParams 
systemViewColumnToColumnParams(SystemViewColumn<?, ?
             case STRING:
             case BYTES:
                 assert type instanceof VarlenNativeType : 
type.getClass().getCanonicalName();
+                VarlenNativeType varlenNativeType = (VarlenNativeType) type;
 
-                builder.length(((VarlenNativeType) type).length());
+                int maxLength = 
CatalogUtils.getMaxLength(typeSpec.asColumnType());
+                builder.length(Math.min(varlenNativeType.length(), maxLength));

Review Comment:
   NativeType's length is greater that the constant defined by both the 
IgniteTypeSystem and the CatalogUtils.
   



##########
modules/system-view/src/main/java/org/apache/ignite/internal/systemview/utils/SystemViewUtils.java:
##########
@@ -141,8 +141,10 @@ private static ColumnParams 
systemViewColumnToColumnParams(SystemViewColumn<?, ?
             case STRING:
             case BYTES:
                 assert type instanceof VarlenNativeType : 
type.getClass().getCanonicalName();
+                VarlenNativeType varlenNativeType = (VarlenNativeType) type;
 
-                builder.length(((VarlenNativeType) type).length());
+                int maxLength = 
CatalogUtils.getMaxLength(typeSpec.asColumnType());
+                builder.length(Math.min(varlenNativeType.length(), maxLength));

Review Comment:
   NativeType's length is greater than the constant defined by both the 
IgniteTypeSystem and the CatalogUtils.
   



-- 
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]

Reply via email to