apache / apache/datafusion-sqlparser-rs
IDENTIFIER literal with double quotes inside single quotes is parsed as one token instead of multiple identifiers
- Lingua principale
- Rust
- Stelle
- 3.5k
- Fork
- 772
- Merge medio
- 4g 9h
- PR unite (30g)
- 17
Descrizione
When running the following statement:
CREATE TABLE IDENTIFIER('"ORGDATA"."PUBLIC"."car_sales"')
the parser produces:
SingleQuotedString("\"ORGDATA\".\"PUBLIC\".\"car_sales\"")
It is treated as a single token (a literal string) instead of being parsed into three separate identifiers ("ORGDATA", "PUBLIC", "car_sales").
Since the IDENTIFIER function expects a literal, the content must be re-parsed.
**Suggestions:**
1. Expose a function that can take a SingleQuotedString like: '"ORGDATA"."PUBLIC"."car_sales"' and re-parse it into separate Ident tokens (ORGDATA, PUBLIC, car_sales).
2. change the tokenizer so that when IDENTIFIER is used with a quoted string containing double quotes, the inner content is tokenized as identifiers rather than treated as a raw single string.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia tracciando come il parser gestisce CREATE TABLE IDENTIFIER(...) e come i valori di SingleQuotedString raggiungono la funzione IDENTIFIER o il tokenizer. Riproduci l'esempio e determina se il risultato previsto consiste in tre identificatori tra virgolette; il lavoro è completato quando l'input non viene più trattato come un unico literal e il comportamento di parsing esistente rimane intatto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100