github-actions[bot] commented on code in PR #65329:
URL: https://github.com/apache/doris/pull/65329#discussion_r3572464752
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -3906,6 +3918,13 @@ public List<String>
visitIdentifierSeq(IdentifierSeqContext ctx) {
.collect(ImmutableList.toImmutableList());
}
+ @Override
+ public List<String> visitQualifiedName(QualifiedNameContext ctx) {
+ return ctx.identifier().stream()
+ .map(RuleContext::getText)
Review Comment:
`visitQualifiedName` keeps the raw token text for each path component, so
backquoted identifiers stay backquoted inside `ColumnPath`. A statement such as
MODIFY COLUMN m_scalar.`key` BIGINT has to quote `key`, but the leaf becomes
the literal token `` `key` ``; `resolveColumnPath` compares that against
Iceberg's pseudo-fields `key` and `value`, so it misses the intended MAP-key
rejection and falls into the generic value-path error instead. The same
raw-token issue affects quoted real fields such as info.`Metric` and quoted
`AFTER` references. Please normalize identifier components before building
`ColumnPath`/`ColumnPosition` (including unescaping doubled backticks) and add
parser/FE coverage for quoted nested components.
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java:
##########
@@ -894,18 +1028,96 @@ public void modifyColumn(ExternalTable dorisTable,
Column column, ColumnPosition
refreshTable(dorisTable, updateTime);
}
+ @Override
+ public void modifyColumn(ExternalTable dorisTable, ColumnPath columnPath,
Column column, ColumnPosition position,
+ long updateTime) throws UserException {
+ if (!columnPath.isNested()) {
+ modifyColumn(dorisTable, column, position, updateTime);
+ return;
+ }
+
+ Table icebergTable = IcebergUtils.getIcebergTable(dorisTable);
+ ResolvedColumnPath resolvedPath =
resolveColumnPath(icebergTable.schema(), columnPath, "modify");
+ NestedField currentCol = resolvedPath.getField();
+
+ validateCommonColumnInfo(column);
+ UpdateSchema updateSchema = icebergTable.updateSchema();
+
+ if (column.getType().isComplexType()) {
+ validateForModifyComplexColumn(column, currentCol,
columnPath.getFullPath());
+ applyComplexTypeChange(updateSchema, resolvedPath.getFullPath(),
currentCol.type(), column.getType());
+ if (column.isAllowNull()) {
+ updateSchema.makeColumnOptional(resolvedPath.getFullPath());
+ }
+ if (!Objects.equals(currentCol.doc(), column.getComment())) {
+ updateSchema.updateColumnDoc(resolvedPath.getFullPath(),
column.getComment());
+ }
+ } else {
+ validateForModifyColumn(column, currentCol,
columnPath.getFullPath());
+ Type icebergType =
IcebergUtils.dorisTypeToIcebergType(column.getType());
+ updateSchema.updateColumn(resolvedPath.getFullPath(),
icebergType.asPrimitiveType(), column.getComment());
+ if (column.isAllowNull()) {
+ updateSchema.makeColumnOptional(resolvedPath.getFullPath());
+ }
+ }
+
+ if (position != null) {
+ applyPosition(updateSchema, position,
resolvedPath.getColumnPath(), icebergTable.schema(), "modify");
+ }
+
+ try {
+ executionAuthenticator.execute(() -> updateSchema.commit());
+ } catch (Exception e) {
+ throw new UserException("Failed to modify nested column: " +
columnPath.getFullPath() + " in table: "
+ + icebergTable.name() + ", error message is: " +
e.getMessage(), e);
+ }
+ refreshTable(dorisTable, updateTime);
+ }
+
+ @Override
+ public void modifyColumnComment(ExternalTable dorisTable, ColumnPath
columnPath, String comment, long updateTime)
+ throws UserException {
+ Table icebergTable = IcebergUtils.getIcebergTable(dorisTable);
+ ResolvedColumnPath resolvedPath;
+ if (columnPath.isNested()) {
Review Comment:
`modifyColumnComment` still rejects direct list-element and map-value
comment targets. For `MODIFY COLUMN arr_scalar.element COMMENT ...`,
`columnPath.isNested()` sends the path into `validateNestedStructFieldPath`;
that resolves parent `arr_scalar` to a LIST and throws before
`updateColumnDoc("arr_scalar.element", ...)` can run. `m_scalar.value` hits the
same MAP-parent problem. The adjacent type-modify path uses `resolveColumnPath`
directly, so direct element/value fields are supported for type changes but not
for comments. Please resolve comment targets through the same canonical
resolver, while still rejecting MAP keys, and add coverage for direct list
element/map value comments.
--
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]