You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by sandhyasun <gi...@git.apache.org> on 2017/04/25 22:31:23 UTC

[GitHub] incubator-trafodion pull request #1072: [TRAFODION-2598] Lob insert-select w...

GitHub user sandhyasun opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1072

    [TRAFODION-2598] Lob insert-select work from/to lob and external lob columns

    Support for moving LOB data from source to target table containing LOB columns. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sandhyasun/incubator-trafodion lob_inssel_work

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1072.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1072
    
----
commit b8cfdc87ec95694765ad2cd3ca892f95d0a1b5b2
Author: Sandhya Sundaresan <sa...@apache.org>
Date:   2017-04-25T21:07:47Z

    Support for insert-select for tables containing LOB columns.

commit 7e10b5a65e9dbafd469778108f1645374d2b1d54
Author: Sandhya Sundaresan <sa...@apache.org>
Date:   2017-04-25T21:14:47Z

    Merge remote branch 'origin/master'

----


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

[GitHub] incubator-trafodion pull request #1072: [TRAFODION-2598] Lob insert-select w...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafodion/pull/1072


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

[GitHub] incubator-trafodion pull request #1072: [TRAFODION-2598] Lob insert-select w...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1072#discussion_r113799176
  
    --- Diff: core/sql/exp/ExpLOBaccess.cpp ---
    @@ -2454,7 +2560,55 @@ Ex_Lob_Error ExLobsOper (
           err = lobPtr->writeDataSimple(source, sourceLen, subOperation, retOperLen,
     				    bufferSize , replication , blockSize);
           break;
    +    case Lob_InsSel:
    +      {
    +        
    +        ExLob *srcLobPtr;
    +        Int16 flags;
    +        Lng32  lobNum;
    +        Int32 lobType;
    +        Int64 uid, inDescSyskey, descPartnKey;
    +        short schNameLen;
    +        char schName[1024];
    --- End diff --
    
    I see several fixed-length char arrays here. Do we have guarantees that these won't overrun?


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

[GitHub] incubator-trafodion pull request #1072: [TRAFODION-2598] Lob insert-select w...

Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1072#discussion_r114160708
  
    --- 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 --
    
    This is restricted elsewhere in the binder.


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

[GitHub] incubator-trafodion pull request #1072: [TRAFODION-2598] Lob insert-select w...

Posted by DaveBirdsall <gi...@git.apache.org>.
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?


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