You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7469e38
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](lance) Reject blank Lance index names in CREATE and DROP INDEX
### What problem does this PR solve?
Issue Number: #66497
Related PR: #67201
Problem Summary: Nereids accepts an empty backquoted identifier, so CREATE INDEX `` and DROP INDEX `` reach Lance validation with an empty index name. validateCreateIndex only bounded names over 64 UTF-8 bytes, and the Directory DROP path returned the typed unsupported error before DropIndexOp.validate() could run its empty-name check, masking malformed SQL as an unsupported operation; if admission later reuses this validator, an empty logical name could reach the durable job and same-name fence.
Add a shared Lance index-name validator rejecting null/empty names and names over 64 UTF-8 bytes, invoke it for Directory CREATE and DROP, and add command-level coverage for empty quoted names. The REST path retains its fail-fast unsupported response before database/table metadata resolution.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- LanceIndexMutationValidatorTest
- AlterTableCommandLanceIndexTest
- CreateIndexParserTest
- AlterTableCommandTest
- IndexDefinitionTest
- Regression suite test_lance_index_ddl (external docker env, runs in CI)
- Behavior changed: Yes. Blank Lance index names now fail with "index name cannot be empty" instead of the unsupported-operation error.
- Does this need documentation: No
Copy file name to clipboardExpand all lines: fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/commands/AlterTableCommandLanceIndexTest.java
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -252,6 +252,12 @@ public void testRestCatalogMessagesFireFirst() throws Exception {
252
252
+ " (c) USING BTREE"));
253
253
Assertions.assertEquals("DROP INDEX is not supported for Lance REST catalogs",
254
254
runAndGetMessage("DROP INDEX idx ON " + CTL + "." + DB + "." + TBL));
255
+
// The REST fail-fast precedes even the index-name bounds.
256
+
Assertions.assertEquals("CREATE INDEX is not supported for Lance REST catalogs",
257
+
runAndGetMessage("CREATE INDEX `` ON " + CTL + "." + DB + "." + TBL
258
+
+ " (v) USING ANN " + VALID_ANN_PROPERTIES));
259
+
Assertions.assertEquals("DROP INDEX is not supported for Lance REST catalogs",
260
+
runAndGetMessage("DROP INDEX `` ON " + CTL + "." + DB + "." + TBL));
0 commit comments