You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morningman (via GitHub)" <gi...@apache.org> on 2023/04/30 13:55:54 UTC

[GitHub] [doris] morningman commented on a diff in pull request #18822: [fix](schema_change) remove shadow prefix of schema for tablesink

morningman commented on code in PR #18822:
URL: https://github.com/apache/doris/pull/18822#discussion_r1181235747


##########
fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java:
##########
@@ -212,7 +212,7 @@ private TOlapTableSchemaParam createSchema(long dbId, OlapTable table) {
             List<String> columns = Lists.newArrayList();
             List<TColumn> columnsDesc = Lists.newArrayList();
             List<TOlapTableIndex> indexDesc = Lists.newArrayList();
-            columns.addAll(indexMeta.getSchema().stream().map(Column::getName).collect(Collectors.toList()));
+            columns.addAll(indexMeta.getSchema().stream().map(Column::getNonShadowName).collect(Collectors.toList()));

Review Comment:
   The column with `__doris_shadow_` prefix can only be created when doing `modify column`.
   And most of `modify column` operation is not a "light schema change" operation.
   But there is an exception, which is doing "modify varchar column's length", which is a `modify column` operation
   and will do "light schema change".
   
   So I think we should handle it in `SchemaChangeHandler.processModifyColumn()`, to avoid creating column with
   shadow prefix if it is a light schema change, instead of modifying here.
   
   And on BE side, there will still be column with shadow prefix, eg, modify column without light schema change
   



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org