[ 
https://issues.apache.org/jira/browse/TRAFODION-2351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15826481#comment-15826481
 ] 

ASF GitHub Bot commented on TRAFODION-2351:
-------------------------------------------

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

    https://github.com/apache/incubator-trafodion/pull/914#discussion_r96469054
  
    --- Diff: core/sql/executor/ExExeUtilLoad.cpp ---
    @@ -1417,29 +1416,45 @@ short ExExeUtilHBaseBulkLoadTcb::work()
                   
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x20000);
                 }
               }
    +        ComDiagsArea *diagsArea = getDiagsArea();
     
             cliRC = cliInterface()->executeImmediate(loadQuery,
                 NULL,
                 NULL,
                 TRUE,
    -            &rowsAffected_);
    -          if (parserFlagSet)
    -            
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x20000);
    +            &rowsAffected_,
    +            FALSE,
    +            diagsArea);
     
    +        if (parserFlagSet)
    +            
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x20000);
             if (cliRC < 0)
             {
               rowsAffected_ = 0;
               cliInterface()->retrieveSQLDiagnostics(getDiagsArea());
               step_ = LOAD_END_ERROR_;
               break;
             }
    -        
    -        step_ = COMPLETE_BULK_LOAD_;
    +        else {
    +           step_ = COMPLETE_BULK_LOAD_;
    +           ComCondition *cond;
    +           Lng32 entryNumber;
    +           while ((cond = diagsArea->findCondition(EXE_ERROR_ROWS_FOUND, 
&entryNumber)) != NULL) {
    +              errorRowCount = cond->getOptionalInteger(0);
    +              diagsArea->deleteWarning(entryNumber);
    +           }
    +           // Need to clear the diags Area to get the correct rowsAffected 
for the LOAD COMPLETE command
    +           // Hence, we might lose any other warnings created at the time 
of loading like error during
    +           // logging error rows
    +           diagsArea->clear();
    --- End diff --
    
    Any warning diags could be lost.  The warning were lost before this change 
too. In fact, the warnings never reach the caller of the executeDirect of any 
SQL command called with the executor utility commands.  This PR has the fix for 
this. However, when I attempted to pass this warning to the executor utility 
command,  I was getting wrong rows loaded  for the load completion command for 
reasons that needed to debugged further.  Hence, as a interim solution I have 
cleared the diagnostics after getting the error row count and it behaves the 
same way as before.
    
    When I have a solution for this anomaly, I will create a new PR


> Bulk load with log error rows enhancements
> ------------------------------------------
>
>                 Key: TRAFODION-2351
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2351
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>            Reporter: Selvaganesan Govindarajan
>            Assignee: Selvaganesan Govindarajan
>
> Bulk load needs the following enhancements
> 1) Load with log error rows misses out some error rows being logged
> 2) Load with log error rows need to report if there are any error rows
> 3) Load with log error rows need to report where the error rows are logged



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to