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

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

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

    
https://github.com/apache/incubator-trafodion/pull/1072#discussion_r113796988
  
    --- Diff: core/sql/generator/GenPreCode.cpp ---
    @@ -5570,18 +5570,36 @@ RelExpr * HbaseInsert::preCodeGen(Generator * 
generator,
                       li->lobSize() = tgtValueId.getType().getPrecision();
                  li->lobFsType() = tgtValueId.getType().getFSDatatype();
     
    -             li->lobNum() = col->lobNum();
    +             li->lobNum() = tgtCol->lobNum();
                       if ((child1Expr->getOperatorType() == ITM_CONSTANT) && 
                           !(((ConstValue *)child1Expr)->isNull()))
    -                    if (li->lobStorageType() != col->lobStorageType())
    +                    {
    +                    if (srcCol->lobStorageType() != 
tgtCol->lobStorageType())
                           {
                             *CmpCommon::diags() << DgSqlCode(-1432)
    -                                            << 
DgInt0((Int32)li->lobStorageType())
    -                                            << 
DgInt1((Int32)col->lobStorageType())
    -                                            << 
DgString0(col->getColName());
    +                                            << 
DgInt0((Int32)srcCol->lobStorageType())
    +                                            << 
DgInt1((Int32)tgtCol->lobStorageType())
    +                                            << 
DgString0(tgtCol->getColName());
                             GenExit();
                           }
    -             li->lobStorageLocation() = col->lobStorageLocation();
    +                    }
    +                    else
    +                      if ((child1Expr->getOperatorType() == 
ITM_BASECOLUMN)||
    +                          (child1Expr->getOperatorType() == 
ITM_INDEXCOLUMN))
    --- End diff --
    
    Can a LOB column be an index column?


> Insert Select to/from Trafodion tables containing LOB columns
> -------------------------------------------------------------
>
>                 Key: TRAFODION-2598
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2598
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>            Reporter: Sandhya Sundaresan
>            Assignee: Sandhya Sundaresan
>             Fix For: 2.2-incubating
>
>
> Get insert-select from LOB columns to target tables containing LOB columns to 
> work. Two cases need to be considered:
> 1. LOB columns thatt contain the lob data in HDFS (regular LOB columns)
> 2. LOB columns that contain external LOB data - the data is contained in 
> external LOB files - the Trafodion tables won't contain the LOB data. 
> Restrictions : If a table contains an external LOB column the target table 
> must also contain an external LOB column to be able to do an insert-select. 
> Cannot insert a regular LOB column into an external LOB column in target 
> table and vice versa. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to