SQL processor: quoted table names and missing topics return zero rows with success

Abierto
#490 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go, kafka, sql

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

  1. Produce records to a topic, for example c-zstd with 2000 records, and to a topic whose name needs no quotes, for example kill1 with 3000 records.
  2. Start the SQL processor with KAFSQL_METADATA_DISCOVERY=s3 against that bucket.
  3. 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 24h and SELECT count(*) FROM "kill1" LAST 24h return 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).

Lenguaje dominante
Go
Estrellas
59
Forks
16
Merge medio
5 h 46 min
PR fusionados (30 d)
121

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de KafScale/platform

Todos los issues de KafScale/platform

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.