[jira] [Commented] (TRAFODION-2598) Insert Select to/from Trafodion tables containing LOB columns
[ https://issues.apache.org/jira/browse/TRAFODION-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15991148#comment-15991148 ] ASF GitHub Bot commented on TRAFODION-2598: --- 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. > 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)
[jira] [Commented] (TRAFODION-2598) Insert Select to/from Trafodion tables containing LOB columns
[ https://issues.apache.org/jira/browse/TRAFODION-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)
[jira] [Commented] (TRAFODION-2598) Insert Select to/from Trafodion tables containing LOB columns
[ https://issues.apache.org/jira/browse/TRAFODION-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15987646#comment-15987646 ] 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_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? > 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)
[jira] [Commented] (TRAFODION-2598) Insert Select to/from Trafodion tables containing LOB columns
[ https://issues.apache.org/jira/browse/TRAFODION-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15983761#comment-15983761 ] ASF GitHub Bot commented on TRAFODION-2598: --- 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 SundaresanDate: 2017-04-25T21:07:47Z Support for insert-select for tables containing LOB columns. commit 7e10b5a65e9dbafd469778108f1645374d2b1d54 Author: Sandhya Sundaresan Date: 2017-04-25T21:14:47Z Merge remote branch 'origin/master' > 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)