xudong963 commented on code in PR #19515:
URL: https://github.com/apache/datafusion/pull/19515#discussion_r2652749184
##########
datafusion/common/src/config.rs:
##########
@@ -3455,4 +3456,57 @@ mod tests {
let parsed_metadata = table_config.parquet.key_value_metadata;
assert_eq!(parsed_metadata.get("key_dupe"), Some(&Some("B".into())));
}
+ #[cfg(feature = "parquet")]
+ #[test]
+ fn test_parquet_writer_version_validation() {
+ use crate::{config::ConfigOptions, parquet_config::DFWriterVersion};
+
+ let mut config = ConfigOptions::default();
+
+ // Valid values should work
+ config
+ .set("datafusion.execution.parquet.writer_version", "1.0")
+ .unwrap();
+ assert_eq!(
+ config.execution.parquet.writer_version,
+ DFWriterVersion::V1_0
+ );
+
+ config
+ .set("datafusion.execution.parquet.writer_version", "2.0")
+ .unwrap();
+ assert_eq!(
+ config.execution.parquet.writer_version,
+ DFWriterVersion::V2_0
+ );
+
+ // Invalid value should error immediately at SET time
+ // Currently this will succeed (no validation), but after adding enum
validation,
+ // this should fail with a clear error message
Review Comment:
do we need the comment?
--
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]