trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: [TRAFODION-1920] suppress SQL er...
Date Tue, 19 Apr 2016 23:30:19 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/441#discussion_r60329781
  
    --- Diff: core/sql/executor/ExHdfsScan.cpp ---
    @@ -1378,9 +1423,27 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
       
       return WORK_OK;
     }
    +void ExHdfsScanTcb::setR2ColumnNull(Int32 colidx)
    +{
    +  Lng32 neededColIndex = 0;
    +  Attributes * attr = NULL;
    +  ExpTupleDesc * asciiSourceTD = hdfsScanTdb().workCriDesc_->getTupleDescriptor(hdfsScanTdb().asciiTuppIndex_);
    +  for (Lng32 i = 0; i <  hdfsScanTdb().convertSkipListSize_; i++)
    +  {
    +    if (hdfsScanTdb().convertSkipList_[i] > 0)
    +    {
    +      attr = asciiSourceTD->getAttr(neededColIndex);
    +      neededColIndex++;
    +	  if(attr->getOffset() == colidx)
    +	{
    +		*(short *)&hdfsAsciiSourceData_[attr->getNullIndOffset()] = -1;
    +	}
    +    }
    +  }
    +}
    --- End diff --
    
    I'm still reviewing, and I'm not familiar with this code. I'm trying to understand how
this works. Does hdfsAsciiSourceData_ point to an ASCII string? Why would putting two bytes
of x'ff' into the string make a value look like a null? How does the move expression parse
to the next field?


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