This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new d7c57d09a fix parquet type is_optional comment (#6192)
d7c57d09a is described below
commit d7c57d09aab2be7e98dcb20784e0161e06a2c1ed
Author: Jinpeng <[email protected]>
AuthorDate: Wed Aug 7 05:13:40 2024 -0700
fix parquet type is_optional comment (#6192)
Co-authored-by: jp0317 <[email protected]>
---
parquet/src/schema/types.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/parquet/src/schema/types.rs b/parquet/src/schema/types.rs
index 0eb08f557..190374fd8 100644
--- a/parquet/src/schema/types.rs
+++ b/parquet/src/schema/types.rs
@@ -188,7 +188,7 @@ impl Type {
}
/// Returns `true` if this type is repeated or optional.
- /// If this type doesn't have repetition defined, we still treat it as
optional.
+ /// If this type doesn't have repetition defined, we treat it as required.
pub fn is_optional(&self) -> bool {
self.get_basic_info().has_repetition()
&& self.get_basic_info().repetition() != Repetition::REQUIRED
@@ -1932,6 +1932,7 @@ mod tests {
let f1 = Type::group_type_builder("f").build().unwrap();
let f2 = Type::group_type_builder("f").build().unwrap();
assert!(f1.check_contains(&f2));
+ assert!(!f1.is_optional());
// OK: fields match
let f1 = test_new_group_type(