Caideyipi commented on code in PR #18058:
URL: https://github.com/apache/iotdb/pull/18058#discussion_r3503114118
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/writeback/WriteBackSink.java:
##########
@@ -215,6 +325,30 @@ public void customize(
}
}
+ private void customizeTargetDatabase(final String targetDatabase) {
+ targetTableModelDatabaseName = null;
+ invalidTargetTableModelDatabaseName = null;
+ targetTreeModelDatabaseName = null;
+
+ if (PathUtils.isTableModelDatabase(targetDatabase)) {
+ targetTableModelDatabaseName =
targetDatabase.toLowerCase(Locale.ENGLISH);
+ targetTreeModelDatabaseName =
+ validateAndNormalizeTreeModelDatabaseName(
+ PathUtils.qualifyDatabaseName(targetTableModelDatabaseName));
+ return;
+ }
+
+ targetTreeModelDatabaseName =
validateAndNormalizeTreeModelDatabaseName(targetDatabase);
+ final String tableModelDatabaseName =
+
PathUtils.unQualifyDatabaseName(targetTreeModelDatabaseName).toLowerCase(Locale.ENGLISH);
+ try {
+ TableConfigTaskVisitor.validateDatabaseName(tableModelDatabaseName);
+ targetTableModelDatabaseName = tableModelDatabaseName;
+ } catch (final Exception e) {
+ invalidTargetTableModelDatabaseName = tableModelDatabaseName;
+ }
+ }
Review Comment:
Good point. The previous wording was inaccurate: with tree/table isolation,
a write-back sink task should only see one event model. I kept both normalized
target names because WriteBackSink only receives sink parameters during
validate/customize and does not know the isolated runtime model at that point;
the incoming event model still selects the target name later. This also
preserves support for table-style targets like target being rewritten to
root.target for tree events, while keeping the invalid table-model conversion
marker for tree targets such as root.target.db. I updated the code comment
accordingly.
--
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]