-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat refactor shape builder #491
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #491 +/- ##
==========================================
+ Coverage 81.46% 81.49% +0.02%
==========================================
Files 89 89
Lines 19388 19547 +159
Branches 19388 19547 +159
==========================================
+ Hits 15795 15929 +134
- Misses 3175 3200 +25
Partials 418 418 ☔ View full report in Codecov by Sentry. |
Conformance comparison report
Number passing in both: 5587 Number failing in both: 842 Number passing in Base (1b19d11) but now fail: 0 Number failing in Base (1b19d11) but now pass: 0 |
0607b05
to
07a5c11
Compare
07a5c11
to
2ddd741
Compare
2ddd741
to
3e2b6c1
Compare
@@ -40,7 +40,9 @@ impl BindEvalExpr for EvalStringFn { | |||
F: Fn(&Box<String>) -> R + 'static, | |||
R: Into<Value> + 'static, | |||
{ | |||
UnaryValueExpr::create_typed::<{ STRICT }, _>([type_string!()], args, move |value| { | |||
// use DummyShapeBuilder, as we don't care about shape Ids for evaluation dispatch | |||
let mut bld = DummyShapeBuilder::default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the usage is going beyond just tests perhaps it's more appropriate to rename the DummyShapeBuilder
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a good idea. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how good these are, just putting them out there :)
PartiqlNoIdShapeBuilder
, NoIdShapeBuilder
, StaticIdShapeBuilder
@@ -5,7 +5,7 @@ use crate::eval::eval_expr_wrapper::{ | |||
use crate::eval::expr::{BindError, BindEvalExpr, EvalExpr}; | |||
use crate::eval::EvalContext; | |||
|
|||
use partiql_types::{PartiqlShapeBuilder, StructType}; | |||
use partiql_types::{DummyShapeBuilder, PartiqlShapeBuilder, StructType}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use partiql_types::{DummyShapeBuilder, PartiqlShapeBuilder, StructType}; | |
use partiql_types::DummyShapeBuilder; |
Based on clippy, it looks like PartiqlShapeBuilder
and StructType
are unused.
a915a13
to
eb7233c
Compare
I had issues practically using Shapes with Ids in an external project. I began fixing one thing, and ended up with this refactor.
Esentially, this removes usages of
Arc
s and allows control of theID
generation by using a builder that is threaded through type creation. While this is slightly less ergonomic, it allows serialization/deserialization, test cases, etc.In addition to these changes, I also think that we will need to add
ID
s to, for example, undefined and dynamic types, not just static in the future.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.