You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by sureshsubbiah <gi...@git.apache.org> on 2017/12/05 19:42:25 UTC

[GitHub] incubator-trafodion pull request #1316: [TRAFODION-2822] Make [first n] view...

Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1316#discussion_r155055478
  
    --- Diff: core/sql/optimizer/NormRelExpr.cpp ---
    @@ -6995,11 +6995,6 @@ NABoolean RelRoot::isUpdatableBasic(NABoolean isView,
       // QSTUFF
     
         {
    -      // if child is a FirstN node, skip it.
    -      if ((child(0)->castToRelExpr()->getOperatorType() == REL_FIRST_N) &&
    -	  (child(0)->child(0)))
    -	scan = (Scan *)child(0)->child(0)->castToRelExpr();
    -      else
     	scan = (Scan *)child(0)->castToRelExpr();
    --- End diff --
    
    There may be a few isolated cases where the FirstN node is added  during preCodeGen. Please see GenPreCode.cpp RelRoot::preCodeGen(). The example given there about Order by where sort is added in optimizer, or a FirstN where the N value is to be specified with a param seem to be cases where we would add the FirstN later. Will current change cause such views to marked as updateable? This is minor and could be resolved later, if any change is necessary.


---