github-actions[bot] commented on code in PR #65329:
URL: https://github.com/apache/doris/pull/65329#discussion_r3610732007
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -4231,7 +4250,65 @@ public ColumnDefinition visitColumnDef(ColumnDefContext
ctx) {
? Optional.of(new
GeneratedColumnDesc(ctx.generatedExpr.getText(),
getExpression(ctx.generatedExpr)))
: Optional.empty();
return new ColumnDefinition(colName, colType, isKey, aggType,
nullableType, autoIncInitValue, defaultValue,
- onUpdateDefaultValue, comment, desc);
+ onUpdateDefaultValue, comment, ctx.comment != null, true,
desc);
+ }
+
+ @Override
+ public ColumnDefinitionWithPath
visitColumnDefWithPath(ColumnDefWithPathContext ctx) {
+ if (ctx.columnDef() != null) {
+ ColumnDefinition columnDefinition =
visitColumnDef(ctx.columnDef());
+ ColumnPath columnPath = parseColumnPath(ctx,
Collections.singletonList(columnDefinition.getName()));
+ return new ColumnDefinitionWithPath(columnDefinition, columnPath);
+ }
+
+ ColumnPath columnPath = parseColumnPath(ctx, ctx.colNames.stream()
+ .map(RuleContext::getText)
+ .collect(Collectors.toList()));
+ String colName = columnPath.getLeafName();
+ DataType colType = ctx.type instanceof PrimitiveDataTypeContext
+ ? visitPrimitiveDataType(((PrimitiveDataTypeContext) ctx.type))
+ : ctx.type instanceof ComplexDataTypeContext
+ ? visitComplexDataType((ComplexDataTypeContext)
ctx.type)
Review Comment:
[P1] Decode STRUCT member comments before persisting them
This new path routes nested complex types through `visitComplexDataType`,
but `visitComplexColType` still only strips the delimiters and calls
`escapeBackSlash`. Thus a valid child comment such as `COMMENT 'owner''s'` is
stored as `owner''s` and forwarded by `applyStructChange`;
`NO_BACKSLASH_ESCAPES` values are likewise decoded with the wrong mode. The
reverse path also emits the child comment without a quoted string literal.
Please use the same SQL-mode-aware decode/quote helpers as outer comments and
add nested STRUCT-member execute and toSql/reparse coverage.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]