@@ -14,7 +14,7 @@ pub(crate) fn partial_logical_to_value(plan: &PartialLogicalPlan) -> Value {
14
14
match plan {
15
15
PartialLogicalPlan :: UnMaterialized ( group_id) => {
16
16
// For unmaterialized logical operators, we create a `Value` with the group ID.
17
- Value ( Logical ( UnMaterialized ( hir:: GroupId ( group_id. 0 ) ) ) )
17
+ Value :: new ( Logical ( UnMaterialized ( hir:: GroupId ( group_id. 0 ) ) ) )
18
18
}
19
19
PartialLogicalPlan :: Materialized ( node) => {
20
20
// For materialized logical operators, we create a `Value` with the operator data.
@@ -24,7 +24,7 @@ pub(crate) fn partial_logical_to_value(plan: &PartialLogicalPlan) -> Value {
24
24
children : convert_children_to_values ( & node. children , partial_logical_to_value) ,
25
25
} ;
26
26
27
- Value ( Logical ( Materialized ( LogicalOp :: logical ( operator) ) ) )
27
+ Value :: new ( Logical ( Materialized ( LogicalOp :: logical ( operator) ) ) )
28
28
}
29
29
}
30
30
}
@@ -35,7 +35,7 @@ pub(crate) fn partial_physical_to_value(plan: &PartialPhysicalPlan) -> Value {
35
35
PartialPhysicalPlan :: UnMaterialized ( goal) => {
36
36
// For unmaterialized physical operators, we create a `Value` with the goal
37
37
let hir_goal = cir_goal_to_hir ( goal) ;
38
- Value ( Physical ( UnMaterialized ( hir_goal) ) )
38
+ Value :: new ( Physical ( UnMaterialized ( hir_goal) ) )
39
39
}
40
40
PartialPhysicalPlan :: Materialized ( node) => {
41
41
// For materialized physical operators, we create a Value with the operator data
@@ -45,7 +45,7 @@ pub(crate) fn partial_physical_to_value(plan: &PartialPhysicalPlan) -> Value {
45
45
children : convert_children_to_values ( & node. children , partial_physical_to_value) ,
46
46
} ;
47
47
48
- Value ( Physical ( Materialized ( PhysicalOp :: physical ( operator) ) ) )
48
+ Value :: new ( Physical ( Materialized ( PhysicalOp :: physical ( operator) ) ) )
49
49
}
50
50
}
51
51
}
@@ -54,9 +54,9 @@ pub(crate) fn partial_physical_to_value(plan: &PartialPhysicalPlan) -> Value {
54
54
/// Converts a [`PartialPhysicalPlan`] with its cost into a [`Value`].
55
55
pub ( crate ) fn costed_physical_to_value ( plan : PartialPhysicalPlan , cost : Cost ) -> Value {
56
56
let operator = partial_physical_to_value ( & plan) ;
57
- Value ( Tuple ( vec ! [
57
+ Value :: new ( Tuple ( vec ! [
58
58
partial_physical_to_value( & plan) ,
59
- Value ( Literal ( Float64 ( cost. 0 ) ) ) ,
59
+ Value :: new ( Literal ( Float64 ( cost. 0 ) ) ) ,
60
60
] ) )
61
61
}
62
62
@@ -65,15 +65,15 @@ pub(crate) fn costed_physical_to_value(plan: PartialPhysicalPlan, cost: Cost) ->
65
65
pub ( crate ) fn logical_properties_to_value ( properties : & LogicalProperties ) -> Value {
66
66
match & properties. 0 {
67
67
Some ( data) => properties_data_to_value ( data) ,
68
- Option :: None => Value ( None ) ,
68
+ Option :: None => Value :: new ( None ) ,
69
69
}
70
70
}
71
71
72
72
/// Converts [`PhysicalProperties`] into a [`Value`].
73
73
pub ( crate ) fn physical_properties_to_value ( properties : & PhysicalProperties ) -> Value {
74
74
match & properties. 0 {
75
75
Some ( data) => properties_data_to_value ( data) ,
76
- Option :: None => Value ( None ) ,
76
+ Option :: None => Value :: new ( None ) ,
77
77
}
78
78
}
79
79
@@ -104,7 +104,7 @@ where
104
104
. map ( |child| match child {
105
105
Child :: Singleton ( item) => converter ( item) ,
106
106
Child :: VarLength ( items) => {
107
- Value ( Array ( items. iter ( ) . map ( |item| converter ( item) ) . collect ( ) ) )
107
+ Value :: new ( Array ( items. iter ( ) . map ( |item| converter ( item) ) . collect ( ) ) )
108
108
}
109
109
} )
110
110
. collect ( )
@@ -118,32 +118,34 @@ fn convert_operator_data_to_values(data: &[OperatorData]) -> Vec<Value> {
118
118
/// Converts an [`OperatorData`] into a [`Value`].
119
119
fn operator_data_to_value ( data : & OperatorData ) -> Value {
120
120
match data {
121
- OperatorData :: Int64 ( i) => Value ( Literal ( Int64 ( * i) ) ) ,
122
- OperatorData :: Float64 ( f) => Value ( Literal ( Float64 ( * * f) ) ) ,
123
- OperatorData :: String ( s) => Value ( Literal ( String ( s. clone ( ) ) ) ) ,
124
- OperatorData :: Bool ( b) => Value ( Literal ( Bool ( * b) ) ) ,
125
- OperatorData :: Struct ( name, elements) => Value ( Struct (
121
+ OperatorData :: Int64 ( i) => Value :: new ( Literal ( Int64 ( * i) ) ) ,
122
+ OperatorData :: Float64 ( f) => Value :: new ( Literal ( Float64 ( * * f) ) ) ,
123
+ OperatorData :: String ( s) => Value :: new ( Literal ( String ( s. clone ( ) ) ) ) ,
124
+ OperatorData :: Bool ( b) => Value :: new ( Literal ( Bool ( * b) ) ) ,
125
+ OperatorData :: Struct ( name, elements) => Value :: new ( Struct (
126
126
name. clone ( ) ,
127
127
convert_operator_data_to_values ( elements) ,
128
128
) ) ,
129
- OperatorData :: Array ( elements) => Value ( Array ( convert_operator_data_to_values ( elements) ) ) ,
129
+ OperatorData :: Array ( elements) => {
130
+ Value :: new ( Array ( convert_operator_data_to_values ( elements) ) )
131
+ }
130
132
}
131
133
}
132
134
133
135
/// Converts a [`PropertiesData`] into a [`Value`].
134
136
fn properties_data_to_value ( data : & PropertiesData ) -> Value {
135
137
match data {
136
- PropertiesData :: Int64 ( i) => Value ( Literal ( Int64 ( * i) ) ) ,
137
- PropertiesData :: Float64 ( f) => Value ( Literal ( Float64 ( * * f) ) ) ,
138
- PropertiesData :: String ( s) => Value ( Literal ( String ( s. clone ( ) ) ) ) ,
139
- PropertiesData :: Bool ( b) => Value ( Literal ( Bool ( * b) ) ) ,
138
+ PropertiesData :: Int64 ( i) => Value :: new ( Literal ( Int64 ( * i) ) ) ,
139
+ PropertiesData :: Float64 ( f) => Value :: new ( Literal ( Float64 ( * * f) ) ) ,
140
+ PropertiesData :: String ( s) => Value :: new ( Literal ( String ( s. clone ( ) ) ) ) ,
141
+ PropertiesData :: Bool ( b) => Value :: new ( Literal ( Bool ( * b) ) ) ,
140
142
PropertiesData :: Struct ( name, elements) => {
141
143
let values = elements. iter ( ) . map ( properties_data_to_value) . collect ( ) ;
142
- Value ( Struct ( name. clone ( ) , values) )
144
+ Value :: new ( Struct ( name. clone ( ) , values) )
143
145
}
144
146
PropertiesData :: Array ( elements) => {
145
147
let values = elements. iter ( ) . map ( properties_data_to_value) . collect ( ) ;
146
- Value ( Array ( values) )
148
+ Value :: new ( Array ( values) )
147
149
}
148
150
}
149
151
}
0 commit comments