You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "hongzhi-gao (via GitHub)" <gi...@apache.org> on 2026/10/19 03:56:22 UTC

[PR] [Fix] Reject table inserts when all fields fail validation [iotdb]

hongzhi-gao opened a new pull request, #18908:
URL: https://github.com/apache/iotdb/pull/18908

   ## Description
   
   Reject table rows when schema validation or type conversion rejects every FIELD, instead of persisting their timestamps and TAGs. With partial insertion enabled, this example now returns `507: No column other than Time present, please check the request` and leaves no row:
   
   ```sql
   CREATE TABLE t (tag1 STRING TAG, s1 INT64 FIELD);
   INSERT INTO t(time, s1) VALUES(1, true);
   ```
   
   Filter rejected-only rows before device validation and partition lookup. If valid rows or FIELDs remain, continue partial insertion and preserve its diagnostic; explicitly supplied NULL FIELDs remain valid. Preserve a terminal schema error instead of overwriting it with the partial-insert diagnostic.
   
   This changes new-write behavior introduced by #18880. Existing persisted time-only rows and WAL recovery are unchanged.
   
   ## Verification
   
   - Confirmed the new SQL regression fails against the unmodified upstream/master build.
   - Targeted Maven verification passed: 9 UTs and 7 ITs, zero failures/errors/skips, using 1 ConfigNode + 1 DataNode. Covers SQL and Tablet rejection, exact error text, no rows before/after flush, no devices created for rejected Tablets, and surviving valid FIELDs/rows.
   - After adding an explicit NULL row to the mixed SQL regression, recompiled the final IT class and reran `partialInsertSQLTest` with JUnitCore against the reactor-built nodes: passed.
   - `mvn spotless:apply -o -pl iotdb-core/datanode,integration-test -Pwith-integration-tests -Ddevelocity.off=true` — passed.
   - `mvn test-compile -o -DskipTests -Ddevelocity.off=true` — passed, full reactor.
   - `mvn test-compile -o -DskipTests -Pwith-zh-locale -Ddevelocity.off=true` — passed, full reactor.
   - `git diff --check` — passed.
   
   Targeted Maven verification command:
   
   ```bash
   mvn verify -o '-Dtest=AnalyzeUtilsTest,SchemaValidatorTest' -Dsurefire.failIfNoSpecifiedTests=false '-Dit.test=IoTDBInsertTableIT#testRejectedOnlySqlFieldDoesNotWriteTime+testRejectedOnlyFieldDoesNotWriteTime+testRejectedFieldKeepsValidField,IoTDBSessionRelationalIT#partialInsertSQLTest+insertAllFieldDataTypeMismatchTest+insertRelationalTabletWithAutoCastTest+insertRelationalRowWithAutoCastTest' -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false -pl integration-test -am -PTableSimpleIT,with-integration-tests -Ddevelocity.off=true
   ```
   
   The pre-existing `insertRelationalRowWithAutoCastTest` invokes the Tablet helper; SQL coverage here comes from the actual SQL regression cases. Full suites, 1C3D, and crash/restart tests were not run.
   
   ---
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths.
   - [x] added integration tests.
   - [x] been tested in a test IoTDB cluster (1 ConfigNode + 1 DataNode).
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

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


Re: [PR] [Fix] Reject table inserts when all fields fail validation [iotdb]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #18908:
URL: https://github.com/apache/iotdb/pull/18908


-- 
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: reviews-unsubscribe@iotdb.apache.org

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