You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kosiew (via GitHub)" <gi...@apache.org> on 2026/02/23 08:05:27 UTC

[PR] Make `custom_file_casts` example schema nullable to allow null `id` values during casting [datafusion]

kosiew opened a new pull request, #20486:
URL: https://github.com/apache/datafusion/pull/20486

   
   ## Which issue does this PR close?
   
   * Comment on #20202
   
   ---
   
   ## Rationale for this change
   
   The `custom_file_casts` example defines a *logical/table* schema that uses `id: Int32` as the target type. In practice, casting and projection paths in DataFusion can produce **nulls** (e.g. failed casts, missing values, or intermediate expressions), and examples should avoid implying that nulls are impossible when demonstrating casting behavior.
   
   Marking the `id` field as **nullable** makes the example more realistic and prevents confusion when users follow or adapt the example to scenarios where nulls may appear.
   
   ---
   
   ## What changes are included in this PR?
   
   * Update the logical/table schema in `custom_file_casts.rs` to define `id` as **nullable** (`Field::new("id", DataType::Int32, true)`).
   * Adjust the inline comment to reflect the nullable schema.
   
   ---
   
   ## Are these changes tested?
   
   No new tests were added.
   
   This is a documentation/example-only change that updates a schema definition and comment. The example continues to compile and can be exercised by running the `custom_file_casts` example as before.
   
   ---
   
   ## Are there any user-facing changes?
   
   Yes (example behavior/expectations):
   
   * The `custom_file_casts` example now documents `id` as nullable, aligning the example schema with situations where cast/projection may yield null values.
   * No public APIs are changed and no breaking behavior is introduced.
   


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Make `custom_file_casts` example schema nullable to allow null `id` values during casting [datafusion]

Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb merged PR #20486:
URL: https://github.com/apache/datafusion/pull/20486


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Make `custom_file_casts` example schema nullable to allow null `id` values during casting [datafusion]

Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on PR #20486:
URL: https://github.com/apache/datafusion/pull/20486#issuecomment-3951343893

   @adriangb 
   Thanks for the quick review.


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org