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 914D9200D71 for ; Thu, 21 Dec 2017 03:49:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8FC5C160C18; Thu, 21 Dec 2017 02:49:10 +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 D70BF160C15 for ; Thu, 21 Dec 2017 03:49:09 +0100 (CET) Received: (qmail 11088 invoked by uid 500); 21 Dec 2017 02:49:09 -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 11077 invoked by uid 99); 21 Dec 2017 02:49:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2017 02:49:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 46FE71809B6 for ; Thu, 21 Dec 2017 02:49:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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, RCVD_IN_DNSWL_NONE=-0.0001, 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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id nIh0GDzTXala for ; Thu, 21 Dec 2017 02:49:07 +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 909EB5FB72 for ; Thu, 21 Dec 2017 02:49:06 +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 AFB74E0140 for ; Thu, 21 Dec 2017 02:49:05 +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 F145424116 for ; Thu, 21 Dec 2017 02:49:02 +0000 (UTC) Date: Thu, 21 Dec 2017 02:49:02 +0000 (UTC) From: "Vincent Poon (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4382) Immutable table SINGLE_CELL_ARRAY_WITH_OFFSETS values starting with separator byte return null in query results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 21 Dec 2017 02:49:10 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16299450#comment-16299450 ] Vincent Poon commented on PHOENIX-4382: --------------------------------------- - TINYINT or BYTE(1) should work fine since I explicitly check for length == 2, but we can add a test case to make sure - If there are multiple null values, it actually makes things less ambiguous - that's the hack I used. So, for example, the way we can distinguish {separatorByte, 2} (representing two nulls), and an equivalent value, is that if it is supposed to represent a null, then the previous value should have a length of 0 (we know the length by checking the offsets). You only get the problem with a single null because you have no prior null length to check. - yes, BYTE(2) would have the same issue. - yea, variable length types should be fine - good point, agree probably not worth the effort - As for the subject, that would be accurate AFTER the patch. Again, before my patch, any column value starting with separator byte would be broken. That's why I found large portions of e.g. the BigInt range being returned as null, even though it's more than 2 bytes. I think we can put that line as a known issue with V1 on the storage schemes webpage. It's limited to just two specific two-byte fixed length values, though. > Immutable table SINGLE_CELL_ARRAY_WITH_OFFSETS values starting with separator byte return null in query results > --------------------------------------------------------------------------------------------------------------- > > Key: PHOENIX-4382 > URL: https://issues.apache.org/jira/browse/PHOENIX-4382 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.14.0 > Reporter: Vincent Poon > Assignee: Vincent Poon > Attachments: PHOENIX-4382.v1.master.patch, PHOENIX-4382.v2.master.patch, UpsertBigValuesIT.java > > > For immutable tables, upsert of some values like Short.MAX_VALUE results in a null value in query resultsets. Mutable tables are not affected. I tried with BigInt and got the same problem. > For Short, the breaking point seems to be 32512. > This is happening because of the way we serialize nulls. For nulls, we write out [separatorByte, #_of_nulls]. However, some data values, like Short.MAX_VALUE, start with separatorByte, we can't distinguish between a null and these values. Currently the code assumes it's a null when it sees a leading separatorByte, hence the incorrect query results. > See attached test - testShort() , testBigInt() -- This message was sent by Atlassian JIRA (v6.4.14#64029)