Comments (7)
Record, ImmutableRow に FFR (や TCR) を持たせる構成だと、「SELECTの(aliasがある)ときだけFFRにエイリアスをセット」ということが型レベルで守られない。
Record, ImmutableRow はシンプルな Vec にしてカラムのラベル情報は持たず、
FieldIndex -> Set<FullFieldReference> -> (TableName, ColumnName) -> Schema -> 添字
という解決pathを通るのが良いんじゃないかな
from apllodb.
FFRは、本来DMLにしか出てこないもの(エイリアスが存在するのはDMLなので)。
そう考えると query-processor にFFRを閉じ込める発想も出てくるが、Recordがinstantiateされた段階でFieldIndexによるgetをしたいのも事実。
from apllodb.
RecordIterator を read 専用にした上で、
- RecordIterator が Vec を持つ
- RecordはRecordIterator中の Vec を参照する
- Record::get(FieldIndex) において、Vec の添字が解決される
- Recordの内部構造の添字が↑に一致
という感じでgetを実現するかな
from apllodb.
ExpressionがFFRを持つのは良いのか。
INSERT INTO t (id, c1, c2) SELECT t2.t_id, t2.c1 * 100, t2.c2 FROM s AS t2;
UPDATE t AS t1 set c1 = t1.c2 * 5;
みたいなSQLもあるから、ExpressionにはFFR持たせるべき。
from apllodb.
FFRの生成経路
SQL with Expression (DML) -> Parser -> AST -> AstTranslator
のみ。
Recordの生成経路
SELECT -> ... -> RecordIterator -> Record
のみ。read-only。
INSERTようには別途ValueList的なものを作ってあげる。
from apllodb.
クソデカリファクタになるので...
作業ロードマップ
- INSERT用に使う構造をRecordじゃないやつにする。ただし、
INSERT ... SELECT
に将来対応できるよう、Recordからの変換余地は残す。 - Record / RecordIterator 改造
- ImmutableRow / SqliteRowIterator 改造
- FFR::new の禁止
from apllodb.
Record / RecordIterator 改造
ImmutableRow / SqliteRowIterator 改造
を分けて取り組むと、RowIter -> RecordIter の変換で余計なロジックを書く必要があるので、これは一緒くたに取り組むしかなさそう
from apllodb.
Related Issues (20)
- PrimaryKey = ApparentPrimaryKey + Revision を作る HOT 1
- storage-engine における selection を整理して実装
- 自動シナリオテストをpassする
- warnをerrorとして扱うやつやめる
- 手元でclippyしてもCIで検出できるエラーが検出できない問題を何とかする HOT 1
- カバレッジ計測 HOT 1
- CIよくしたい
- ci: run cargo-deadlinks
- エラー型を整理 HOT 5
- `if bool { Some(some_inner) } else { None }` って書いている箇所を `bool::then()` で書き換える
- Log server errors
- ci: `coverage` job fails to compile HOT 2
- Documents for v0.1.0 HOT 3
- What are released?
- Establish policy on forward/backward compatibility
- create table で `integer` と小文字指定すると unreachable panic
- public repository
- Look into DataFusion as SQL processor
- Introduce thiserror crate for SqlState
- Fix lint error from Rust 1.54.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apllodb.