@@ -32,10 +32,13 @@ enum DecimalSchemeMode {
3232 V2 ,
3333}
3434
35- /// The v1 decimal scheme, which the default [`CompressionSession`](crate::CompressionSession)
36- /// registers .
35+ /// The decimal scheme that only produces v1-compatible DBP arrays (does not compress wide
36+ /// decimals) .
3737pub ( crate ) static DECIMAL_V1 : DecimalScheme = DecimalScheme :: v1 ( ) ;
38- static DECIMAL_V2 : DecimalScheme = DecimalScheme :: v2 ( ) ;
38+
39+ /// The decimal scheme that produces both v1 and v2 compatible DBP arrays (compresses wide
40+ /// decimals).
41+ pub ( crate ) static DECIMAL_V2 : DecimalScheme = DecimalScheme :: v2 ( ) ;
3942
4043/// Compression scheme for decimal arrays via byte-part decomposition.
4144///
@@ -44,8 +47,8 @@ static DECIMAL_V2: DecimalScheme = DecimalScheme::v2();
4447/// significant part and up to three unsigned lower parts. Single-part arrays serialize as v1
4548/// in either mode, while arrays with lower parts serialize as v2.
4649///
47- /// The default uses v1. [`refine`](Scheme::refine) picks v2 when both decimal IDs are allowed
48- /// and v1 otherwise.
50+ /// The default uses v1. [`refine`](Scheme::refine) picks v2 when the v2 ID is allowed and v1
51+ /// otherwise.
4952#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
5053pub struct DecimalScheme {
5154 mode : DecimalSchemeMode ,
@@ -174,13 +177,13 @@ mod tests {
174177 use crate :: Scheme ;
175178 use crate :: SchemeExt ;
176179
177- /// Both variants refine to v2 exactly when both decimal IDs are allowed.
180+ /// Both variants refine to v2 exactly when the v2 ID is allowed.
178181 #[ rstest]
179182 #[ case:: neither( false , false , false ) ]
180183 #[ case:: v1( true , false , false ) ]
181- #[ case:: v2_only( false , true , false ) ]
184+ #[ case:: v2_only( false , true , true ) ]
182185 #[ case:: both( true , true , true ) ]
183- fn refine_picks_v2_only_when_both_ids_are_allowed (
186+ fn refine_picks_v2_when_v2_id_is_allowed (
184187 #[ case] allow_v1 : bool ,
185188 #[ case] allow_v2 : bool ,
186189 #[ case] expect_v2 : bool ,
0 commit comments