trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sureshsubbiah <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #657: [TRAFODION-2159] Unnest correlated su...
Date Wed, 17 Aug 2016 21:55:49 GMT
Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/657#discussion_r75214993
  
    --- Diff: core/sql/optimizer/NormRelExpr.cpp ---
    @@ -2436,15 +2449,21 @@ void Join::createAFilterGrandChildIfNeeded(NormWA & normWARef)
     
           if ((doNotUnnest == FALSE) && candidateForLeftJoin && 
               (CmpCommon::getDefault(SUBQUERY_UNNESTING_P2) != DF_INTERNAL) &&
    -          (normWARef.getLeftJoinConversionCount() >= 1))
    +          ((normWARef.getLeftJoinConversionCount() >= 1)||nestedAggInSubQ))
           {
             doNotUnnest = TRUE;
             // For phase 2 we only unnest 1 level of subqueries 
             // containing NonNullRejecting Predicates
     
    -        if (CmpCommon::getDefault(SUBQUERY_UNNESTING) == DF_DEBUG)
    +        if (CmpCommon::getDefault(SUBQUERY_UNNESTING) == DF_DEBUG) 
    +        {
    +          if (!nestedAggInSubQ)
                 *CmpCommon::diags() << DgSqlCode(2997)
                   << DgString1("Skipping unnesting of Subquery due to NonNullRejecting
Predicates in more than one subquery");
    +          else
    +             *CmpCommon::diags() << DgSqlCode(2997)
    +              << DgString1("Skipping unnesting of Subquery since we have both NonNullRejecting
predicate and nested nested aggregate in subquery.");
    --- End diff --
    
    I was trying to make the debug message more detailed. If it is nestedAgg case we get one
message, while if we have several LeftJoin requiring subqueries we get a different message.
I suppose if both conditions are true we will get the more than one (now two with new commit)
LeftJoin subquery message.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message