-
Notifications
You must be signed in to change notification settings - Fork 223
Conversation
a02437b
to
3fa5589
Compare
@sundy-li , I kept the |
Codecov Report
@@ Coverage Diff @@
## main #357 +/- ##
==========================================
+ Coverage 80.88% 81.23% +0.35%
==========================================
Files 326 326
Lines 21043 20969 -74
==========================================
+ Hits 17021 17035 +14
+ Misses 4022 3934 -88
Continue to review full report at Codecov.
|
3fa5589
to
c1d9914
Compare
c1d9914
to
15a0a53
Compare
Ok, that's reasonable. |
15a0a53
to
c4c34fb
Compare
@sundy-li @ritchie46 , I found a beautiful representation of the primitive types that simplifies a lot of code (-400 LOC). I pushed to this PR and updated the user guide accordingly. Something like enum PrimitiveType {
Int8,
Int16,
Int32,
Int64,
Int128,
...
DaysMs,
}
enum PhysicalType {
/// A Null with no allocation.
Null,
/// A boolean represented as a single bit.
Boolean,
/// An array where each slot has a known compile-time size.
Primitive(PrimitiveType),
...
} this allow us to write things like match values.data_type().to_physical_type() {
Primitive(primitive) => with_match_primitive_type!(primitive, |$T| {
let values = values.as_any().downcast_ref().unwrap();
Ok(Box::new(primitive::take::<$T, _>(&values, indices)))
}),
Utf8 => {
let values = values.as_any().downcast_ref().unwrap();
Ok(Box::new(utf8::take::<i32, _>(values, indices)))
}
... which shaved LOC via macros (and will likely do the same for dependents). Basically, instead of matching |
c7a47e1
to
a19765e
Compare
a19765e
to
082e615
Compare
Great, we have a similar macro like But your implementation is more graceful because the |
This PR is a refactor to enable (logical) extension types.
It is motivated by the design described by @sundy-li in #350.
backward incompatible changes:
Utf8Array
) now requireDataType
as argument offrom_data
,new_null
andnew_empty