Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 68D3276BD for ; Tue, 6 Sep 2011 21:53:36 +0000 (UTC) Received: (qmail 61534 invoked by uid 500); 6 Sep 2011 21:53:35 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 61258 invoked by uid 500); 6 Sep 2011 21:53:34 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 61243 invoked by uid 99); 6 Sep 2011 21:53:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 21:53:34 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 21:53:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A035183E75 for ; Tue, 6 Sep 2011 21:53:10 +0000 (UTC) Date: Tue, 6 Sep 2011 21:53:10 +0000 (UTC) From: "Rick Shaw (JIRA)" To: commits@cassandra.apache.org Message-ID: <1373813873.22488.1315345990652.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <503064357.4774.1310437740022.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-2883) Add Support for BigDecimal Java data type as the "DecimalType" AbstractType MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CASSANDRA-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098398#comment-13098398 ] Rick Shaw commented on CASSANDRA-2883: -------------------------------------- I store a full 32 bit integer encoding for the scale part of the data into C*, which is what the Java class {{BigDecimal}} supports. but for a scale factor that is crazy huge. I could easily be talked into using just a byte to support 128 or 256 scale. that is still 256 digits after the decimal... The unscaled value is stored like {{IntegerType}}. > Add Support for BigDecimal Java data type as the "DecimalType" AbstractType > --------------------------------------------------------------------------- > > Key: CASSANDRA-2883 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2883 > Project: Cassandra > Issue Type: Sub-task > Components: Core > Affects Versions: 0.8.1 > Reporter: Rick Shaw > Assignee: Rick Shaw > Priority: Trivial > Labels: CQL, JDBC,, lhf > Fix For: 0.8.6 > > Attachments: add-decimaltype-v1.txt > > > The JDBC Driver suite needs support for {{BigDecimal}} to complete it's data type support for {{ResultSet}} and {{PreparedStatement}}. This datatype could also be used to represent numeric (non-integer) counter values. This is a very simple addition to the collection of data types supported by Cassandra. It is quite versatile like {{BigInteger}}. It can represent decimal numbers of virtually any precision and scale. It is represented in Java as an arbitrary precision integer unscaled value ( think {{IntegerType}} )and a 32-bit integer scale factor, which could be represented as a {{IntegerType}} as well. This could share much of the logic from the {{BigInteger}} ({{IntegerType}}) implementation. > CQL would need to add a datatype (decimal?). Decimal literal support is already provided in CQL. > This is low hanging fruit. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira