SQL processor: quoted table names and missing topics return zero rows with success
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, databases, stream-processing
Research direction
Start at the SQL processor’s parsing and execution path for table names, then trace how metadata discovery resolves topics and how missing topics are handled. Reproduce with the quoted and unquoted count(*) queries against existing and nonexistent topics using KAFSQL_METADATA_DISCOVERY=s3. Done when quoted existing topics return their counts and nonexistent topics return an error.
Written by the indexing model from the issue text.
Description
What happens
The SQL processor accepts a query, returns success, and yields zero rows when the table name is quoted, even if the topic has data. A topic that does not exist is handled the same way: success and zero rows, with no error.
Unquoted names of existing topics return the real count. The parser has not changed since v2.1.0 (confirmed on the #486 image and on main at fc9ed22). Clients that quote identifiers, which is required for a topic name that contains a hyphen, therefore get an empty result with no error.
Steps to reproduce
- Produce records to a topic, for example
c-zstdwith 2000 records, and to a topic whose name needs no quotes, for examplekill1with 3000 records. - Start the SQL processor with
KAFSQL_METADATA_DISCOVERY=s3against that bucket. - Run these queries:
SELECT count(*) FROM c-zstd LAST 24h;
SELECT count(*) FROM "c-zstd" LAST 24h;
SELECT count(*) FROM kill1 LAST 24h;
SELECT count(*) FROM "kill1" LAST 24h;
SELECT count(*) FROM nosuchtopic LAST 24h;
Actual
c-zstd: 2000
"c-zstd": 0 rows, status=success, segments=0, bytes=0
kill1: 3000
"kill1": 0 rows, status=success, segments=0, bytes=0
nosuchtopic: 0 rows, status=success, segments=0, bytes=0
Executor log:
query_complete type=select status=success duration_ms=1781 rows=1 segments=70 bytes=205258 query="SELECT count(*) FROM kill1 LAST 24h;"
query_complete type=select status=success duration_ms=172 rows=0 segments=0 bytes=0 query="SELECT count(*) FROM \"c-zstd\" LAST 24h;"
query_complete type=select status=success duration_ms=161 rows=0 segments=0 bytes=0 query="SELECT count(*) FROM \"kill1\" LAST 24h;"
query_complete type=select status=success duration_ms=171 rows=0 segments=0 bytes=0 query="SELECT count(*) FROM nosuchtopic LAST 24h;"
The quoted queries never scanned any segment. The same zero-row success for a quoted name happened on the #486 image as well.
Expected
SELECT count(*) FROM "c-zstd" LAST 24handSELECT count(*) FROM "kill1" LAST 24hreturn 2000 and 3000.- A query against a topic that does not exist fails with an error, rather than succeeding with zero rows.
Version
main at fc9ed229387ae7172a4e22711da27be82636037b (v2.2.0). Also present on f7137999a082af8b23d6bab96433c967eba1bc0e (#486).
- Dominant language
- Go
- Stars
- 59
- Forks
- 16
- Avg merge
- 5h 46m
- Merged PRs (30d)
- 121
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 KafScale/platform
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Iceberg processor: S3 discovery still lists every segment and rereads every footer on each pollOpen
Difficulty 4/5 3-5 days Newbie friendliness 58/100
Maintainers usually reply within 1 day
All issues in KafScale/platform
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opensandbox-group/OpenSandbox#3278 ·
Maintainers usually reply within 1 day
-
type:chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightgauge/nightgauge#3819 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jasonfen/terminal-space-program#1075 ·
Maintainers usually reply within 1 day
-
gui: a narrow window's gateway key row with a line under it wraps its faded badges onto blank linesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100