Proposal for sqlparser-rs 2.0

Ouverte
#2,893 33 commentaires 4 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
15/100
Type d'issue
Refactorisation
Clarté
À clarifier
Activité
Active
Stack technique
rust

Piste de recherche

The proposal describes a broad sqlparser-rs 2.0 redesign, but names no files, tests, or entry points to start from. Read the issue thread to understand the community’s response and the proposed design; the goal would be a decided path for the 2.0 work, with parity against v1 and the described correctness fixes.

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

Description

Databricks Hive Spark

Over the weekend, I started from a clean slate and implemented a new version of the sqlparser-rs crate using the design that I had originally wanted but did not know how to build (I was still quite new to Rust at the time).

The new version has one trait per dialect and all dialect-specific parsing lives in that trait. There is no longer one huge "core" parser containing conditional logic for different dialects. Related dialects can also share logic. For example, the Hive and Databricks dialects both call into the Spark dialect for common pieces.

The new version also has ~10x fewer memory allocations (no more copying Strings everywhere) and is ~10x faster.

I am nearly finished porting all of the existing dialects over. The actual parsing code is taken from the current implementation, so that is not re-written. I have ported over all the tests as well, and am working towards 100% parity with v1, although v2 contains quite a lot of correctness fixes compared to v1.

What is the appetite in the community for me pushing this to a new 2.0 branch in the Apache repo?

Another option would be for me to file a huge issue explaining the design in detail, and let the community rebuild it.

WDYT?

Langage dominant
Rust
Étoiles
3.5k
Forks
805
Merge moyen
2 j 3 h
PR mergées (30 j)
116

Préparer son environnement

  • Aucun Dockerfile ni fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/datafusion-sqlparser-rs

Toutes les issues de apache/datafusion-sqlparser-rs

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

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