JackieTien97 commented on code in PR #18683:
URL: https://github.com/apache/iotdb/pull/18683#discussion_r4082612307
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/role/LocalFileRoleAccessor.java:
##########
@@ -85,8 +85,34 @@ public class LocalFileRoleAccessor implements
IEntityAccessor {
protected final String entityDirPath;
// It might be a good idea to use a Version number to control upgrade
compatibility.
- // Now it's version 1
- protected static final int VERSION = 2;
+ // Version 3 appends an extra segment region after the RBAC privileges.
+ protected static final int VERSION = 3;
Review Comment:
**[P1] Preserve the legacy profile format for older Pipe receivers**
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/SchemaValidator.java:
##########
@@ -90,28 +96,46 @@ public static void validate(
}
}
- private static Set<QualifiedObjectName> getTargetTables(
- final WrappedInsertStatement insertStatement, final MPPQueryContext
context) {
- final Set<QualifiedObjectName> targetTables = new LinkedHashSet<>();
- if (insertStatement instanceof InsertRows) {
- for (final InsertRowStatement rowStatement :
- ((InsertRows)
insertStatement).getInnerTreeStatement().getInsertRowStatementList()) {
- final String database = AnalyzeUtils.getDatabaseName(rowStatement,
context);
- if (database == null) {
- throw new SemanticException(DATABASE_NOT_SPECIFIED);
- }
- targetTables.add(
- new QualifiedObjectName(unQualifyDatabaseName(database),
rowStatement.getTableName()));
- }
- } else {
- targetTables.add(
+ /**
+ * Resolves the target tables to check. Every row of a pipe batch is
considered, since its rows
+ * may target different tables; rows of any other insert share the same
table, so the first row is
+ * representative.
+ */
+ private static Set<QualifiedObjectName> resolveTargetTables(
+ final WrappedInsertStatement insertStatement,
+ final MPPQueryContext context,
+ final boolean fromPipeBatch) {
+ if (!(insertStatement instanceof InsertRows)) {
+ return Collections.singleton(
new QualifiedObjectName(
unQualifyDatabaseName(insertStatement.getDatabase()),
insertStatement.getTableName()));
}
+
+ final List<InsertRowStatement> rowStatements =
+ ((InsertRows)
insertStatement).getInnerTreeStatement().getInsertRowStatementList();
+ if (!fromPipeBatch) {
+ return rowStatements.isEmpty()
+ ? Collections.emptySet()
+ : Collections.singleton(resolveTargetTable(rowStatements.get(0),
context));
Review Comment:
**[P2] Validate every table in single-request Pipe row plans**
Validation: 72 focused unit tests passed, plus independent profile/snapshot,
32-combination procedure compatibility, and information-schema SPI probes. The
two findings use real serialization/readers/request construction; a complete
cross-version two-cluster run was not performed.
--
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]