Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3784

RexCall toString digest gives OOM while huge expression is evaluated

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      I have some complex query which has tens of thousands of rex expressions and this expression is used in filter expression in the query.

      On creating a filter below code gets called:

      public RelBuilder filter(Iterable<CorrelationId> variablesSet,
        Iterable<? extends RexNode> predicates) {
      
        final RexNode simplifiedPredicates =
        simplifier.simplifyFilterPredicates(predicates);
        if (simplifiedPredicates == null) {
          return empty();
       }
      

      RexSimplify further adds the rexnode in the Set<RexNode> calling hashcode() internally which calls toString()

      Is there any way to avoid this computeDigest Call which creates complex string object and blows up the  RAM about 10GB?

        Attachments

        1. OOM_Screenshot.png
          225 kB
          Ravi Kapoor

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ravi_kapoor Ravi Kapoor
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: