jkosh44 commented on PR #14289:
URL: https://github.com/apache/datafusion/pull/14289#issuecomment-2614042678

   I made a couple of changes to this PR in the second commit. Previously, I 
was getting an optimizer error under certain scenarios, for example,
   ```
   > select array_slice([1,2,3], NULL, NULL);
   Optimizer rule 'optimize_projections' failed
   caused by
   Check optimizer-specific invariants after optimizer rule: 
optimize_projections
   caused by
   Internal error: Failed due to a difference in schemas, original schema: 
DFSchema { inner: Schema { fields: [Field { name: 
"make_array(Int64(1),Int64(2),Int64(3))[NULL:NULL]", data_type: List(Field { 
name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: 
false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, 
metadata: {} }], metadata: {} }, field_qualifiers: [None], 
functional_dependencies: FunctionalDependencies { deps: [] } }, new schema: 
DFSchema { inner: Schema { fields: [Field { name: 
"make_array(Int64(1),Int64(2),Int64(3))[NULL:NULL]", data_type: Null, nullable: 
true, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {} }, 
field_qualifiers: [None], functional_dependencies: FunctionalDependencies { 
deps: [] } }.
   This was likely caused by a bug in DataFusion's code and we would welcome 
that you file an bug report in our issue tracker
   ```
   
   Strangely, `select array_slice([1,2,3], NULL, NULL) is NULL` returned 
`true`, which is why the tests were passing. The second commit fixed this issue 
and updated the tests. It turns out there were already tests that were 
asserting `NULL`s would cause errors, so I switched those to assert for `NULL`s.
   


-- 
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-unsubscr...@datafusion.apache.org

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


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

Reply via email to