Michael Smith created IMPALA-14624:
--------------------------------------

             Summary: Calcite planning fails when TRACE logging enabled
                 Key: IMPALA-14624
                 URL: https://issues.apache.org/jira/browse/IMPALA-14624
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
            Reporter: Michael Smith


I ran into a failure after enabling TRACE logging in org.apache.calcite and 
running the TPC-DS decimal_v2 test suite. Tests immediately fail with
{code}
I20251210 16:22:58.420078 59661 jni-util.cc:321] 
2645d7c6626f1738:66b75f0400000000] java.lang.NullPointerException
        at 
org.apache.impala.calcite.schema.FilterSelectivityEstimator.getMaxNDV(FilterSelectivityEstimator.java:291)
        at 
org.apache.impala.calcite.schema.FilterSelectivityEstimator.computeEqualsSelectivity(FilterSelectivityEstimator.java:168)
        at 
org.apache.impala.calcite.schema.FilterSelectivityEstimator.estimateCallSelectivity(FilterSelectivityEstimator.java:116)
        at 
org.apache.impala.calcite.schema.FilterSelectivityEstimator.estimateSelectivity(FilterSelectivityEstimator.java:74)
        at 
org.apache.impala.calcite.schema.FilterSelectivityEstimator.computeConjunctionSelectivity(FilterSelectivityEstimator.java:257)
        at 
org.apache.impala.calcite.schema.FilterSelectivityEstimator.estimateCallSelectivity(FilterSelectivityEstimator.java:118)
        at 
org.apache.impala.calcite.schema.FilterSelectivityEstimator.estimateSelectivity(FilterSelectivityEstimator.java:74)
        at 
org.apache.impala.calcite.schema.ImpalaRelMdRowCount.getRowCount(ImpalaRelMdRowCount.java:72)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount_$(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:259)
        at 
org.apache.calcite.rel.metadata.RelMdRowCount.getRowCount(RelMdRowCount.java:142)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount_$(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:259)
        at 
org.apache.calcite.rel.metadata.RelMdRowCount.getRowCount(RelMdRowCount.java:142)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount_$(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:259)
        at 
org.apache.calcite.rel.metadata.RelMdRowCount.getRowCount(RelMdRowCount.java:146)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount_$(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_RowCountHandler.getRowCount(Unknown
 Source)
        at 
org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:259)
        at 
org.apache.calcite.plan.hep.HepPlanner.dumpGraph(HepPlanner.java:1048)
        at 
org.apache.calcite.plan.hep.HepPlanner.applyTransformationResults(HepPlanner.java:775)
        at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:559)
        at 
org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:420)
        at 
org.apache.calcite.plan.hep.HepPlanner.executeRuleCollection(HepPlanner.java:286)
        at 
org.apache.calcite.plan.hep.HepInstruction$RuleCollection$State.execute(HepInstruction.java:105)
        at 
org.apache.calcite.plan.hep.HepPlanner.lambda$executeProgram$0(HepPlanner.java:211)
        at 
com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
        at 
org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:210)
        at 
org.apache.calcite.plan.hep.HepProgram$State.execute(HepProgram.java:118)
        at 
org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:205)
        at 
org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:191)
        at 
org.apache.impala.calcite.service.CalciteRelNodeConverter.runProgram(CalciteRelNodeConverter.java:245)
        at 
org.apache.impala.calcite.service.CalciteRelNodeConverter.convert(CalciteRelNodeConverter.java:151)
        at 
org.apache.impala.calcite.service.CalciteSingleNodePlanner.createSingleNodePlan(CalciteSingleNodePlanner.java:65)
        at 
org.apache.impala.planner.Planner.createPlanFragments(Planner.java:137)
        at org.apache.impala.planner.Planner.createPlans(Planner.java:314)
        at 
org.apache.impala.service.Frontend.createExecRequest(Frontend.java:2044)
        at 
org.apache.impala.service.Frontend.getPlannedExecRequest(Frontend.java:3374)
        at 
org.apache.impala.service.Frontend.doCreateExecRequest(Frontend.java:3148)
        at 
org.apache.impala.service.Frontend.getTExecRequest(Frontend.java:2553)
        at 
org.apache.impala.service.Frontend.getTExecRequestWithFallback(Frontend.java:2404)
        at 
org.apache.impala.service.Frontend.createExecRequest(Frontend.java:2106)
        at 
org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:175)
{code}

Setup was {{start-impala-cluster.py}}, go to localhost:25000/log_level and add 
logging for {{org.apache.calcite}}, then run {{impala-py.test 
tests/query_test/test_tpcds_queries.py::TestTpcdsDecimalV2Query}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to