You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/31 22:58:00 UTC

[jira] [Commented] (TRAFODION-2874) LOB: Add syntax to return filename of a LOB data file for external LOBs.

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

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

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

    https://github.com/apache/trafodion/pull/1428#discussion_r192260422
  
    --- Diff: core/sql/exp/ExpLOBaccess.cpp ---
    @@ -870,6 +870,67 @@ Ex_Lob_Error ExLob::getLength(char *handleIn, Int32 handleInLen,Int64 &outLobLen
           }
       return err;
     }
    +Ex_Lob_Error ExLob::getOffset(char *handleIn, Int32 handleInLen,Int64 &outLobOffset,LobsSubOper so, Int64 transId)
    +{
    +  char logBuf[4096];
    +  Int32 cliErr = 0;
    +  Ex_Lob_Error err=LOB_OPER_OK; 
    +  char *blackBox = new(getLobGlobalHeap()) char[MAX_LOB_FILE_NAME_LEN+6];
    +  Int32 blackBoxLen = 0;
    +  Int64 dummy = 0;
    +  Int32 dummy2 = 0;
    +  if (so != Lob_External_File)
    +    {
    +      
    +      cliErr = SQL_EXEC_LOBcliInterface(handleIn, handleInLen,NULL,NULL,NULL,NULL,LOB_CLI_SELECT_LOBOFFSET,LOB_CLI_ExecImmed,&outLobOffset,0, 0, 0,0,transId,lobTrace_);
    +    
    +      if (cliErr < 0 ) {
    +        str_sprintf(logBuf,"CLI SELECT_LOBOFFSET returned error %d",cliErr);
    +        lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
    +  
    +        return LOB_DESC_READ_ERROR;
    +      }
    +    }
    + 
    +  return err;
    +}
    +
    +Ex_Lob_Error ExLob::getFileName(char *handleIn, Int32 handleInLen, char *outFileName, Int32 &outFileLen , LobsSubOper so, Int64 transId)
    +{
    +  char logBuf[4096];
    +  Int32 cliErr = 0;
    +  Ex_Lob_Error err=LOB_OPER_OK; 
    +  Int64 dummy = 0;
    +  Int32 dummy2 = 0;
    +  if (so != Lob_External_File)
    +    {
    +      //Derive the filename from the LOB handle and return
    +      str_cpy_all(outFileName, (char *)lobDataFile_.data(),lobDataFile_.length());
    --- End diff --
    
    On further thought, maybe there needs to be an extra check in the sscp. in ::processLobRequest where we should check if another process on another node has already propgated/set the same lock into the local shared segment and if so error out and ensure that the current  SetLobkLock call fails .  This way only one of them succeeds. There can be cases where both processes repeatedly fail but with AQR and erroring out seems like a safer thing to do. Will set @selvaganesang  comment on this issue. 


> LOB: Add syntax to return filename  of a LOB data file for external LOBs.
> -------------------------------------------------------------------------
>
>                 Key: TRAFODION-2874
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2874
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>    Affects Versions: 2.3
>            Reporter: Sandhya Sundaresan
>            Assignee: Sandhya Sundaresan
>            Priority: Major
>
> For external LOBs,  Trafodion does not save the LOB data in it's internal trafodion namespace. It saves only the LOB  handle information and the actual LOB data remains outside in users namespace in HDFS.    So inserts are very eifficient. During extract from an external LOB today, we extract the LOB data from the external file and return it to the user. Need to extend the Extract syntax to also be able to return the external LOB data filename alone . 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)