Skip to content

Commit d7c57d0

Browse files
jp0317jp0317
and
jp0317
authored
fix parquet type is_optional comment (apache#6192)
Co-authored-by: jp0317 <[email protected]>
1 parent db239e5 commit d7c57d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

parquet/src/schema/types.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl Type {
188188
}
189189

190190
/// Returns `true` if this type is repeated or optional.
191-
/// If this type doesn't have repetition defined, we still treat it as optional.
191+
/// If this type doesn't have repetition defined, we treat it as required.
192192
pub fn is_optional(&self) -> bool {
193193
self.get_basic_info().has_repetition()
194194
&& self.get_basic_info().repetition() != Repetition::REQUIRED
@@ -1932,6 +1932,7 @@ mod tests {
19321932
let f1 = Type::group_type_builder("f").build().unwrap();
19331933
let f2 = Type::group_type_builder("f").build().unwrap();
19341934
assert!(f1.check_contains(&f2));
1935+
assert!(!f1.is_optional());
19351936

19361937
// OK: fields match
19371938
let f1 = test_new_group_type(

0 commit comments

Comments
 (0)