I’m really not fussed about whether a patch written by me gets integrated, or if someone codes up an equivalent fix and writes their own test. I was merely trying to satisfy the requirement for “a concise reproduction, ideally as a test that can be used in Calcite”. It’s a one line fix, and the test would probably fit better in some other part of the codebase, but I don’t know it well enough to know where that place is. If you need me to pick up the work to fix this, then I can… but if it’s quicker to have someone else fix it, I’ll take that option instead.
Chris From: Mihai Budiu <[email protected]> Date: Thursday, November 7, 2024 at 4:41 PM To: [email protected] <[email protected]> Subject: [EXTERNAL] Re: NullPolicy for IS_EMPTY in RexImpTable If you want to provide a patch you have to start by filing an issue in JIRA. See https://calcite.apache.org/develop/ Mihai ________________________________ From: Chris Dennis <[email protected]> Sent: Thursday, November 7, 2024 12:49 PM To: [email protected] <[email protected]> Subject: Re: NullPolicy for IS_EMPTY in RexImpTable Patch with a test (probably not best placed) that exposes the issue, and a simple candidate fix. Given the nature of the bug, I’m thinking a review of the NullPolicy for all the operators in this area would make sense. By inspection there’s a whole bunch of non-null-safe Collection logic in SqlFunctions that should be receiving guard logic during the rex translation. Thanks, Chris From: Mihai Budiu <[email protected]> Date: Thursday, November 7, 2024 at 2:08 PM To: [email protected] <[email protected]> Subject: [EXTERNAL] Re: NullPolicy for IS_EMPTY in RexImpTable Can you provide a concise reproduction, ideally as a test that can be used in Calcite (e.g., SqlValidatorTest)? Mihai ________________________________ From: Chris Dennis <[email protected]> Sent: Thursday, November 7, 2024 11:06 AM To: [email protected] <[email protected]> Subject: NullPolicy for IS_EMPTY in RexImpTable Hi All, I’m working on a calcite adapter and I’m hitting issues with handling array columns. I’m seeing NullPointerExceptions from queries like “SELECT * FROM table WHERE list IS EMPTY” when “list” is a nullable column. I think the root cause here might be the NullPolicy for the IS_EMPTY operator in RexImpTable? I’m thinking this should probably be NullPolicy.STRICT and not NullPolicy.NONE, and therefore not shortcircuiting the null check on the collection before calling isEmpty()? Thanks, Chris
