alamb commented on code in PR #7617:
URL: https://github.com/apache/arrow-datafusion/pull/7617#discussion_r1333367001


##########
datafusion-cli/src/main.rs:
##########
@@ -253,6 +264,25 @@ fn is_valid_memory_pool_size(size: &str) -> Result<(), 
String> {
     }
 }
 
+fn is_valid_maxrows(maxrows: &str) -> Result<(), String> {
+    extract_maxrows(maxrows).map(|_| ())
+}
+
+// If returned Ok(None), then no limit on max rows to display
+fn extract_maxrows(maxrows: &str) -> Result<Option<usize>, String> {
+    if maxrows.to_lowercase() == "inf"
+        || maxrows.to_lowercase() == "infinite"
+        || maxrows.to_lowercase() == "none"
+    {
+        Ok(None)
+    } else {
+        match maxrows.parse::<usize>() {
+        Ok(nrows)  => Ok(Some(nrows)),
+        _ => Err(format!("Invalid maxrows {}. Valid inputs are natural numbers 
or \'inf\' for no limit.", maxrows)),

Review Comment:
   ```suggestion
           _ => Err(format!("Invalid maxrows {}. Valid inputs are natural 
numbers or \'none\', \'inf\', or \'infinite\' for no limit.", maxrows)),
   ```



-- 
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]

Reply via email to