Asura7969 commented on issue #8476: URL: https://github.com/apache/arrow-datafusion/issues/8476#issuecomment-1849431378
The reason is that schema comparison: https://github.com/apache/arrow-datafusion/blob/d091b55be6a4ce552023ef162b5d081136d3ff6d/datafusion/core/src/datasource/memory.rs#L68 schema: ``` Field { name: "CASE WHEN Boolean(true) THEN NULL ELSE Int64(1) END", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } ``` batches_schema: ``` Field { name: "CASE WHEN Boolean(true) THEN NULL ELSE Int64(1) END", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } ``` data_type:`Null` & `Int64` Can we use the optimized schema to compare,like: before: ```rust pub async fn cache(self) -> Result<DataFrame> { let context = SessionContext::new_with_state(self.session_state.clone()); let mem_table = MemTable::try_new( SchemaRef::from(self.schema().clone()), self.collect_partitioned().await?, )?; context.read_table(Arc::new(mem_table)) } ``` after: ```rust pub async fn cache(self) -> Result<DataFrame> { let context = SessionContext::new_with_state(self.session_state.clone()); let physical_plan = self.create_physical_plan().await?; let mem_table = MemTable::try_new( physical_plan.schema(), self.collect_partitioned().await?, )?; context.read_table(Arc::new(mem_table)) } ``` -- 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]
