trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsharma00 <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #516: JIRA TRAFODION-2022 Add support for p...
Date Thu, 02 Jun 2016 18:49:28 GMT
Github user anoopsharma00 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/516#discussion_r65596782
  
    --- Diff: core/sql/optimizer/RelExeUtil.cpp ---
    @@ -4981,9 +4981,43 @@ RelExpr * ExeUtilFastDelete::bindNode(BindWA *bindWA)
         {
           // do not do override schema for this
           bindWA->setToOverrideSchema(FALSE);
    -
    +      
           naTable = bindWA->getNATable(getTableName());
    -      if (getTableName().isSeabase())
    +      if (getTableName().isHive())
    +        {
    +          if (! naTable)
    +            {
    +              *CmpCommon::diags() << DgSqlCode(-4222) << DgString0("PURGEDATA");
    +              bindWA->setErrStatus();
    +              return NULL;
    +            }
    +
    +          const HHDFSTableStats* hTabStats = 
    +            naTable->getClusteringIndex()->getHHDFSTableStats();
    +          
    +          isHiveTable_ = TRUE;
    +          
    +          const char * hiveTablePath = (*hTabStats)[0]->getDirName();
    +          NAString hostName;
    +          Int32 hdfsPort;
    +          NAString tableDir;
    +
    +          NABoolean result = ((HHDFSTableStats* )hTabStats)->splitLocation
    +            (hiveTablePath, hostName, hdfsPort, tableDir) ;       
    +          if (!result) 
    +            {
    +              *CmpCommon::diags() << DgSqlCode(-4224)
    +                                  << DgString0(hiveTablePath);
    +              bindWA->setErrStatus();
    +              return this;
    --- End diff --
    
    Binder component returns 'this' at some places and 'null' at others
    in case of an error. At some point it probably started with one or the other
    but over time it has become inconsistent.
    
    But it will/should always set bindWA->setErrStatus() before return.
    And caller must check for bindWA->getErrStatus() to see 
    if an error occurred and if the caller must act on that error.



---
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