martin-g commented on code in PR #2387:
URL: 
https://github.com/apache/datafusion-ballista/pull/2387#discussion_r3871216958


##########
ballista/core/src/config.rs:
##########
@@ -581,10 +581,16 @@ impl BallistaConfig {
     }
 
     /// Returns the standalone processing parallelism level.
-    pub fn default_standalone_parallelism(&self) -> usize {
+    pub fn standalone_parallelism(&self) -> usize {
         self.get_usize_setting(BALLISTA_STANDALONE_PARALLELISM)
     }
 
+    /// Deprecated alias for [`Self::standalone_parallelism`].
+    #[deprecated(note = "renamed to `standalone_parallelism`")]

Review Comment:
   ```suggestion
       #[deprecated(since = "55.0.0", note = "renamed to 
`standalone_parallelism`")]
   ```
   this makes it easier to decide when it is time to remove the deprecated 
method.



##########
ballista/core/src/config.rs:
##########
@@ -798,10 +804,16 @@ impl BallistaConfig {
     }
 
     /// should client use TLS to communicate with ballista cluster
-    pub fn client_use_tls(&self) -> bool {
+    pub fn use_tls(&self) -> bool {
         self.get_bool_setting(BALLISTA_CLIENT_USE_TLS)
     }
 
+    /// Deprecated alias for [`Self::use_tls`].
+    #[deprecated(note = "renamed to `use_tls`")]

Review Comment:
   ```suggestion
       #[deprecated(since = "55.0.0", note = "renamed to `use_tls`")]
   ```



##########
Cargo.toml:
##########
@@ -59,6 +59,7 @@ itertools = "0.15"
 mimalloc = { version = "0.1" }
 object_store = "0.13.2"
 ordered-float = "5"
+paste = "1.0"

Review Comment:
   https://github.com/dtolnay/paste is not maintained since few years.
   Some tooling (`cargo deny` ?!) disallows it.
   I believe https://github.com/as1100k/pastey is the most used fork of it.



##########
ballista/core/src/extension.rs:
##########
@@ -1208,6 +1090,41 @@ mod test {
         )
     }
 
+    #[test]
+    fn should_round_trip_all_macro_generated_options() {
+        let plain = SessionConfig::new_with_ballista()
+            .with_ballista_standalone_parallelism(123)

Review Comment:
   ```suggestion
           let plain = SessionConfig::new_with_ballista()
               .with_ballista_adaptive_query_planner(true)
               .with_ballista_standalone_parallelism(123)
   ```



##########
ballista/core/src/extension.rs:
##########
@@ -1208,6 +1090,41 @@ mod test {
         )
     }
 
+    #[test]
+    fn should_round_trip_all_macro_generated_options() {
+        let plain = SessionConfig::new_with_ballista()
+            .with_ballista_standalone_parallelism(123)
+            .with_ballista_grpc_client_max_message_size(456)
+            .with_ballista_broadcast_join_threshold_bytes(789)
+            .with_ballista_broadcast_join_threshold_rows(42)
+            .with_ballista_hash_join_max_build_partition_bytes(999)
+            .with_ballista_shuffle_reader_maximum_concurrent_requests(7)
+            .with_ballista_coalesce_target_partition_bytes(2048)
+            .with_ballista_shuffle_reader_force_remote_read(true)
+            .with_ballista_shuffle_reader_remote_prefer_flight(true)
+            .with_ballista_use_tls(true)
+            .with_ballista_coalesce_enabled(true)
+            .with_ballista_coalesce_small_partition_factor(1.5)
+            .with_ballista_coalesce_merged_partition_factor(2.5);
+
+        assert!(plain.ballista_shuffle_reader_force_remote_read());
+        assert!(plain.ballista_shuffle_reader_remote_prefer_flight());
+        assert!(plain.ballista_use_tls());
+        assert!(plain.ballista_coalesce_enabled());
+        assert_eq!(plain.ballista_standalone_parallelism(), 123);
+        assert_eq!(plain.ballista_grpc_client_max_message_size(), 456);
+        assert_eq!(plain.ballista_broadcast_join_threshold_bytes(), 789);
+        assert_eq!(plain.ballista_broadcast_join_threshold_rows(), 42);
+        assert_eq!(plain.ballista_hash_join_max_build_partition_bytes(), 999);
+        assert_eq!(plain.ballista_coalesce_target_partition_bytes(), 2048);
+        assert_eq!(plain.ballista_coalesce_small_partition_factor(), 1.5);
+        assert_eq!(plain.ballista_coalesce_merged_partition_factor(), 2.5);
+        assert_eq!(
+            plain.ballista_shuffle_reader_maximum_concurrent_requests(),
+            7
+        );

Review Comment:
   Should the deprecated getters be tested too ?



##########
ballista/core/src/extension.rs:
##########
@@ -1208,6 +1090,41 @@ mod test {
         )
     }
 
+    #[test]
+    fn should_round_trip_all_macro_generated_options() {
+        let plain = SessionConfig::new_with_ballista()
+            .with_ballista_standalone_parallelism(123)
+            .with_ballista_grpc_client_max_message_size(456)
+            .with_ballista_broadcast_join_threshold_bytes(789)
+            .with_ballista_broadcast_join_threshold_rows(42)
+            .with_ballista_hash_join_max_build_partition_bytes(999)
+            .with_ballista_shuffle_reader_maximum_concurrent_requests(7)
+            .with_ballista_coalesce_target_partition_bytes(2048)
+            .with_ballista_shuffle_reader_force_remote_read(true)
+            .with_ballista_shuffle_reader_remote_prefer_flight(true)
+            .with_ballista_use_tls(true)
+            .with_ballista_coalesce_enabled(true)
+            .with_ballista_coalesce_small_partition_factor(1.5)
+            .with_ballista_coalesce_merged_partition_factor(2.5);
+
+        assert!(plain.ballista_shuffle_reader_force_remote_read());

Review Comment:
   ```suggestion
           assert!(plain.ballista_adaptive_query_planner_enabled());
           assert!(plain.ballista_shuffle_reader_force_remote_read());
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to