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 ED6F2200CC8 for ; Fri, 14 Jul 2017 21:32:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EBF0316E475; Fri, 14 Jul 2017 19:32:26 +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 3EEC616E473 for ; Fri, 14 Jul 2017 21:32:26 +0200 (CEST) Received: (qmail 62019 invoked by uid 500); 14 Jul 2017 19:32:25 -0000 Mailing-List: contact commits-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list commits@arrow.apache.org Received: (qmail 62010 invoked by uid 99); 14 Jul 2017 19:32:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2017 19:32:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5D584E8E6B; Fri, 14 Jul 2017 19:32:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wesm@apache.org To: commits@arrow.apache.org Message-Id: <1700af9a937f44f899003bb6a44548da@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: arrow git commit: ARROW-1200: C++: Switch DictionaryBuilder to signed integers Date: Fri, 14 Jul 2017 19:32:25 +0000 (UTC) archived-at: Fri, 14 Jul 2017 19:32:27 -0000 Repository: arrow Updated Branches: refs/heads/master c7e099520 -> 8cad26e3a ARROW-1200: C++: Switch DictionaryBuilder to signed integers Change-Id: I26e06bf361e032072d7cc1478c673da29e403b04 Author: Uwe L. Korn Closes #838 from xhochy/ARROW-1200 and squashes the following commits: 41b6afe7 [Uwe L. Korn] ARROW-1200: C++: Switch DictionaryBuilder to signed integers Project: http://git-wip-us.apache.org/repos/asf/arrow/repo Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/8cad26e3 Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/8cad26e3 Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/8cad26e3 Branch: refs/heads/master Commit: 8cad26e3a33752892767d63acea2186cd62d3c8e Parents: c7e0995 Author: Uwe L. Korn Authored: Fri Jul 14 15:32:20 2017 -0400 Committer: Wes McKinney Committed: Fri Jul 14 15:32:20 2017 -0400 ---------------------------------------------------------------------- cpp/src/arrow/array-test.cc | 20 ++++++++++---------- cpp/src/arrow/builder.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/arrow/blob/8cad26e3/cpp/src/arrow/array-test.cc ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/array-test.cc b/cpp/src/arrow/array-test.cc index bfdb923..01bef03 100644 --- a/cpp/src/arrow/array-test.cc +++ b/cpp/src/arrow/array-test.cc @@ -1524,9 +1524,9 @@ TYPED_TEST(TestDictionaryBuilder, Basic) { ASSERT_OK(dict_builder.Append(static_cast(2))); std::shared_ptr dict_array; ASSERT_OK(dict_builder.Finish(&dict_array)); - auto dtype = std::make_shared(uint8(), dict_array); + auto dtype = std::make_shared(int8(), dict_array); - UInt8Builder int_builder(default_memory_pool()); + Int8Builder int_builder(default_memory_pool()); ASSERT_OK(int_builder.Append(0)); ASSERT_OK(int_builder.Append(1)); ASSERT_OK(int_builder.Append(0)); @@ -1557,9 +1557,9 @@ TYPED_TEST(TestDictionaryBuilder, ArrayConversion) { ASSERT_OK(dict_builder.Append(static_cast(2))); std::shared_ptr dict_array; ASSERT_OK(dict_builder.Finish(&dict_array)); - auto dtype = std::make_shared(uint8(), dict_array); + auto dtype = std::make_shared(int8(), dict_array); - UInt8Builder int_builder(default_memory_pool()); + Int8Builder int_builder(default_memory_pool()); ASSERT_OK(int_builder.Append(0)); ASSERT_OK(int_builder.Append(1)); ASSERT_OK(int_builder.Append(0)); @@ -1578,7 +1578,7 @@ TYPED_TEST(TestDictionaryBuilder, DoubleTableSize) { DictionaryBuilder builder(default_memory_pool()); // Build expected data NumericBuilder dict_builder(default_memory_pool()); - UInt16Builder int_builder(default_memory_pool()); + Int16Builder int_builder(default_memory_pool()); // Fill with 1024 different values for (int64_t i = 0; i < 1024; i++) { @@ -1599,7 +1599,7 @@ TYPED_TEST(TestDictionaryBuilder, DoubleTableSize) { // Finalize expected data std::shared_ptr dict_array; ASSERT_OK(dict_builder.Finish(&dict_array)); - auto dtype = std::make_shared(uint16(), dict_array); + auto dtype = std::make_shared(int16(), dict_array); std::shared_ptr int_array; ASSERT_OK(int_builder.Finish(&int_array)); @@ -1624,9 +1624,9 @@ TEST(TestStringDictionaryBuilder, Basic) { ASSERT_OK(str_builder.Append("test2")); std::shared_ptr str_array; ASSERT_OK(str_builder.Finish(&str_array)); - auto dtype = std::make_shared(uint8(), str_array); + auto dtype = std::make_shared(int8(), str_array); - UInt8Builder int_builder(default_memory_pool()); + Int8Builder int_builder(default_memory_pool()); ASSERT_OK(int_builder.Append(0)); ASSERT_OK(int_builder.Append(1)); ASSERT_OK(int_builder.Append(0)); @@ -1642,7 +1642,7 @@ TEST(TestStringDictionaryBuilder, DoubleTableSize) { StringDictionaryBuilder builder(default_memory_pool()); // Build expected data StringBuilder str_builder(default_memory_pool()); - UInt16Builder int_builder(default_memory_pool()); + Int16Builder int_builder(default_memory_pool()); // Fill with 1024 different values for (int64_t i = 0; i < 1024; i++) { @@ -1665,7 +1665,7 @@ TEST(TestStringDictionaryBuilder, DoubleTableSize) { // Finalize expected data std::shared_ptr str_array; ASSERT_OK(str_builder.Finish(&str_array)); - auto dtype = std::make_shared(uint16(), str_array); + auto dtype = std::make_shared(int16(), str_array); std::shared_ptr int_array; ASSERT_OK(int_builder.Finish(&int_array)); http://git-wip-us.apache.org/repos/asf/arrow/blob/8cad26e3/cpp/src/arrow/builder.h ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/builder.h b/cpp/src/arrow/builder.h index 12f3683..c0a075b 100644 --- a/cpp/src/arrow/builder.h +++ b/cpp/src/arrow/builder.h @@ -759,7 +759,7 @@ class ARROW_EXPORT DictionaryBuilder : public ArrayBuilder { int mod_bitmask_; typename TypeTraits::BuilderType dict_builder_; - AdaptiveUIntBuilder values_builder_; + AdaptiveIntBuilder values_builder_; }; class ARROW_EXPORT BinaryDictionaryBuilder : public DictionaryBuilder {