apache / apache/datafusion-sqlparser-rs

How to best add support for IDENTIFIER() clause

Abierto
#1,412 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
3.5k
Forks
772
Merge medio
4 d 9 h
PR fusionados (30 d)
17

Descripción

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)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza siguiendo los visitors existentes para SELECT, MERGE, UPDATE y DELETE, comparando dónde reciben un TableFactor frente a recibir únicamente un ObjectName. Revisa las representaciones de las sentencias y los puntos de entrada del parser para determinar cómo se pueden reconocer de forma coherente los usos de IDENTIFIER() para nombres de tabla; se considera terminado cuando se haya acordado un enfoque y se haya definido la cobertura para los tipos de sentencia relevantes.

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

Evaluación

Stack tecnológico
rust, sql
Área
compilers, databases
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.