Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 49D95200D42 for ; Fri, 17 Nov 2017 10:27:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 480D5160C0A; Fri, 17 Nov 2017 09:27:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 96E38160BF8 for ; Fri, 17 Nov 2017 10:27:06 +0100 (CET) Received: (qmail 2506 invoked by uid 500); 17 Nov 2017 09:27:05 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 2495 invoked by uid 99); 17 Nov 2017 09:27:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Nov 2017 09:27:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 87768C659C for ; Fri, 17 Nov 2017 09:27:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 3uupWmd9XLoe for ; Fri, 17 Nov 2017 09:27:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 431245FB4E for ; Fri, 17 Nov 2017 09:27:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A2BC6E25A3 for ; Fri, 17 Nov 2017 09:27:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id ABFAE2410E for ; Fri, 17 Nov 2017 09:27:00 +0000 (UTC) Date: Fri, 17 Nov 2017 09:27:00 +0000 (UTC) From: "Samarth Jain (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4369) ArrayIndexOutOfBounds when upserting to table using ROW_TIMESTAMP MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 17 Nov 2017 09:27:07 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-4369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16256713#comment-16256713 ] Samarth Jain commented on PHOENIX-4369: --------------------------------------- Looked at it briefly. Looks like an issue when the ROW_TIMESTAMP column's data type is TIMESTAMP. [~arfield], as a work around, you can have the PK_ROW_TIMESTAMP as DATE. > ArrayIndexOutOfBounds when upserting to table using ROW_TIMESTAMP > ----------------------------------------------------------------- > > Key: PHOENIX-4369 > URL: https://issues.apache.org/jira/browse/PHOENIX-4369 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.10.0 > Environment: Ubuntu 16.04, JRE 1.8.0_102_x64 > Reporter: Alex Field > Labels: SFDC > > Used this DDL to create a table which uses ROW_TIMESTAMP > CREATE TABLE IF NOT EXISTS FOO ( > TENANT_ID CHAR(15) NOT NULL, > PK_BAR VARCHAR(80) NOT NULL, -- NAME > PK_ROW_TIMESTAMP TIMESTAMP NOT NULL, > FIZZ TIMESTAMP, > BUZZ VARCHAR(255), -- LABEL > BAZZ CHAR(15), -- VERSION_ID > QUX INTEGER, > HODOR VARCHAR(100000) -- A json blob. > CONSTRAINT PK PRIMARY KEY (TENANT_ID, PK_BAR, PK_ROW_TIMESTAMP ROW_TIMESTAMP) > ) VERSIONS=3,MULTI_TENANT=true,REPLICATION_SCOPE=1 > Upsert causes this exception: > java.lang.ArrayIndexOutOfBoundsException: 8 > at org.apache.phoenix.execute.MutationState.getNewRowKeyWithRowTimestamp(MutationState.java:554) > at org.apache.phoenix.execute.MutationState.generateMutations(MutationState.java:640) > at org.apache.phoenix.execute.MutationState.addRowMutations(MutationState.java:572) > at org.apache.phoenix.execute.MutationState.send(MutationState.java:1003) > at org.apache.phoenix.execute.MutationState.send(MutationState.java:1469) > at org.apache.phoenix.execute.MutationState.commit(MutationState.java:1301) > at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:533) > at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:530) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) > at org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:530) > Here's a copy of the test driver: > @Test > public void testSomething() throws Exception { > String sql = "UPSERT INTO FOO (BUZZ, BAZZ, PK_BAR) VALUES (?, ?, ?)"; > try (PreparedStatement stmt = conn.prepareStatement(sql)) { > stmt.setString(1, "blah blah"); > stmt.setString(2, null); > stmt.setString(3, "blah"); > stmt.execute(); > conn.commit(); > } > } -- This message was sent by Atlassian JIRA (v6.4.14#64029)