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

Atanu Mishra commented on TRAFODION-199:
----------------------------------------

khaled Bouaziz (khaled-bouaziz) wrote on 2014-04-09:    #2
The traces I added showed that that data is inserted in batched of 121 rows and 
Esp 0 (there are 16 esps) is inserting the last batch of 121 rows twice before 
it sees the EOD
The last batch in Esp 1 through 15 have are lees that 121 in size

I made some changes (see attached) and got the right results for the upsert 
Orders query and seabase regression test suite
Is it possible to take a look at the changes and let me know

Weishiun Tsai (wei-shiun-tsai) on 2014-04-09
tags:   added: sql-exe
removed: sql
Julie Thai (julie-y-thai) wrote on 2014-06-06:  #3
Verified on RC2 (traf_20140606_0930):
Trafodion Conversational Interface 0.8.0
(c) Copyright 2014 Hewlett-Packard Development Company, LP.
>>create schema mysch;

--- SQL operation complete.
>>CREATE TABLE MYSCH.ORDERS
+> (
+> O_ORDERKEY INT NO DEFAULT NOT NULL
+> , O_CUSTKEY INT NO DEFAULT NOT NULL
+> , O_ORDERSTATUS CHAR(1) CHARACTER SET ISO88591 NO DEFAULT
      NOT NULL
+>+> , O_TOTALPRICE NUMERIC(12, 2) NO DEFAULT NOT NULL
+> , O_ORDERDATE DATE NO DEFAULT NOT NULL
+> , O_ORDERPRIORITY CHAR(15) CHARACTER SET ISO88591 NO
+> DEFAULT NOT NULL
+> , O_CLERK CHAR(15) CHARACTER SET ISO88591 NO
+> DEFAULT NOT NULL
+> , O_SHIPPRIORITY INT NO DEFAULT NOT NULL
+> , O_COMMENT VARCHAR(79) CHARACTER SET ISO88591 NO
+> DEFAULT NOT NULL
+> , PRIMARY KEY (O_ORDERKEY ASC)
+> )
+>;

--- SQL operation complete.
>>upsert using load into MYSCH.ORDERS
+>select o_orderkey, o_custkey, o_orderstatus, o_totalprice,
+>cast(o_orderdate as date), o_orderpriority, o_clerk,
+>o_shippriority, o_comment from hive.hive.orders;

--- 3000000 row(s) inserted.
>>>>select count(*) from mysch.orders;

(EXPR)
--------------------

             3000000

--- 1 row(s) selected.

Changed in trafodion:
status: Fix Committed → Fix Released


> LP Bug: 1294831 - Row count returned from upsert-using-load-into <traf-tbl> 
> from <hive-tbl> may be incorrect.
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-199
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-199
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>            Reporter: Julie Thai
>            Assignee: Apache Trafodion
>            Priority: Critical
>             Fix For: 1.0 (pre-incubation)
>
>
> Symptom:
> Row count returned from 'upsert using load into...' is inconsistent with 
> count(*) row count.
> >>upsert using load into mysch.orders select o_orderkey, o_custkey, 
> >>o_orderstatus, o_totalprice, cast(o_orderdate as date), o_orderpriority, 
> >>o_clerk, o_shippriority, o_comment from hive.hive.orders;
> --- 3000121 row(s) inserted.
> >>select count(*) from mysch.orders;
> (EXPR)
> --------------------
>              3000000
> --- 1 row(s) selected.
> To reproduce:
> 1. Setup hive table and load from text file (see attachment) with 3M rows:
>       CREATE TABLE orders
>         (
>               O_ORDERKEY                       INT
>         , O_CUSTKEY                        INT
>         , O_ORDERSTATUS                    STRING
>         , O_TOTALPRICE                     DOUBLE
>         , O_ORDERDATE                      TIMESTAMP
>         , O_ORDERPRIORITY                  STRING
>         , O_CLERK                          STRING
>         , O_SHIPPRIORITY                   INT
>         , O_COMMENT                        STRING
>         )
>       row format delimited fields terminated by '|'
>       ;
>       load data local inpath './orders.tbl' into table orders;
> 2. In traf, create table and upsert-using-load from hive table:
> create schema MYSCH;
> CREATE TABLE MYSCH.ORDERS
>   (
>     O_ORDERKEY                       INT NO DEFAULT NOT NULL
>   , O_CUSTKEY                        INT NO DEFAULT NOT NULL
>   , O_ORDERSTATUS                    CHAR(1) CHARACTER SET ISO88591  NO 
> DEFAULT
>       NOT NULL
>   , O_TOTALPRICE                     NUMERIC(12, 2) NO DEFAULT NOT NULL
>   , O_ORDERDATE                      DATE NO DEFAULT NOT NULL
>   , O_ORDERPRIORITY                  CHAR(15) CHARACTER SET ISO88591  NO
>       DEFAULT NOT NULL
>   , O_CLERK                          CHAR(15) CHARACTER SET ISO88591  NO
>       DEFAULT NOT NULL
>   , O_SHIPPRIORITY                   INT NO DEFAULT NOT NULL
>   , O_COMMENT                        VARCHAR(79) CHARACTER SET ISO88591  NO
>       DEFAULT NOT NULL
>   , PRIMARY KEY (O_ORDERKEY ASC)
>   )
> ;
> upsert using load into MYSCH.ORDERS 
> select o_orderkey, o_custkey, o_orderstatus, o_totalprice, 
> cast(o_orderdate as date), o_orderpriority, o_clerk, 
> o_shippriority, o_comment from hive.hive.orders;
> select count(*) from MYSCH.ORDERS;
> Assigned to LaunchPad User khaled Bouaziz



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to