Skip to content

Commit c6deb44

Browse files
Change ordering, remove unnecessary comment
1 parent b1f734f commit c6deb44

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

kernel/src/schema_compat.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ impl NullabilityCheck {
2525

2626
impl StructField {
2727
fn can_read_as(&self, read_field: &StructField) -> DeltaResult<()> {
28+
NullabilityCheck {
29+
nullable: self.nullable,
30+
read_nullable: read_field.nullable,
31+
}
32+
.is_compatible()?;
2833
require!(
2934
self.name() == read_field.name(),
3035
Error::generic(format!(
@@ -33,13 +38,6 @@ impl StructField {
3338
read_field.name()
3439
))
3540
);
36-
37-
NullabilityCheck {
38-
nullable: self.nullable,
39-
read_nullable: read_field.nullable,
40-
}
41-
.is_compatible()?;
42-
4341
self.data_type().can_read_as(read_field.data_type())?;
4442
Ok(())
4543
}
@@ -52,7 +50,6 @@ impl StructType {
5250
.iter()
5351
.map(|(name, field)| (name.to_lowercase(), field))
5452
.collect();
55-
// Delta tables do not allow fields that differ in name only by case
5653
require!(
5754
field_map.len() == self.fields.len(),
5855
Error::generic("Delta tables don't allow field names that only differ by case")

0 commit comments

Comments
 (0)