Index.create() reports success and creates nothing: the compiler emits an empty string and the connector returns early
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start at the compiler path used by Index.create() and the connector's early return for a falsy operation. Trace the empty-string DDL flow and verify that unsupported index creation raises CompileError or NotImplementedError instead of reporting success; confirm the behavior with the Index.create() example and index inspection described in the issue.
Written by the indexing model from the issue text.
Description
Versions
- databend-sqlalchemy 0.5.5
- databend-driver 0.34.2
- SQLAlchemy 2.0.51
- Python 3.12.9, macOS
- Server:
datafuselabs/databend:v1.2.925-patch-4in Docker
What happens
Index("ix_t_b", table.c.b).create(conn)
raises nothing and creates nothing. The statement reaching the driver is the empty string, and the connector returns early for a falsy one — with a comment saying exactly that:
# ToDo - Fix this, which is preventing the execution of blank DDL such as CREATE INDEX
# statements which aren't currently supported
if not operation:
return
Afterwards inspect(conn).get_indexes(t) is empty and so is SHOW INDEXES.
Expected: a CompileError or NotImplementedError, so the caller finds out.
Why the silent version is the bad one
The caller is left holding an index name that doesn't exist — one that can't be listed, can't be dropped, and won't be used. Any tooling that creates an index and then reports it back to a user is now reporting something untrue. A refusal would have been fine; I'd have caught it in a minute.
What Databend does offer, measured on the live server
| statement | result |
|---|---|
ALTER TABLE t CLUSTER BY (b) |
accepted; SHOW CREATE TABLE then reads … ENGINE=FUSE CLUSTER BY linear(b) |
CREATE INVERTED INDEX iv ON t(b), b a STRING column |
accepted; shows as SYNC INVERTED INDEX iv (b) |
CREATE INVERTED INDEX iv ON t(a), a an INT column |
refused — Inverted index currently only support String and Variant type |
Neither is reflectable through get_indexes.
Suggested fix
Raise instead of emitting an empty string. Mapping Index onto CLUSTER BY or an inverted index where the column type allows it would be nice, but the raise is the part that matters — right now the failure is invisible.
- Dominant language
- Python
- Stars
- 15
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databendlabs/databend-sqlalchemy
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
databendlabs/databend-sqlalchemy#58 · 1 comment ·
All issues in databendlabs/databend-sqlalchemy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100