Apache DataFusion SQL Query Engine
Make `custom_file_casts` example schema nullable to allow null `id` values during casting (#20486)
kosiew4a41587bdfa4
diff --git a/datafusion-examples/examples/custom_data_source/custom_file_casts.rs b/datafusion-examples/examples/custom_data_source/custom_file_casts.rsindex 36cc936332..69826a59c9 100644--- a/datafusion-examples/examples/custom_data_source/custom_file_casts.rs+++ b/datafusion-examples/examples/custom_data_source/custom_file_casts.rs@@ -49,9 +49,9 @@ use object_store::{ObjectStore, PutPayload};pub async fn custom_file_casts() -> Result<()> {println!("=== Creating example data ===");- // Create a logical / table schema with an Int32 column+ // Create a logical / table schema with an Int32 column (nullable)let logical_schema =- Arc::new(Schema::new(vec![Field::new("id", DataType::Int32, false)]));+ Arc::new(Schema::new(vec![Field::new("id", DataType::Int32, true)]));// Create some data that can be cast (Int16 -> Int32 is widening) and some that cannot (Int64 -> Int32 is narrowing)let store = Arc::new(InMemory::new()) as Arc<dyn ObjectStore>;