My first reaction was ‘search for DNF in the tests’ but then I see that RexProgramTest has several testCnf methods [1] but no testDnf methods. There is a RexUtil.toDnf method [2] but unlike RexUtil.toCnf it is not tested.
With luck you can call RexUtil.toDnf in the same way that you would call toCnf, as indicated by the tests. If someone would like to contribute some tests for toDnf that would be appreciated. Julian [1] https://github.com/apache/calcite/blob/4b1e9ed1a513eae0c873a660b755bb4f27b39da9/core/src/test/java/org/apache/calcite/rex/RexProgramTest.java#L534 <https://github.com/apache/calcite/blob/4b1e9ed1a513eae0c873a660b755bb4f27b39da9/core/src/test/java/org/apache/calcite/rex/RexProgramTest.java#L534> [2] https://github.com/apache/calcite/blob/241b6db49c3ca88c9cdf25ddd2c0c8457734a130/core/src/main/java/org/apache/calcite/rex/RexUtil.java#L1755 <https://github.com/apache/calcite/blob/241b6db49c3ca88c9cdf25ddd2c0c8457734a130/core/src/main/java/org/apache/calcite/rex/RexUtil.java#L1755> > On Dec 8, 2021, at 6:50 AM, Jeremy Dyer <[email protected]> wrote: > > Hello, > > I'm working on a Python SQL engine and using Calcite for query parsing. I > am working on the predicate pushdown portion and I need to convert/expand a > Rexnode from the "WHERE" portion of the query into a DNF formatted string > that I can pass along to the underlying library I am using (CUDA & GPU). I > have read the documentation a few times but am struggling to understand how > or where I do this? Does anyone have any suggestions? > > Thanks, > Jeremy Dyer
