comphead commented on code in PR #21738:
URL: https://github.com/apache/datafusion/pull/21738#discussion_r3112309256


##########
datafusion/physical-plan/src/spill/mod.rs:
##########
@@ -130,6 +131,21 @@ impl SpillReaderStream {
                         StreamReader::try_new(file, 
None)?.with_skip_validation(true)
                     };
 
+                    // Validate the schema read from Arrow IPC file is the 
same as the
+                    // schema of the current `SpillManager`
+                    let actual_schema = reader.schema();
+
+                    if actual_schema != expected_schema {
+                        return Err(exec_datafusion_err!(
+                            "Spill file schema mismatch: expected {}, got {}. \
+                            The caller must use the same SpillManager that 
created the spill file to read it.",
+                            expected_schema,
+                            actual_schema
+                        ));

Review Comment:
   ```suggestion
                           return exec_err!(
                               "Spill file schema mismatch: expected {}, got 
{}. \
                               The caller must use the same SpillManager that 
created the spill file to read it.",
                               expected_schema,
                               actual_schema
                           );
   ```



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

Reply via email to