@@ -141,6 +141,12 @@ pub struct ExecutionContext {
141141 pub state : Arc < Mutex < ExecutionContextState > > ,
142142}
143143
144+ impl Default for ExecutionContext {
145+ fn default ( ) -> Self {
146+ Self :: new ( )
147+ }
148+ }
149+
144150impl ExecutionContext {
145151 /// Creates a new execution context using a default configuration.
146152 pub fn new ( ) -> Self {
@@ -1049,6 +1055,27 @@ pub struct ExecutionProps {
10491055 pub ( crate ) query_execution_start_time : DateTime < Utc > ,
10501056}
10511057
1058+ impl Default for ExecutionProps {
1059+ fn default ( ) -> Self {
1060+ Self :: new ( )
1061+ }
1062+ }
1063+
1064+ impl ExecutionProps {
1065+ /// Creates a new execution props
1066+ pub fn new ( ) -> Self {
1067+ ExecutionProps {
1068+ query_execution_start_time : chrono:: Utc :: now ( ) ,
1069+ }
1070+ }
1071+
1072+ /// Marks the execution of query started timestamp
1073+ pub fn start_execution ( & mut self ) -> & Self {
1074+ self . query_execution_start_time = chrono:: Utc :: now ( ) ;
1075+ & * self
1076+ }
1077+ }
1078+
10521079/// Execution context for registering data sources and executing queries
10531080#[ derive( Clone ) ]
10541081pub struct ExecutionContextState {
@@ -1068,18 +1095,9 @@ pub struct ExecutionContextState {
10681095 pub object_store_registry : Arc < ObjectStoreRegistry > ,
10691096}
10701097
1071- impl ExecutionProps {
1072- /// Creates a new execution props
1073- pub fn new ( ) -> Self {
1074- ExecutionProps {
1075- query_execution_start_time : chrono:: Utc :: now ( ) ,
1076- }
1077- }
1078-
1079- /// Marks the execution of query started timestamp
1080- pub fn start_execution ( & mut self ) -> & Self {
1081- self . query_execution_start_time = chrono:: Utc :: now ( ) ;
1082- & * self
1098+ impl Default for ExecutionContextState {
1099+ fn default ( ) -> Self {
1100+ Self :: new ( )
10831101 }
10841102}
10851103
0 commit comments