You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Eric Owhadi (JIRA)" <ji...@apache.org> on 2017/02/16 15:24:41 UTC

[jira] [Created] (TRAFODION-2488) merge statement with where clause refuse to work in Batch mode

Eric Owhadi created TRAFODION-2488:
--------------------------------------

             Summary: merge statement with where clause refuse to work in Batch mode
                 Key: TRAFODION-2488
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2488
             Project: Apache Trafodion
          Issue Type: Bug
          Components: client-jdbc-t4, connectivity-general
            Reporter: Eric Owhadi


merge into t on k1 = ? and k2 = ? 
when matched then update set (a,b,c,d) = (?,?,?,?) where c < ? 
when not matched then insert (k1,k2,a,b,c,d) values (?,?,?,?,?,?);

would refuse to run in batched mode using jdbc type 4 driver. error is:
*** ERROR[30019] Statement was compiled with scalar parameters and array values used during execution.

workaround:
merge into t on k1 = ? and k2 = ? 
when matched then update set (a,b,c,d) = (?,?,?,?) where c < TIMESTAMP '2014-01-27 17:11:10' 
when not matched then insert (k1,k2,a,b,c,d) values (?,?,?,?,?,?);

removing the parametric where clause resolve the problem if we can do so.

DLL:
CREATE TABLE t
  ( 
    k1                     CHAR(31) CHARACTER SET ISO88591 COLLATE
      DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
  , k2                             VARCHAR(256 CHARS) CHARACTER SET UTF8
      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
  , a                            LARGEINT DEFAULT NULL NOT SERIALIZED
  , b                            VARCHAR(50) CHARACTER SET ISO88591 COLLATE
      DEFAULT DEFAULT NULL NOT SERIALIZED
  , c                         TIMESTAMP(6) NO DEFAULT NOT NULL NOT
      DROPPABLE NOT SERIALIZED
  , d                          CHAR(1) CHARACTER SET ISO88591 COLLATE
      DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
  , PRIMARY KEY (k1 ASC, k2 ASC)
  )
  SALT USING 8 PARTITIONS
       ON (k1)
 ATTRIBUTES ALIGNED FORMAT 
  HBASE_OPTIONS 
  ( 
    DATA_BLOCK_ENCODING = 'FAST_DIFF',
    COMPRESSION = 'SNAPPY' 
  ) 
;



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