apache / apache/datafusion-sqlparser-rs

How to best add support for IDENTIFIER() clause

Ouverte
#1,412 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
3.5k
Forks
772
Merge moyen
4 j 9 h
PR mergées (30 j)
17

Description

I am thinking about adding support for the IDENTIFIER() clause (available in Snowflake and Databricks, see docs below).

In OpenLineage, I was able to [partially support it](https://github.com/OpenLineage/OpenLineage/pull/2999) by implementing visitors, but that only worked for a couple of statement types (SELECT, MERGE, UPDATE, DELETE) - the ones where i was able to access a TableFactor and not only ObjectName.

I believe, that in order to be able to recognize every use case of IDENTIFIER clause in the visitors I'd have to modify all the statements to provide access to TableFactor or some similar struct. This specific clause if problematic as it can appear anywhere an object name is referenced, and i believe there is no single place in the parser where i could add support for such a syntax. For now I am only interested in recognizing this clause in table names, so that limits the scope a little bit.

Does anyone have some ideas on how to best approach this problem? I'd like to use the limited resources I have in the best possible way and I feel like I'm missing something obvious here.

@iffyio, maybe you have some time and idea for that? You helped me with my previous PR 😄

Docs:
[Snowflake](https://docs.snowflake.com/en/sql-reference/identifier-literal)
[Databricks](https://docs.databricks.com/en/sql/language-manual/sql-ref-names-identifier-clause.html)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par suivre les visitors existants pour SELECT, MERGE, UPDATE et DELETE, en comparant les endroits où ils reçoivent un TableFactor plutôt que seulement un ObjectName. Examinez les représentations des instructions et les points d’entrée du parser afin de déterminer comment les utilisations de IDENTIFIER() pour les noms de tables peuvent être reconnues de manière cohérente ; le travail est terminé lorsqu’une approche a été convenue et que la couverture des types d’instructions concernés a été définie.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust, sql
Domaine
compilers, databases
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.