graphprotocol / graphprotocol/graph-node

[Feature] Better parsing of indexing SQL statements

オープン
#5,512 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement Stale
主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

説明

Description

Currently we parse indexing SQL statements with our own homegrown parser. It needs to be updated in order to support the new kinds of indexes. Discussion here shows some of deficiencies. In particular the fn is_same_kind_columns in index.rs has to jump through some hoops in order to compare if the two expressions are "kind of same". For instance BlockRangeLower and Unknown("lower(block_range) int4_minmax_multi_ops)"). Also the test generate_ddl() has a commented out line in the mock_thing_index_list for the same reason.

Related to this is generator of SQL statements that is not perfectly sanitising it's output, somewhat addressed in this.

One approach would be to extend the current parser to handle those cases. Other would be to use sqlparser or similar.

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No response

Some information to help us out
  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

index.rs の fn is_same_kind_columns と generate_ddl() のテストから始め、mock_thing_index_list にあるコメントアウトされたエントリも確認してください。リンク先の議論を確認し、現在のパーサーを拡張する場合と sqlparser または同様のパーサーを使用する場合を比較してください。新しいインデックス種別と BlockRangeLower のような式が、現在の回避策なしでパースおよび比較され、SQL 出力のサニタイズが適切に対処されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust, sql
領域
databases
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。