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 62D0E200B40 for ; Fri, 17 Jun 2016 01:03:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 616C5160A52; Thu, 16 Jun 2016 23:03:54 +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 AA26E160A51 for ; Fri, 17 Jun 2016 01:03:53 +0200 (CEST) Received: (qmail 19889 invoked by uid 500); 16 Jun 2016 23:03:52 -0000 Mailing-List: contact dev-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list dev@asterixdb.apache.org Received: (qmail 19877 invoked by uid 99); 16 Jun 2016 23:03:52 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2016 23:03:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 37EBEC0E86 for ; Thu, 16 Jun 2016 23:03:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.28 X-Spam-Level: * X-Spam-Status: No, score=1.28 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=uci-edu.20150623.gappssmtp.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id FvB5CcerMRiN for ; Thu, 16 Jun 2016 23:03:50 +0000 (UTC) Received: from mail-vk0-f52.google.com (mail-vk0-f52.google.com [209.85.213.52]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 90E725F1B3 for ; Thu, 16 Jun 2016 23:03:50 +0000 (UTC) Received: by mail-vk0-f52.google.com with SMTP id u64so93902425vkf.3 for ; Thu, 16 Jun 2016 16:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uci-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=LUWKT/dvtJcCcqwmm0ZfCEEY0GUcdrcHwIDwOvhbGUw=; b=w2LoUFN7chWV5LM34P0T0VGAGzKtSKoKB0Pz8QAftko1cOa7AE2efSW99rsHGbrStZ UKyfCEAmWhWauLjdP9ukaXsawyIu43dMpm4cbdjLONqs2mw1HOrWxRPtc407YjqH25KL bBm9VgMeJHZ293mjKM/9JnnNGvbyYon+6R3+0ojUjITzYJUhYayBlQGzCnRUFfgKvk6x P/da7n6j9LIa+KKRDpHcSbyHTka4DEHE78QZghupTuQZtD7HP2SzcMPBlxiytY0LHx70 JKd1PJThK7K/FnJFAfvsIzDugpbmuebE4H8AnKlIH3ezvWQYdNzqHUD0gRyK48fl/W3Z 027A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=LUWKT/dvtJcCcqwmm0ZfCEEY0GUcdrcHwIDwOvhbGUw=; b=Knu+q2jNhg4J1NAfXiGPp5xOt1gSbom2aj9pZV0JsOb8449I2bgacd7tsLZIUCUsMK /+oqIBETCGOjD+1y0pyT6hjfi32pQuDGb7gZKzgv1IMrjLIBk3sqFn6JDDwhU357K7jV C+x/jesGMylAGz4kzVsmhZwE304T+JKKkq5vsTYuSEaKi8nZO5ahe0aRZR8Be0oTqkuz HCX9dTbeA9VTFtP0l9QfrgCnlBvZoDwPnUJ2c3Hb1oJAdLVbziWLMx5dvgasFJIl3bfQ YPbfJSmFbVJeoOZ+Xya7CjjTxYSAvHRjjfNY0QdqH+KrPD1AYd5ROyfefTYg8TQJpvNe Q1MA== X-Gm-Message-State: ALyK8tICx0GUUoX/aqFvZ0YXrmTJ3CMU84CtmIDsWnWhC2+cq43+3l/MXziFY57NWXKHy4XH8aW4zpdf5i4AXg== X-Received: by 10.176.64.37 with SMTP id h34mr3462917uad.112.1466118229793; Thu, 16 Jun 2016 16:03:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.64.2 with HTTP; Thu, 16 Jun 2016 16:03:30 -0700 (PDT) In-Reply-To: References: From: Ian Maxon Date: Thu, 16 Jun 2016 16:03:30 -0700 Message-ID: Subject: Re: Unsigned integers data types To: dev@asterixdb.apache.org Content-Type: multipart/alternative; boundary=94eb2c122f9249434705356d40e9 archived-at: Thu, 16 Jun 2016 23:03:54 -0000 --94eb2c122f9249434705356d40e9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable My 0.2c is that int64 is big enough if size was the consideration. Usually, the times that I have wished I had unsigned integers in Java, were not related to size constraints, but rather when I had to implement something that required a lot of bitwise operations, since signedness makes that more complicated. Usually int64 is big enough, and if it isn't, uint64 isn't much better because you are probably representing something so huge that arbitrary precision arithmetic is more appropriate. On Thu, Jun 16, 2016 at 3:47 PM, Ildar Absalyamov < ildar.absalyamov@gmail.com> wrote: > Things like Spark and Flink don=E2=80=99t do that as well, but because th= ey need > integration with proper Java types. > > > On Jun 16, 2016, at 15:45, Yingyi Bu wrote: > > > >>> Is there any database or SQL implementation supporting that? > > Ok, it turns out MySQL supports that, while Postgres, MS SQL and Hive = do > > not have that. > > > > Best, > > Yingyi > > > > On Thu, Jun 16, 2016 at 3:40 PM, Yingyi Bu wrote: > > > >>>> I guess part of the reason why we do that is because Java used to la= ck > >> native support of unsigned integers. > >> Is there any database or SQL implementation supporting that? > >> > >> FYI: > >> > >> > http://dba.stackexchange.com/questions/53050/why-arent-unsigned-integer-t= ypes-available-in-the-top-database-platforms > >> > >> Best, > >> Yingyi > >> > >> > >> On Thu, Jun 16, 2016 at 3:27 PM, Ildar Absalyamov < > >> ildar.absalyamov@gmail.com> wrote: > >> > >>> Hi devs, > >>> > >>> As I was generating various data distributions for statistics > experiments > >>> one thing kept bothering me. > >>> All Asterix integer types (int8, int16, int32, int64) are signed. > However > >>> majority of real use cases does not require negative integer values. > Seems > >>> like we are waisting half of the data range on something which does > not get > >>> used that often. I guess part of the reason why we do that is because > Java > >>> used to lack native support of unsigned integers. But since Java 8 > there > >>> are methods which do unsigned comparison and division (summation, > >>> subtraction, multiplication are the same in both signed and unsigned > >>> cases). So it seems like conversion to support unsigned integers woul= d > not > >>> be that difficult. > >>> > >>> Any thoughts on whether we need unsigned integers in the type system? > >>> > >>> Best regards, > >>> Ildar > >>> > >>> > >> > > Best regards, > Ildar > > --94eb2c122f9249434705356d40e9--