arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [15/17] arrow git commit: ARROW-4: This provides an partial C++11 implementation of the Apache Arrow data structures along with a cmake-based build system. The codebase generally follows Google C++ style guide, but more cleaning to be more conforming is
Date Wed, 17 Feb 2016 12:39:50 GMT
http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/build-support/run-test.sh
----------------------------------------------------------------------
diff --git a/cpp/build-support/run-test.sh b/cpp/build-support/run-test.sh
new file mode 100755
index 0000000..b203913
--- /dev/null
+++ b/cpp/build-support/run-test.sh
@@ -0,0 +1,195 @@
+#!/bin/bash
+# Copyright 2014 Cloudera, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Script which wraps running a test and redirects its output to a
+# test log directory.
+#
+# If KUDU_COMPRESS_TEST_OUTPUT is non-empty, then the logs will be
+# gzip-compressed while they are written.
+#
+# If KUDU_FLAKY_TEST_ATTEMPTS is non-zero, and the test being run matches
+# one of the lines in the file KUDU_FLAKY_TEST_LIST, then the test will
+# be retried on failure up to the specified number of times. This can be
+# used in the gerrit workflow to prevent annoying false -1s caused by
+# tests that are known to be flaky in master.
+#
+# If KUDU_REPORT_TEST_RESULTS is non-zero, then tests are reported to the
+# central test server.
+
+ROOT=$(cd $(dirname $BASH_SOURCE)/..; pwd)
+
+TEST_LOGDIR=$ROOT/build/test-logs
+mkdir -p $TEST_LOGDIR
+
+TEST_DEBUGDIR=$ROOT/build/test-debug
+mkdir -p $TEST_DEBUGDIR
+
+TEST_DIRNAME=$(cd $(dirname $1); pwd)
+TEST_FILENAME=$(basename $1)
+shift
+TEST_EXECUTABLE="$TEST_DIRNAME/$TEST_FILENAME"
+TEST_NAME=$(echo $TEST_FILENAME | perl -pe 's/\..+?$//') # Remove path and extension (if any).
+
+# We run each test in its own subdir to avoid core file related races.
+TEST_WORKDIR=$ROOT/build/test-work/$TEST_NAME
+mkdir -p $TEST_WORKDIR
+pushd $TEST_WORKDIR >/dev/null || exit 1
+rm -f *
+
+set -o pipefail
+
+LOGFILE=$TEST_LOGDIR/$TEST_NAME.txt
+XMLFILE=$TEST_LOGDIR/$TEST_NAME.xml
+
+TEST_EXECUTION_ATTEMPTS=1
+
+# Remove both the uncompressed output, so the developer doesn't accidentally get confused
+# and read output from a prior test run.
+rm -f $LOGFILE $LOGFILE.gz
+
+pipe_cmd=cat
+
+# Configure TSAN (ignored if this isn't a TSAN build).
+#
+# Deadlock detection (new in clang 3.5) is disabled because:
+# 1. The clang 3.5 deadlock detector crashes in some unit tests. It
+#    needs compiler-rt commits c4c3dfd, 9a8efe3, and possibly others.
+# 2. Many unit tests report lock-order-inversion warnings; they should be
+#    fixed before reenabling the detector.
+TSAN_OPTIONS="$TSAN_OPTIONS detect_deadlocks=0"
+TSAN_OPTIONS="$TSAN_OPTIONS suppressions=$ROOT/build-support/tsan-suppressions.txt"
+TSAN_OPTIONS="$TSAN_OPTIONS history_size=7"
+export TSAN_OPTIONS
+
+# Enable leak detection even under LLVM 3.4, where it was disabled by default.
+# This flag only takes effect when running an ASAN build.
+ASAN_OPTIONS="$ASAN_OPTIONS detect_leaks=1"
+export ASAN_OPTIONS
+
+# Set up suppressions for LeakSanitizer
+LSAN_OPTIONS="$LSAN_OPTIONS suppressions=$ROOT/build-support/lsan-suppressions.txt"
+export LSAN_OPTIONS
+
+# Suppressions require symbolization. We'll default to using the symbolizer in
+# thirdparty.
+if [ -z "$ASAN_SYMBOLIZER_PATH" ]; then
+  export ASAN_SYMBOLIZER_PATH=$(find $NATIVE_TOOLCHAIN/llvm-3.7.0/bin -name llvm-symbolizer)
+fi
+
+# Allow for collecting core dumps.
+ARROW_TEST_ULIMIT_CORE=${ARROW_TEST_ULIMIT_CORE:-0}
+ulimit -c $ARROW_TEST_ULIMIT_CORE
+
+# Run the actual test.
+for ATTEMPT_NUMBER in $(seq 1 $TEST_EXECUTION_ATTEMPTS) ; do
+  if [ $ATTEMPT_NUMBER -lt $TEST_EXECUTION_ATTEMPTS ]; then
+    # If the test fails, the test output may or may not be left behind,
+    # depending on whether the test cleaned up or exited immediately. Either
+    # way we need to clean it up. We do this by comparing the data directory
+    # contents before and after the test runs, and deleting anything new.
+    #
+    # The comm program requires that its two inputs be sorted.
+    TEST_TMPDIR_BEFORE=$(find $TEST_TMPDIR -maxdepth 1 -type d | sort)
+  fi
+
+  # gtest won't overwrite old junit test files, resulting in a build failure
+  # even when retries are successful.
+  rm -f $XMLFILE
+
+  echo "Running $TEST_NAME, redirecting output into $LOGFILE" \
+    "(attempt ${ATTEMPT_NUMBER}/$TEST_EXECUTION_ATTEMPTS)"
+  $TEST_EXECUTABLE "$@" 2>&1 \
+    | $ROOT/build-support/asan_symbolize.py \
+    | c++filt \
+    | $ROOT/build-support/stacktrace_addr2line.pl $TEST_EXECUTABLE \
+    | $pipe_cmd > $LOGFILE
+  STATUS=$?
+
+  # TSAN doesn't always exit with a non-zero exit code due to a bug:
+  # mutex errors don't get reported through the normal error reporting infrastructure.
+  # So we make sure to detect this and exit 1.
+  #
+  # Additionally, certain types of failures won't show up in the standard JUnit
+  # XML output from gtest. We assume that gtest knows better than us and our
+  # regexes in most cases, but for certain errors we delete the resulting xml
+  # file and let our own post-processing step regenerate it.
+  export GREP=$(which egrep)
+  if zgrep --silent "ThreadSanitizer|Leak check.*detected leaks" $LOGFILE ; then
+    echo ThreadSanitizer or leak check failures in $LOGFILE
+    STATUS=1
+    rm -f $XMLFILE
+  fi
+
+  if [ $ATTEMPT_NUMBER -lt $TEST_EXECUTION_ATTEMPTS ]; then
+    # Now delete any new test output.
+    TEST_TMPDIR_AFTER=$(find $TEST_TMPDIR -maxdepth 1 -type d | sort)
+    DIFF=$(comm -13 <(echo "$TEST_TMPDIR_BEFORE") \
+                    <(echo "$TEST_TMPDIR_AFTER"))
+    for DIR in $DIFF; do
+      # Multiple tests may be running concurrently. To avoid deleting the
+      # wrong directories, constrain to only directories beginning with the
+      # test name.
+      #
+      # This may delete old test directories belonging to this test, but
+      # that's not typically a concern when rerunning flaky tests.
+      if [[ $DIR =~ ^$TEST_TMPDIR/$TEST_NAME ]]; then
+        echo Deleting leftover flaky test directory "$DIR"
+        rm -Rf "$DIR"
+      fi
+    done
+  fi
+
+  if [ "$STATUS" -eq "0" ]; then
+    break
+  elif [ "$ATTEMPT_NUMBER" -lt "$TEST_EXECUTION_ATTEMPTS" ]; then
+    echo Test failed attempt number $ATTEMPT_NUMBER
+    echo Will retry...
+  fi
+done
+
+# If we have a LeakSanitizer report, and XML reporting is configured, add a new test
+# case result to the XML file for the leak report. Otherwise Jenkins won't show
+# us which tests had LSAN errors.
+if zgrep --silent "ERROR: LeakSanitizer: detected memory leaks" $LOGFILE ; then
+    echo Test had memory leaks. Editing XML
+    perl -p -i -e '
+    if (m#</testsuite>#) {
+      print "<testcase name=\"LeakSanitizer\" status=\"run\" classname=\"LSAN\">\n";
+      print "  <failure message=\"LeakSanitizer failed\" type=\"\">\n";
+      print "    See txt log file for details\n";
+      print "  </failure>\n";
+      print "</testcase>\n";
+    }' $XMLFILE
+fi
+
+# Capture and compress core file and binary.
+COREFILES=$(ls | grep ^core)
+if [ -n "$COREFILES" ]; then
+  echo Found core dump. Saving executable and core files.
+  gzip < $TEST_EXECUTABLE > "$TEST_DEBUGDIR/$TEST_NAME.gz" || exit $?
+  for COREFILE in $COREFILES; do
+    gzip < $COREFILE > "$TEST_DEBUGDIR/$TEST_NAME.$COREFILE.gz" || exit $?
+  done
+  # Pull in any .so files as well.
+  for LIB in $(ldd $TEST_EXECUTABLE | grep $ROOT | awk '{print $3}'); do
+    LIB_NAME=$(basename $LIB)
+    gzip < $LIB > "$TEST_DEBUGDIR/$LIB_NAME.gz" || exit $?
+  done
+fi
+
+popd
+rm -Rf $TEST_WORKDIR
+
+exit $STATUS

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/build-support/stacktrace_addr2line.pl
----------------------------------------------------------------------
diff --git a/cpp/build-support/stacktrace_addr2line.pl b/cpp/build-support/stacktrace_addr2line.pl
new file mode 100755
index 0000000..7664bab
--- /dev/null
+++ b/cpp/build-support/stacktrace_addr2line.pl
@@ -0,0 +1,92 @@
+#!/usr/bin/perl
+# Copyright 2014 Cloudera, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################
+# This script will convert a stack trace with addresses:
+#     @           0x5fb015 kudu::master::Master::Init()
+#     @           0x5c2d38 kudu::master::MiniMaster::StartOnPorts()
+#     @           0x5c31fa kudu::master::MiniMaster::Start()
+#     @           0x58270a kudu::MiniCluster::Start()
+#     @           0x57dc71 kudu::CreateTableStressTest::SetUp()
+# To one with line numbers:
+#     @           0x5fb015 kudu::master::Master::Init() at /home/mpercy/src/kudu/src/master/master.cc:54
+#     @           0x5c2d38 kudu::master::MiniMaster::StartOnPorts() at /home/mpercy/src/kudu/src/master/mini_master.cc:52
+#     @           0x5c31fa kudu::master::MiniMaster::Start() at /home/mpercy/src/kudu/src/master/mini_master.cc:33
+#     @           0x58270a kudu::MiniCluster::Start() at /home/mpercy/src/kudu/src/integration-tests/mini_cluster.cc:48
+#     @           0x57dc71 kudu::CreateTableStressTest::SetUp() at /home/mpercy/src/kudu/src/integration-tests/create-table-stress-test.cc:61
+#
+# If the script detects that the output is not symbolized, it will also attempt
+# to determine the function names, i.e. it will convert:
+#     @           0x5fb015
+#     @           0x5c2d38
+#     @           0x5c31fa
+# To:
+#     @           0x5fb015 kudu::master::Master::Init() at /home/mpercy/src/kudu/src/master/master.cc:54
+#     @           0x5c2d38 kudu::master::MiniMaster::StartOnPorts() at /home/mpercy/src/kudu/src/master/mini_master.cc:52
+#     @           0x5c31fa kudu::master::MiniMaster::Start() at /home/mpercy/src/kudu/src/master/mini_master.cc:33
+#######################################################################
+use strict;
+use warnings;
+
+if (!@ARGV) {
+  die <<EOF
+Usage: $0 executable [stack-trace-file]
+
+This script will read addresses from a file containing stack traces and
+will convert the addresses that conform to the pattern " @ 0x123456" to line
+numbers by calling addr2line on the provided executable.
+If no stack-trace-file is specified, it will take input from stdin.
+EOF
+}
+
+# el6 and other older systems don't support the -p flag,
+# so we do our own "pretty" parsing.
+sub parse_addr2line_output($$) {
+  defined(my $output = shift) or die;
+  defined(my $lookup_func_name = shift) or die;
+  my @lines = grep { $_ ne '' } split("\n", $output);
+  my $pretty_str = '';
+  if ($lookup_func_name) {
+    $pretty_str .= ' ' . $lines[0];
+  }
+  $pretty_str .= ' at ' . $lines[1];
+  return $pretty_str;
+}
+
+my $binary = shift @ARGV;
+if (! -x $binary || ! -r $binary) {
+  die "Error: Cannot access executable ($binary)";
+}
+
+# Cache lookups to speed processing of files with repeated trace addresses.
+my %addr2line_map = ();
+
+# Disable stdout buffering
+$| = 1;
+
+# Reading from <ARGV> is magical in Perl.
+while (defined(my $input = <ARGV>)) {
+  if ($input =~ /^\s+\@\s+(0x[[:xdigit:]]{6,})(?:\s+(\S+))?/) {
+    my $addr = $1;
+    my $lookup_func_name = (!defined $2);
+    if (!exists($addr2line_map{$addr})) {
+      $addr2line_map{$addr} = `addr2line -ifC -e $binary $addr`;
+    }
+    chomp $input;
+    $input .= parse_addr2line_output($addr2line_map{$addr}, $lookup_func_name) . "\n";
+  }
+  print $input;
+}
+
+exit 0;

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/cmake_modules/CompilerInfo.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/CompilerInfo.cmake b/cpp/cmake_modules/CompilerInfo.cmake
new file mode 100644
index 0000000..0786068
--- /dev/null
+++ b/cpp/cmake_modules/CompilerInfo.cmake
@@ -0,0 +1,46 @@
+# Copyright 2013 Cloudera, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Sets COMPILER_FAMILY to 'clang' or 'gcc'
+# Sets COMPILER_VERSION to the version
+execute_process(COMMAND "${CMAKE_CXX_COMPILER}" -v
+                ERROR_VARIABLE COMPILER_VERSION_FULL)
+message(INFO " ${COMPILER_VERSION_FULL}")
+
+# clang on Linux and Mac OS X before 10.9
+if("${COMPILER_VERSION_FULL}" MATCHES ".*clang version.*")
+  set(COMPILER_FAMILY "clang")
+  string(REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+).*" "\\1"
+    COMPILER_VERSION "${COMPILER_VERSION_FULL}")
+# clang on Mac OS X 10.9 and later
+elseif("${COMPILER_VERSION_FULL}" MATCHES ".*based on LLVM.*")
+  set(COMPILER_FAMILY "clang")
+  string(REGEX REPLACE ".*based on LLVM ([0-9]+\\.[0.9]+).*" "\\1"
+    COMPILER_VERSION "${COMPILER_VERSION_FULL}")
+
+# clang on Mac OS X, XCode 7. No version replacement is done
+# because Apple no longer advertises the upstream LLVM version.
+elseif("${COMPILER_VERSION_FULL}" MATCHES "clang-700\\..*")
+  set(COMPILER_FAMILY "clang")
+
+# gcc
+elseif("${COMPILER_VERSION_FULL}" MATCHES ".*gcc version.*")
+  set(COMPILER_FAMILY "gcc")
+  string(REGEX REPLACE ".*gcc version ([0-9\\.]+).*" "\\1"
+    COMPILER_VERSION "${COMPILER_VERSION_FULL}")
+else()
+  message(FATAL_ERROR "Unknown compiler. Version info:\n${COMPILER_VERSION_FULL}")
+endif()
+message("Selected compiler ${COMPILER_FAMILY} ${COMPILER_VERSION}")
+

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/cmake_modules/FindGPerf.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/FindGPerf.cmake b/cpp/cmake_modules/FindGPerf.cmake
new file mode 100644
index 0000000..e831079
--- /dev/null
+++ b/cpp/cmake_modules/FindGPerf.cmake
@@ -0,0 +1,69 @@
+# -*- cmake -*-
+
+# - Find Google perftools
+# Find the Google perftools includes and libraries
+# This module defines
+#  GOOGLE_PERFTOOLS_INCLUDE_DIR, where to find heap-profiler.h, etc.
+#  GOOGLE_PERFTOOLS_FOUND, If false, do not try to use Google perftools.
+# also defined for general use are
+#  TCMALLOC_LIBS, where to find the tcmalloc libraries.
+#  TCMALLOC_STATIC_LIB, path to libtcmalloc.a.
+#  TCMALLOC_SHARED_LIB, path to libtcmalloc's shared library
+#  PROFILER_LIBS, where to find the profiler libraries.
+#  PROFILER_STATIC_LIB, path to libprofiler.a.
+#  PROFILER_SHARED_LIB, path to libprofiler's shared library
+
+FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h
+  $ENV{NATIVE_TOOLCHAIN}/gperftools-$ENV{GPERFTOOLS_VERSION}/include
+  NO_DEFAULT_PATH
+)
+
+SET(GPERF_LIB_SEARCH $ENV{NATIVE_TOOLCHAIN}/gperftools-$ENV{GPERFTOOLS_VERSION}/lib)
+
+FIND_LIBRARY(TCMALLOC_LIB_PATH
+  NAMES libtcmalloc.a
+  PATHS ${GPERF_LIB_SEARCH}
+  NO_DEFAULT_PATH
+)
+
+IF (TCMALLOC_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
+    SET(TCMALLOC_LIBS ${GPERF_LIB_SEARCH})
+    SET(TCMALLOC_LIB_NAME libtcmalloc)
+    SET(TCMALLOC_STATIC_LIB ${GPERF_LIB_SEARCH}/${TCMALLOC_LIB_NAME}.a)
+    SET(TCMALLOC_SHARED_LIB ${TCMALLOC_LIBS}/${TCMALLOC_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+    SET(GOOGLE_PERFTOOLS_FOUND "YES")
+ELSE (TCMALLOC_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
+  SET(GOOGLE_PERFTOOLS_FOUND "NO")
+ENDIF (TCMALLOC_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
+
+FIND_LIBRARY(PROFILER_LIB_PATH
+  NAMES libprofiler.a
+  PATHS ${GPERF_LIB_SEARCH}
+)
+
+IF (PROFILER_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
+  SET(PROFILER_LIBS ${GPERF_LIB_SEARCH})
+  SET(PROFILER_LIB_NAME libprofiler)
+  SET(PROFILER_STATIC_LIB ${GPERF_LIB_SEARCH}/${PROFILER_LIB_NAME}.a)
+  SET(PROFILER_SHARED_LIB ${PROFILER_LIBS}/${PROFILER_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+ENDIF (PROFILER_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
+
+IF (GOOGLE_PERFTOOLS_FOUND)
+  IF (NOT GPerf_FIND_QUIETLY)
+    MESSAGE(STATUS "Found the Google perftools library: ${TCMALLOC_LIBS}")
+  ENDIF (NOT GPerf_FIND_QUIETLY)
+ELSE (GOOGLE_PERFTOOLS_FOUND)
+  IF (GPerf_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "Could not find the Google perftools library")
+  ENDIF (GPerf_FIND_REQUIRED)
+ENDIF (GOOGLE_PERFTOOLS_FOUND)
+
+MARK_AS_ADVANCED(
+  TCMALLOC_LIBS
+  TCMALLOC_STATIC_LIB
+  TCMALLOC_SHARED_LIB
+  PROFILER_LIBS
+  PROFILER_STATIC_LIB
+  PROFILER_SHARED_LIB
+  GOOGLE_PERFTOOLS_INCLUDE_DIR
+)

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/cmake_modules/FindGTest.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/FindGTest.cmake b/cpp/cmake_modules/FindGTest.cmake
new file mode 100644
index 0000000..e47faf0
--- /dev/null
+++ b/cpp/cmake_modules/FindGTest.cmake
@@ -0,0 +1,91 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Tries to find GTest headers and libraries.
+#
+# Usage of this module as follows:
+#
+#  find_package(GTest)
+#
+# Variables used by this module, they can change the default behaviour and need
+# to be set before calling find_package:
+#
+#  GTest_HOME - When set, this path is inspected instead of standard library
+#                locations as the root of the GTest installation.
+#                The environment variable GTEST_HOME overrides this veriable.
+#
+# This module defines
+#  GTEST_INCLUDE_DIR, directory containing headers
+#  GTEST_LIBS, directory containing gtest libraries
+#  GTEST_STATIC_LIB, path to libgtest.a
+#  GTEST_SHARED_LIB, path to libgtest's shared library
+#  GTEST_FOUND, whether gtest has been found
+
+if( NOT "$ENV{GTEST_HOME}" STREQUAL "")
+    file( TO_CMAKE_PATH "$ENV{GTEST_HOME}" _native_path )
+    list( APPEND _gtest_roots ${_native_path} )
+elseif ( GTest_HOME )
+    list( APPEND _gtest_roots ${GTest_HOME} )
+endif()
+
+# Try the parameterized roots, if they exist
+if ( _gtest_roots )
+    find_path( GTEST_INCLUDE_DIR NAMES gtest/gtest.h
+        PATHS ${_gtest_roots} NO_DEFAULT_PATH
+        PATH_SUFFIXES "include" )
+    find_library( GTEST_LIBRARIES NAMES gtest
+        PATHS ${_gtest_roots} NO_DEFAULT_PATH
+        PATH_SUFFIXES "lib" )
+else ()
+    find_path( GTEST_INCLUDE_DIR NAMES gtest/gtest.h )
+    find_library( GTEST_LIBRARIES NAMES gtest )
+endif ()
+
+
+if (GTEST_INCLUDE_DIR AND GTEST_LIBRARIES)
+  set(GTEST_FOUND TRUE)
+  get_filename_component( GTEST_LIBS ${GTEST_LIBRARIES} DIRECTORY )
+  set(GTEST_LIB_NAME libgtest)
+  set(GTEST_STATIC_LIB ${GTEST_LIBS}/${GTEST_LIB_NAME}.a)
+  set(GTEST_SHARED_LIB ${GTEST_LIBS}/${GTEST_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+else ()
+  set(GTEST_FOUND FALSE)
+endif ()
+
+if (GTEST_FOUND)
+  if (NOT GTest_FIND_QUIETLY)
+    message(STATUS "Found the GTest library: ${GTEST_LIBRARIES}")
+  endif ()
+else ()
+  if (NOT GTest_FIND_QUIETLY)
+    set(GTEST_ERR_MSG "Could not find the GTest library. Looked in ")
+    if ( _gtest_roots )
+      set(GTEST_ERR_MSG "${GTEST_ERR_MSG} in ${_gtest_roots}.")
+    else ()
+      set(GTEST_ERR_MSG "${GTEST_ERR_MSG} system search paths.")
+    endif ()
+    if (GTest_FIND_REQUIRED)
+      message(FATAL_ERROR "${GTEST_ERR_MSG}")
+    else (GTest_FIND_REQUIRED)
+      message(STATUS "${GTEST_ERR_MSG}")
+    endif (GTest_FIND_REQUIRED)
+  endif ()
+endif ()
+
+mark_as_advanced(
+  GTEST_INCLUDE_DIR
+  GTEST_LIBS
+  GTEST_LIBRARIES
+  GTEST_STATIC_LIB
+  GTEST_SHARED_LIB
+)

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/cmake_modules/FindParquet.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/FindParquet.cmake b/cpp/cmake_modules/FindParquet.cmake
new file mode 100644
index 0000000..76c2d1d
--- /dev/null
+++ b/cpp/cmake_modules/FindParquet.cmake
@@ -0,0 +1,80 @@
+# Copyright 2012 Cloudera Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# - Find PARQUET (parquet/parquet.h, libparquet.a, libparquet.so)
+# This module defines
+#  PARQUET_INCLUDE_DIR, directory containing headers
+#  PARQUET_LIBS, directory containing parquet libraries
+#  PARQUET_STATIC_LIB, path to libparquet.a
+#  PARQUET_SHARED_LIB, path to libparquet's shared library
+#  PARQUET_FOUND, whether parquet has been found
+
+if( NOT "$ENV{PARQUET_HOME}" STREQUAL "")
+    file( TO_CMAKE_PATH "$ENV{PARQUET_HOME}" _native_path )
+    list( APPEND _parquet_roots ${_native_path} )
+elseif ( Parquet_HOME )
+    list( APPEND _parquet_roots ${Parquet_HOME} )
+endif()
+
+# Try the parameterized roots, if they exist
+if ( _parquet_roots )
+    find_path( PARQUET_INCLUDE_DIR NAMES parquet/parquet.h
+        PATHS ${_parquet_roots} NO_DEFAULT_PATH
+        PATH_SUFFIXES "include" )
+    find_library( PARQUET_LIBRARIES NAMES parquet
+        PATHS ${_parquet_roots} NO_DEFAULT_PATH
+        PATH_SUFFIXES "lib" )
+else ()
+    find_path( PARQUET_INCLUDE_DIR NAMES parquet/parquet.h )
+    find_library( PARQUET_LIBRARIES NAMES parquet )
+endif ()
+
+
+if (PARQUET_INCLUDE_DIR AND PARQUET_LIBRARIES)
+  set(PARQUET_FOUND TRUE)
+  get_filename_component( PARQUET_LIBS ${PARQUET_LIBRARIES} DIRECTORY )
+  set(PARQUET_LIB_NAME libparquet)
+  set(PARQUET_STATIC_LIB ${PARQUET_LIBS}/${PARQUET_LIB_NAME}.a)
+  set(PARQUET_SHARED_LIB ${PARQUET_LIBS}/${PARQUET_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+else ()
+  set(PARQUET_FOUND FALSE)
+endif ()
+
+if (PARQUET_FOUND)
+  if (NOT Parquet_FIND_QUIETLY)
+    message(STATUS "Found the Parquet library: ${PARQUET_LIBRARIES}")
+  endif ()
+else ()
+  if (NOT Parquet_FIND_QUIETLY)
+    set(PARQUET_ERR_MSG "Could not find the Parquet library. Looked in ")
+    if ( _parquet_roots )
+      set(PARQUET_ERR_MSG "${PARQUET_ERR_MSG} in ${_parquet_roots}.")
+    else ()
+      set(PARQUET_ERR_MSG "${PARQUET_ERR_MSG} system search paths.")
+    endif ()
+    if (Parquet_FIND_REQUIRED)
+      message(FATAL_ERROR "${PARQUET_ERR_MSG}")
+    else (Parquet_FIND_REQUIRED)
+      message(STATUS "${PARQUET_ERR_MSG}")
+    endif (Parquet_FIND_REQUIRED)
+  endif ()
+endif ()
+
+mark_as_advanced(
+  PARQUET_INCLUDE_DIR
+  PARQUET_LIBS
+  PARQUET_LIBRARIES
+  PARQUET_STATIC_LIB
+  PARQUET_SHARED_LIB
+)

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/cmake_modules/san-config.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/san-config.cmake b/cpp/cmake_modules/san-config.cmake
new file mode 100644
index 0000000..b847c96
--- /dev/null
+++ b/cpp/cmake_modules/san-config.cmake
@@ -0,0 +1,92 @@
+# Clang does not support using ASAN and TSAN simultaneously.
+if ("${ARROW_USE_ASAN}" AND "${ARROW_USE_TSAN}")
+  message(SEND_ERROR "Can only enable one of ASAN or TSAN at a time")
+endif()
+
+# Flag to enable clang address sanitizer
+# This will only build if clang or a recent enough gcc is the chosen compiler
+if (${ARROW_USE_ASAN})
+  if(NOT (("${COMPILER_FAMILY}" STREQUAL "clang") OR
+          ("${COMPILER_FAMILY}" STREQUAL "gcc" AND "${COMPILER_VERSION}" VERSION_GREATER "4.8")))
+    message(SEND_ERROR "Cannot use ASAN without clang or gcc >= 4.8")
+  endif()
+
+  # If UBSAN is also enabled, and we're on clang < 3.5, ensure static linking is
+  # enabled. Otherwise, we run into https://llvm.org/bugs/show_bug.cgi?id=18211
+  if("${ARROW_USE_UBSAN}" AND
+      "${COMPILER_FAMILY}" STREQUAL "clang" AND
+      "${COMPILER_VERSION}" VERSION_LESS "3.5")
+    if("${ARROW_LINK}" STREQUAL "a")
+      message("Using static linking for ASAN+UBSAN build")
+      set(ARROW_LINK "s")
+    elseif("${ARROW_LINK}" STREQUAL "d")
+      message(SEND_ERROR "Cannot use dynamic linking when ASAN and UBSAN are both enabled")
+    endif()
+  endif()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -DADDRESS_SANITIZER")
+endif()
+
+
+# Flag to enable clang undefined behavior sanitizer
+# We explicitly don't enable all of the sanitizer flags:
+# - disable 'vptr' because it currently crashes somewhere in boost::intrusive::list code
+# - disable 'alignment' because unaligned access is really OK on Nehalem and we do it
+#   all over the place.
+if (${ARROW_USE_UBSAN})
+  if(NOT (("${COMPILER_FAMILY}" STREQUAL "clang") OR
+          ("${COMPILER_FAMILY}" STREQUAL "gcc" AND "${COMPILER_VERSION}" VERSION_GREATER "4.9")))
+    message(SEND_ERROR "Cannot use UBSAN without clang or gcc >= 4.9")
+  endif()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize=alignment,vptr -fno-sanitize-recover")
+endif ()
+
+# Flag to enable thread sanitizer (clang or gcc 4.8)
+if (${ARROW_USE_TSAN})
+  if(NOT (("${COMPILER_FAMILY}" STREQUAL "clang") OR
+          ("${COMPILER_FAMILY}" STREQUAL "gcc" AND "${COMPILER_VERSION}" VERSION_GREATER "4.8")))
+    message(SEND_ERROR "Cannot use TSAN without clang or gcc >= 4.8")
+  endif()
+
+  add_definitions("-fsanitize=thread")
+
+  # Enables dynamic_annotations.h to actually generate code
+  add_definitions("-DDYNAMIC_ANNOTATIONS_ENABLED")
+
+  # changes atomicops to use the tsan implementations
+  add_definitions("-DTHREAD_SANITIZER")
+
+  # Disables using the precompiled template specializations for std::string, shared_ptr, etc
+  # so that the annotations in the header actually take effect.
+  add_definitions("-D_GLIBCXX_EXTERN_TEMPLATE=0")
+
+  # Some of the above also need to be passed to the linker.
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie -fsanitize=thread")
+
+  # Strictly speaking, TSAN doesn't require dynamic linking. But it does
+  # require all code to be position independent, and the easiest way to
+  # guarantee that is via dynamic linking (not all 3rd party archives are
+  # compiled with -fPIC e.g. boost).
+  if("${ARROW_LINK}" STREQUAL "a")
+    message("Using dynamic linking for TSAN")
+    set(ARROW_LINK "d")
+  elseif("${ARROW_LINK}" STREQUAL "s")
+    message(SEND_ERROR "Cannot use TSAN with static linking")
+  endif()
+endif()
+
+
+if ("${ARROW_USE_UBSAN}" OR "${ARROW_USE_ASAN}" OR "${ARROW_USE_TSAN}")
+  # GCC 4.8 and 4.9 (latest as of this writing) don't allow you to specify a
+  # sanitizer blacklist.
+  if("${COMPILER_FAMILY}" STREQUAL "clang")
+    # Require clang 3.4 or newer; clang 3.3 has issues with TSAN and pthread
+    # symbol interception.
+    if("${COMPILER_VERSION}" VERSION_LESS "3.4")
+      message(SEND_ERROR "Must use clang 3.4 or newer to run a sanitizer build."
+        " Try using clang from $NATIVE_TOOLCHAIN/")
+    endif()
+    add_definitions("-fsanitize-blacklist=${BUILD_SUPPORT_DIR}/sanitize-blacklist.txt")
+  else()
+    message(WARNING "GCC does not support specifying a sanitizer blacklist. Known sanitizer check failures will not be suppressed.")
+  endif()
+endif()

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/setup_build_env.sh
----------------------------------------------------------------------
diff --git a/cpp/setup_build_env.sh b/cpp/setup_build_env.sh
new file mode 100755
index 0000000..457b971
--- /dev/null
+++ b/cpp/setup_build_env.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -e
+
+SOURCE_DIR=$(cd "$(dirname "$BASH_SOURCE")"; pwd)
+
+./thirdparty/download_thirdparty.sh
+./thirdparty/build_thirdparty.sh
+
+export GTEST_HOME=$SOURCE_DIR/thirdparty/$GTEST_BASEDIR
+
+echo "Build env initialized"

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
new file mode 100644
index 0000000..eeea2db
--- /dev/null
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Headers: top level
+install(FILES
+  api.h
+  array.h
+  builder.h
+  type.h
+  DESTINATION include/arrow)
+
+#######################################
+# Unit tests
+#######################################
+
+set(ARROW_TEST_LINK_LIBS arrow_test_util ${ARROW_MIN_TEST_LIBS})
+
+ADD_ARROW_TEST(array-test)
+ADD_ARROW_TEST(field-test)

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/api.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/api.h b/cpp/src/arrow/api.h
new file mode 100644
index 0000000..899e8aa
--- /dev/null
+++ b/cpp/src/arrow/api.h
@@ -0,0 +1,21 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_API_H
+#define ARROW_API_H
+
+#endif // ARROW_API_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/array-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/array-test.cc b/cpp/src/arrow/array-test.cc
new file mode 100644
index 0000000..5ecf916
--- /dev/null
+++ b/cpp/src/arrow/array-test.cc
@@ -0,0 +1,92 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include <gtest/gtest.h>
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "arrow/array.h"
+#include "arrow/test-util.h"
+#include "arrow/type.h"
+#include "arrow/types/integer.h"
+#include "arrow/types/primitive.h"
+#include "arrow/util/buffer.h"
+
+using std::string;
+using std::vector;
+
+namespace arrow {
+
+static TypePtr int32 = TypePtr(new Int32Type());
+static TypePtr int32_nn = TypePtr(new Int32Type(false));
+
+
+class TestArray : public ::testing::Test {
+ public:
+  void SetUp() {
+    auto data = std::make_shared<OwnedMutableBuffer>();
+    auto nulls = std::make_shared<OwnedMutableBuffer>();
+
+    ASSERT_OK(data->Resize(400));
+    ASSERT_OK(nulls->Resize(128));
+
+    arr_.reset(new Int32Array(100, data, nulls));
+  }
+
+ protected:
+  std::unique_ptr<Int32Array> arr_;
+};
+
+
+TEST_F(TestArray, TestNullable) {
+  std::shared_ptr<Buffer> tmp = arr_->data();
+  std::unique_ptr<Int32Array> arr_nn(new Int32Array(100, tmp));
+
+  ASSERT_TRUE(arr_->nullable());
+  ASSERT_FALSE(arr_nn->nullable());
+}
+
+
+TEST_F(TestArray, TestLength) {
+  ASSERT_EQ(arr_->length(), 100);
+}
+
+TEST_F(TestArray, TestIsNull) {
+  vector<uint8_t> nulls = {1, 0, 1, 1, 0, 1, 0, 0,
+                           1, 0, 1, 1, 0, 1, 0, 0,
+                           1, 0, 1, 1, 0, 1, 0, 0,
+                           1, 0, 1, 1, 0, 1, 0, 0,
+                           1, 0, 0, 1};
+
+  std::shared_ptr<Buffer> null_buf = bytes_to_null_buffer(nulls.data(), nulls.size());
+  std::unique_ptr<Array> arr;
+  arr.reset(new Array(int32, nulls.size(), null_buf));
+
+  ASSERT_EQ(null_buf->size(), 5);
+  for (size_t i = 0; i < nulls.size(); ++i) {
+    ASSERT_EQ(static_cast<bool>(nulls[i]), arr->IsNull(i));
+  }
+}
+
+
+TEST_F(TestArray, TestCopy) {
+}
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/array.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/array.cc b/cpp/src/arrow/array.cc
new file mode 100644
index 0000000..1726a2f
--- /dev/null
+++ b/cpp/src/arrow/array.cc
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/array.h"
+
+#include "arrow/util/buffer.h"
+
+namespace arrow {
+
+// ----------------------------------------------------------------------
+// Base array class
+
+Array::Array(const TypePtr& type, int64_t length,
+    const std::shared_ptr<Buffer>& nulls) {
+  Init(type, length, nulls);
+}
+
+void Array::Init(const TypePtr& type, int64_t length,
+    const std::shared_ptr<Buffer>& nulls) {
+  type_ = type;
+  length_ = length;
+  nulls_ = nulls;
+
+  nullable_ = type->nullable;
+  if (nulls_) {
+    null_bits_ = nulls_->data();
+  }
+}
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/array.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/array.h b/cpp/src/arrow/array.h
new file mode 100644
index 0000000..c95450d
--- /dev/null
+++ b/cpp/src/arrow/array.h
@@ -0,0 +1,79 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_ARRAY_H
+#define ARROW_ARRAY_H
+
+#include <cstdint>
+#include <cstdlib>
+#include <memory>
+
+#include "arrow/type.h"
+#include "arrow/util/bit-util.h"
+#include "arrow/util/macros.h"
+
+namespace arrow {
+
+class Buffer;
+
+// Immutable data array with some logical type and some length. Any memory is
+// owned by the respective Buffer instance (or its parents). May or may not be
+// nullable.
+//
+// The base class only has a null array (if the data type is nullable)
+//
+// Any buffers used to initialize the array have their references "stolen". If
+// you wish to use the buffer beyond the lifetime of the array, you need to
+// explicitly increment its reference count
+class Array {
+ public:
+  Array() : length_(0), nulls_(nullptr), null_bits_(nullptr) {}
+  Array(const TypePtr& type, int64_t length,
+      const std::shared_ptr<Buffer>& nulls = nullptr);
+
+  virtual ~Array() {}
+
+  void Init(const TypePtr& type, int64_t length, const std::shared_ptr<Buffer>& nulls);
+
+  // Determine if a slot if null. For inner loops. Does *not* boundscheck
+  bool IsNull(int64_t i) const {
+    return nullable_ && util::get_bit(null_bits_, i);
+  }
+
+  int64_t length() const { return length_;}
+  bool nullable() const { return nullable_;}
+  const TypePtr& type() const { return type_;}
+  TypeEnum type_enum() const { return type_->type;}
+
+ protected:
+  TypePtr type_;
+  bool nullable_;
+  int64_t length_;
+
+  std::shared_ptr<Buffer> nulls_;
+  const uint8_t* null_bits_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Array);
+};
+
+
+typedef std::shared_ptr<Array> ArrayPtr;
+
+} // namespace arrow
+
+#endif

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/builder.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/builder.cc b/cpp/src/arrow/builder.cc
new file mode 100644
index 0000000..1fd7471
--- /dev/null
+++ b/cpp/src/arrow/builder.cc
@@ -0,0 +1,63 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/builder.h"
+
+#include <cstring>
+
+#include "arrow/util/bit-util.h"
+#include "arrow/util/buffer.h"
+#include "arrow/util/status.h"
+
+namespace arrow {
+
+Status ArrayBuilder::Init(int64_t capacity) {
+  capacity_ = capacity;
+
+  if (nullable_) {
+    int64_t to_alloc = util::ceil_byte(capacity) / 8;
+    nulls_ = std::make_shared<OwnedMutableBuffer>();
+    RETURN_NOT_OK(nulls_->Resize(to_alloc));
+    null_bits_ = nulls_->mutable_data();
+    memset(null_bits_, 0, to_alloc);
+  }
+  return Status::OK();
+}
+
+Status ArrayBuilder::Resize(int64_t new_bits) {
+  if (nullable_) {
+    int64_t new_bytes = util::ceil_byte(new_bits) / 8;
+    int64_t old_bytes = nulls_->size();
+    RETURN_NOT_OK(nulls_->Resize(new_bytes));
+    null_bits_ = nulls_->mutable_data();
+    if (old_bytes < new_bytes) {
+      memset(null_bits_ + old_bytes, 0, new_bytes - old_bytes);
+    }
+  }
+  return Status::OK();
+}
+
+Status ArrayBuilder::Advance(int64_t elements) {
+  if (nullable_ && length_ + elements > capacity_) {
+    return Status::Invalid("Builder must be expanded");
+  }
+  length_ += elements;
+  return Status::OK();
+}
+
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/builder.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/builder.h b/cpp/src/arrow/builder.h
new file mode 100644
index 0000000..b43668a
--- /dev/null
+++ b/cpp/src/arrow/builder.h
@@ -0,0 +1,101 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_BUILDER_H
+#define ARROW_BUILDER_H
+
+#include <cstdint>
+#include <memory>
+#include <vector>
+
+#include "arrow/type.h"
+#include "arrow/util/buffer.h"
+#include "arrow/util/macros.h"
+#include "arrow/util/status.h"
+
+namespace arrow {
+
+class Array;
+
+static constexpr int64_t MIN_BUILDER_CAPACITY = 1 << 8;
+
+// Base class for all data array builders
+class ArrayBuilder {
+ public:
+  explicit ArrayBuilder(const TypePtr& type)
+      : type_(type),
+        nullable_(type_->nullable),
+        nulls_(nullptr), null_bits_(nullptr),
+        length_(0),
+        capacity_(0) {}
+
+  virtual ~ArrayBuilder() {}
+
+  // For nested types. Since the objects are owned by this class instance, we
+  // skip shared pointers and just return a raw pointer
+  ArrayBuilder* child(int i) {
+    return children_[i].get();
+  }
+
+  int num_children() const {
+    return children_.size();
+  }
+
+  int64_t length() const { return length_;}
+  int64_t capacity() const { return capacity_;}
+  bool nullable() const { return nullable_;}
+
+  // Allocates requires memory at this level, but children need to be
+  // initialized independently
+  Status Init(int64_t capacity);
+
+  // Resizes the nulls array (if nullable)
+  Status Resize(int64_t new_bits);
+
+  // For cases where raw data was memcpy'd into the internal buffers, allows us
+  // to advance the length of the builder. It is your responsibility to use
+  // this function responsibly.
+  Status Advance(int64_t elements);
+
+  const std::shared_ptr<OwnedMutableBuffer>& nulls() const { return nulls_;}
+
+  // Creates new array object to hold the contents of the builder and transfers
+  // ownership of the data
+  virtual Status ToArray(Array** out) = 0;
+
+ protected:
+  TypePtr type_;
+  bool nullable_;
+
+  // If the type is not nullable, then null_ is nullptr after initialization
+  std::shared_ptr<OwnedMutableBuffer> nulls_;
+  uint8_t* null_bits_;
+
+  // Array length, so far. Also, the index of the next element to be added
+  int64_t length_;
+  int64_t capacity_;
+
+  // Child value array builders. These are owned by this class
+  std::vector<std::unique_ptr<ArrayBuilder> > children_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(ArrayBuilder);
+};
+
+} // namespace arrow
+
+#endif // ARROW_BUILDER_H_

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/field-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/field-test.cc b/cpp/src/arrow/field-test.cc
new file mode 100644
index 0000000..2bb8bad
--- /dev/null
+++ b/cpp/src/arrow/field-test.cc
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include <gtest/gtest.h>
+#include <memory>
+#include <string>
+
+#include "arrow/field.h"
+#include "arrow/type.h"
+#include "arrow/types/integer.h"
+
+using std::string;
+
+namespace arrow {
+
+TEST(TestField, Basics) {
+  TypePtr ftype = TypePtr(new Int32Type());
+  Field f0("f0", ftype);
+
+  ASSERT_EQ(f0.name, "f0");
+  ASSERT_EQ(f0.type->ToString(), ftype->ToString());
+}
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/field.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/field.h b/cpp/src/arrow/field.h
new file mode 100644
index 0000000..664cae6
--- /dev/null
+++ b/cpp/src/arrow/field.h
@@ -0,0 +1,48 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_FIELD_H
+#define ARROW_FIELD_H
+
+#include <string>
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+// A field is a piece of metadata that includes (for now) a name and a data
+// type
+
+struct Field {
+  // Field name
+  std::string name;
+
+  // The field's data type
+  TypePtr type;
+
+  Field(const std::string& name, const TypePtr& type) :
+      name(name), type(type) {}
+
+  bool Equals(const Field& other) const {
+    return (this == &other) || (this->name == other.name &&
+        this->type->Equals(other.type.get()));
+  }
+};
+
+} // namespace arrow
+
+#endif  // ARROW_FIELD_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/parquet/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/parquet/CMakeLists.txt b/cpp/src/arrow/parquet/CMakeLists.txt
new file mode 100644
index 0000000..7b449af
--- /dev/null
+++ b/cpp/src/arrow/parquet/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# ----------------------------------------------------------------------
+# arrow_parquet : Arrow <-> Parquet adapter
+
+set(PARQUET_SRCS
+)
+
+set(PARQUET_LIBS
+)
+
+add_library(arrow_parquet STATIC
+  ${PARQUET_SRCS}
+)
+target_link_libraries(arrow_parquet ${PARQUET_LIBS})
+SET_TARGET_PROPERTIES(arrow_parquet PROPERTIES LINKER_LANGUAGE CXX)
+
+# Headers: top level
+install(FILES
+  DESTINATION include/arrow/parquet)

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/test-util.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/test-util.h b/cpp/src/arrow/test-util.h
new file mode 100644
index 0000000..2233a4f
--- /dev/null
+++ b/cpp/src/arrow/test-util.h
@@ -0,0 +1,97 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TEST_UTIL_H_
+#define ARROW_TEST_UTIL_H_
+
+#include <gtest/gtest.h>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "arrow/util/bit-util.h"
+#include "arrow/util/random.h"
+#include "arrow/util/status.h"
+
+#define ASSERT_RAISES(ENUM, expr)               \
+  do {                                          \
+    Status s = (expr);                          \
+    ASSERT_TRUE(s.Is##ENUM());                  \
+  } while (0)
+
+
+#define ASSERT_OK(expr)                         \
+  do {                                          \
+    Status s = (expr);                          \
+    ASSERT_TRUE(s.ok());                        \
+  } while (0)
+
+
+#define EXPECT_OK(expr)                         \
+  do {                                          \
+    Status s = (expr);                          \
+    EXPECT_TRUE(s.ok());                        \
+  } while (0)
+
+
+namespace arrow {
+
+template <typename T>
+void randint(int64_t N, T lower, T upper, std::vector<T>* out) {
+  Random rng(random_seed());
+  uint64_t draw;
+  uint64_t span = upper - lower;
+  T val;
+  for (int64_t i = 0; i < N; ++i) {
+    draw = rng.Uniform64(span);
+    val = lower + static_cast<T>(draw);
+    out->push_back(val);
+  }
+}
+
+
+template <typename T>
+std::shared_ptr<Buffer> to_buffer(const std::vector<T>& values) {
+  return std::make_shared<Buffer>(reinterpret_cast<const uint8_t*>(values.data()),
+      values.size() * sizeof(T));
+}
+
+void random_nulls(int64_t n, double pct_null, std::vector<uint8_t>* nulls) {
+  Random rng(random_seed());
+  for (int i = 0; i < n; ++i) {
+    nulls->push_back(static_cast<uint8_t>(rng.NextDoubleFraction() > pct_null));
+  }
+}
+
+void random_nulls(int64_t n, double pct_null, std::vector<bool>* nulls) {
+  Random rng(random_seed());
+  for (int i = 0; i < n; ++i) {
+    nulls->push_back(rng.NextDoubleFraction() > pct_null);
+  }
+}
+
+std::shared_ptr<Buffer> bytes_to_null_buffer(uint8_t* bytes, int length) {
+  std::shared_ptr<Buffer> out;
+
+  // TODO(wesm): error checking
+  util::bytes_to_bits(bytes, length, &out);
+  return out;
+}
+
+} // namespace arrow
+
+#endif // ARROW_TEST_UTIL_H_

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/type.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/type.cc b/cpp/src/arrow/type.cc
new file mode 100644
index 0000000..492eee5
--- /dev/null
+++ b/cpp/src/arrow/type.cc
@@ -0,0 +1,22 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/type.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h
new file mode 100644
index 0000000..220f99f
--- /dev/null
+++ b/cpp/src/arrow/type.h
@@ -0,0 +1,180 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPE_H
+#define ARROW_TYPE_H
+
+#include <memory>
+#include <string>
+
+namespace arrow {
+
+// Physical data type that describes the memory layout of values. See details
+// for each type
+enum class LayoutEnum: char {
+  // A physical type consisting of some non-negative number of bytes
+  BYTE = 0,
+
+  // A physical type consisting of some non-negative number of bits
+  BIT = 1,
+
+  // A parametric variable-length value type. Full specification requires a
+  // child logical type
+  LIST = 2,
+
+  // A collection of multiple equal-length child arrays. Parametric type taking
+  // 1 or more child logical types
+  STRUCT = 3,
+
+  // An array with heterogeneous value types. Parametric types taking 1 or more
+  // child logical types
+  DENSE_UNION = 4,
+  SPARSE_UNION = 5
+};
+
+
+struct LayoutType {
+  LayoutEnum type;
+  explicit LayoutType(LayoutEnum type) : type(type) {}
+};
+
+
+// Data types in this library are all *logical*. They can be expressed as
+// either a primitive physical type (bytes or bits of some fixed size), a
+// nested type consisting of other data types, or another data type (e.g. a
+// timestamp encoded as an int64)
+//
+// Any data type can be nullable
+
+enum class TypeEnum: char {
+  // A degerate NULL type represented as 0 bytes/bits
+  NA = 0,
+
+  // Little-endian integer types
+  UINT8 = 1,
+  INT8 = 2,
+  UINT16 = 3,
+  INT16 = 4,
+  UINT32 = 5,
+  INT32 = 6,
+  UINT64 = 7,
+  INT64 = 8,
+
+  // A boolean value represented as 1 byte
+  BOOL = 9,
+
+  // A boolean value represented as 1 bit
+  BIT = 10,
+
+  // 4-byte floating point value
+  FLOAT = 11,
+
+  // 8-byte floating point value
+  DOUBLE = 12,
+
+  // CHAR(N): fixed-length UTF8 string with length N
+  CHAR = 13,
+
+  // UTF8 variable-length string as List<Char>
+  STRING = 14,
+
+  // VARCHAR(N): Null-terminated string type embedded in a CHAR(N + 1)
+  VARCHAR = 15,
+
+  // Variable-length bytes (no guarantee of UTF8-ness)
+  BINARY = 16,
+
+  // By default, int32 days since the UNIX epoch
+  DATE = 17,
+
+  // Exact timestamp encoded with int64 since UNIX epoch
+  // Default unit millisecond
+  TIMESTAMP = 18,
+
+  // Timestamp as double seconds since the UNIX epoch
+  TIMESTAMP_DOUBLE = 19,
+
+  // Exact time encoded with int64, default unit millisecond
+  TIME = 20,
+
+  // Precision- and scale-based decimal type. Storage type depends on the
+  // parameters.
+  DECIMAL = 21,
+
+  // Decimal value encoded as a text string
+  DECIMAL_TEXT = 22,
+
+  // A list of some logical data type
+  LIST = 30,
+
+  // Struct of logical types
+  STRUCT = 31,
+
+  // Unions of logical types
+  DENSE_UNION = 32,
+  SPARSE_UNION = 33,
+
+  // Union<Null, Int32, Double, String, Bool>
+  JSON_SCALAR = 50,
+
+  // User-defined type
+  USER = 60
+};
+
+
+struct DataType {
+  TypeEnum type;
+  bool nullable;
+
+  explicit DataType(TypeEnum type, bool nullable = true)
+      : type(type), nullable(nullable) {}
+
+  virtual bool Equals(const DataType* other) {
+    return (this == other) || (this->type == other->type &&
+        this->nullable == other->nullable);
+  }
+
+  virtual std::string ToString() const = 0;
+};
+
+
+typedef std::shared_ptr<LayoutType> LayoutPtr;
+typedef std::shared_ptr<DataType> TypePtr;
+
+
+struct BytesType : public LayoutType {
+  int size;
+
+  explicit BytesType(int size)
+      : LayoutType(LayoutEnum::BYTE),
+        size(size) {}
+
+  BytesType(const BytesType& other)
+      : BytesType(other.size) {}
+};
+
+struct ListLayoutType : public LayoutType {
+  LayoutPtr value_type;
+
+  explicit ListLayoutType(const LayoutPtr& value_type)
+      : LayoutType(LayoutEnum::BYTE),
+        value_type(value_type) {}
+};
+
+} // namespace arrow
+
+#endif  // ARROW_TYPE_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/CMakeLists.txt b/cpp/src/arrow/types/CMakeLists.txt
new file mode 100644
index 0000000..e090aea
--- /dev/null
+++ b/cpp/src/arrow/types/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#######################################
+# arrow_types
+#######################################
+
+set(TYPES_SRCS
+  construct.cc
+  floating.cc
+  integer.cc
+  json.cc
+  list.cc
+  primitive.cc
+  string.cc
+  struct.cc
+  union.cc
+)
+
+set(TYPES_LIBS
+)
+
+add_library(arrow_types STATIC
+  ${TYPES_SRCS}
+)
+target_link_libraries(arrow_types ${TYPES_LIBS})
+SET_TARGET_PROPERTIES(arrow_types PROPERTIES LINKER_LANGUAGE CXX)
+
+# Headers: top level
+install(FILES
+  boolean.h
+  collection.h
+  datetime.h
+  decimal.h
+  floating.h
+  integer.h
+  json.h
+  list.h
+  primitive.h
+  string.h
+  struct.h
+  union.h
+  DESTINATION include/arrow/types)
+
+
+ADD_ARROW_TEST(list-test)
+ADD_ARROW_TEST(primitive-test)
+ADD_ARROW_TEST(string-test)
+ADD_ARROW_TEST(struct-test)

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/binary.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/binary.h b/cpp/src/arrow/types/binary.h
new file mode 100644
index 0000000..a9f2004
--- /dev/null
+++ b/cpp/src/arrow/types/binary.h
@@ -0,0 +1,33 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_BINARY_H
+#define ARROW_TYPES_BINARY_H
+
+#include <string>
+#include <vector>
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+struct StringType : public DataType {
+};
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_BINARY_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/boolean.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/boolean.h b/cpp/src/arrow/types/boolean.h
new file mode 100644
index 0000000..31388c8
--- /dev/null
+++ b/cpp/src/arrow/types/boolean.h
@@ -0,0 +1,35 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_BOOLEAN_H
+#define ARROW_TYPES_BOOLEAN_H
+
+#include "arrow/types/primitive.h"
+
+namespace arrow {
+
+struct BooleanType : public PrimitiveType<BooleanType> {
+  PRIMITIVE_DECL(BooleanType, uint8_t, BOOL, 1, "bool");
+};
+
+typedef PrimitiveArrayImpl<BooleanType> BooleanArray;
+
+// typedef PrimitiveBuilder<BooleanType, BooleanArray> BooleanBuilder;
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_BOOLEAN_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/collection.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/collection.h b/cpp/src/arrow/types/collection.h
new file mode 100644
index 0000000..59ba614
--- /dev/null
+++ b/cpp/src/arrow/types/collection.h
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_COLLECTION_H
+#define ARROW_TYPES_COLLECTION_H
+
+#include <string>
+#include <vector>
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+template <TypeEnum T>
+struct CollectionType : public DataType {
+  std::vector<TypePtr> child_types_;
+
+  explicit CollectionType(bool nullable = true) : DataType(T, nullable) {}
+
+  const TypePtr& child(int i) const {
+    return child_types_[i];
+  }
+
+  int num_children() const {
+    return child_types_.size();
+  }
+};
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_COLLECTION_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/construct.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/construct.cc b/cpp/src/arrow/types/construct.cc
new file mode 100644
index 0000000..5176caf
--- /dev/null
+++ b/cpp/src/arrow/types/construct.cc
@@ -0,0 +1,88 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/types/construct.h"
+
+#include <memory>
+
+#include "arrow/types/floating.h"
+#include "arrow/types/integer.h"
+#include "arrow/types/list.h"
+#include "arrow/types/string.h"
+#include "arrow/util/status.h"
+
+namespace arrow {
+
+class ArrayBuilder;
+
+// Initially looked at doing this with vtables, but shared pointers makes it
+// difficult
+
+#define BUILDER_CASE(ENUM, BuilderType)                         \
+    case TypeEnum::ENUM:                                        \
+      *out = static_cast<ArrayBuilder*>(new BuilderType(type)); \
+      return Status::OK();
+
+Status make_builder(const TypePtr& type, ArrayBuilder** out) {
+  switch (type->type) {
+    BUILDER_CASE(UINT8, UInt8Builder);
+    BUILDER_CASE(INT8, Int8Builder);
+    BUILDER_CASE(UINT16, UInt16Builder);
+    BUILDER_CASE(INT16, Int16Builder);
+    BUILDER_CASE(UINT32, UInt32Builder);
+    BUILDER_CASE(INT32, Int32Builder);
+    BUILDER_CASE(UINT64, UInt64Builder);
+    BUILDER_CASE(INT64, Int64Builder);
+
+    // BUILDER_CASE(BOOL, BooleanBuilder);
+
+    BUILDER_CASE(FLOAT, FloatBuilder);
+    BUILDER_CASE(DOUBLE, DoubleBuilder);
+
+    BUILDER_CASE(STRING, StringBuilder);
+
+    case TypeEnum::LIST:
+      {
+        ListType* list_type = static_cast<ListType*>(type.get());
+        ArrayBuilder* value_builder;
+        RETURN_NOT_OK(make_builder(list_type->value_type, &value_builder));
+
+        // The ListBuilder takes ownership of the value_builder
+        ListBuilder* builder = new ListBuilder(type, value_builder);
+        *out = static_cast<ArrayBuilder*>(builder);
+        return Status::OK();
+      }
+    // BUILDER_CASE(CHAR, CharBuilder);
+
+    // BUILDER_CASE(VARCHAR, VarcharBuilder);
+    // BUILDER_CASE(BINARY, BinaryBuilder);
+
+    // BUILDER_CASE(DATE, DateBuilder);
+    // BUILDER_CASE(TIMESTAMP, TimestampBuilder);
+    // BUILDER_CASE(TIME, TimeBuilder);
+
+    // BUILDER_CASE(LIST, ListBuilder);
+    // BUILDER_CASE(STRUCT, StructBuilder);
+    // BUILDER_CASE(DENSE_UNION, DenseUnionBuilder);
+    // BUILDER_CASE(SPARSE_UNION, SparseUnionBuilder);
+
+    default:
+      return Status::NotImplemented(type->ToString());
+  }
+}
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/construct.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/construct.h b/cpp/src/arrow/types/construct.h
new file mode 100644
index 0000000..c0bfedd
--- /dev/null
+++ b/cpp/src/arrow/types/construct.h
@@ -0,0 +1,32 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_CONSTRUCT_H
+#define ARROW_TYPES_CONSTRUCT_H
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+class ArrayBuilder;
+class Status;
+
+Status make_builder(const TypePtr& type, ArrayBuilder** out);
+
+} // namespace arrow
+
+#endif // ARROW_BUILDER_H_

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/datetime.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/datetime.h b/cpp/src/arrow/types/datetime.h
new file mode 100644
index 0000000..b4d6252
--- /dev/null
+++ b/cpp/src/arrow/types/datetime.h
@@ -0,0 +1,79 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_DATETIME_H
+#define ARROW_TYPES_DATETIME_H
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+struct DateType : public DataType {
+  enum class Unit: char {
+    DAY = 0,
+    MONTH = 1,
+    YEAR = 2
+  };
+
+  Unit unit;
+
+  explicit DateType(Unit unit = Unit::DAY, bool nullable = true)
+      : DataType(TypeEnum::DATE, nullable),
+        unit(unit) {}
+
+  DateType(const DateType& other)
+      : DateType(other.unit, other.nullable) {}
+
+  static char const *name() {
+    return "date";
+  }
+
+  // virtual std::string ToString() {
+  //   return name();
+  // }
+};
+
+
+struct TimestampType : public DataType {
+  enum class Unit: char {
+    SECOND = 0,
+    MILLI = 1,
+    MICRO = 2,
+    NANO = 3
+  };
+
+  Unit unit;
+
+  explicit TimestampType(Unit unit = Unit::MILLI, bool nullable = true)
+      : DataType(TypeEnum::TIMESTAMP, nullable),
+        unit(unit) {}
+
+  TimestampType(const TimestampType& other)
+      : TimestampType(other.unit, other.nullable) {}
+
+  static char const *name() {
+    return "timestamp";
+  }
+
+  // virtual std::string ToString() {
+  //   return name();
+  // }
+};
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_DATETIME_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/decimal.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/decimal.h b/cpp/src/arrow/types/decimal.h
new file mode 100644
index 0000000..464c3ff
--- /dev/null
+++ b/cpp/src/arrow/types/decimal.h
@@ -0,0 +1,32 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_DECIMAL_H
+#define ARROW_TYPES_DECIMAL_H
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+struct DecimalType : public DataType {
+  int precision;
+  int scale;
+};
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_DECIMAL_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/floating.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/floating.cc b/cpp/src/arrow/types/floating.cc
new file mode 100644
index 0000000..bde2826
--- /dev/null
+++ b/cpp/src/arrow/types/floating.cc
@@ -0,0 +1,22 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/types/floating.h"
+
+namespace arrow {
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/floating.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/floating.h b/cpp/src/arrow/types/floating.h
new file mode 100644
index 0000000..7551ce6
--- /dev/null
+++ b/cpp/src/arrow/types/floating.h
@@ -0,0 +1,43 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_FLOATING_H
+#define ARROW_TYPES_FLOATING_H
+
+#include <string>
+
+#include "arrow/types/primitive.h"
+
+namespace arrow {
+
+struct FloatType : public PrimitiveType<FloatType> {
+  PRIMITIVE_DECL(FloatType, float, FLOAT, 4, "float");
+};
+
+struct DoubleType : public PrimitiveType<DoubleType> {
+  PRIMITIVE_DECL(DoubleType, double, DOUBLE, 8, "double");
+};
+
+typedef PrimitiveArrayImpl<FloatType> FloatArray;
+typedef PrimitiveArrayImpl<DoubleType> DoubleArray;
+
+typedef PrimitiveBuilder<FloatType, FloatArray> FloatBuilder;
+typedef PrimitiveBuilder<DoubleType, DoubleArray> DoubleBuilder;
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_FLOATING_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/integer.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/integer.cc b/cpp/src/arrow/types/integer.cc
new file mode 100644
index 0000000..4696536
--- /dev/null
+++ b/cpp/src/arrow/types/integer.cc
@@ -0,0 +1,22 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/types/integer.h"
+
+namespace arrow {
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/integer.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/integer.h b/cpp/src/arrow/types/integer.h
new file mode 100644
index 0000000..7e5eab5
--- /dev/null
+++ b/cpp/src/arrow/types/integer.h
@@ -0,0 +1,88 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_INTEGER_H
+#define ARROW_TYPES_INTEGER_H
+
+#include <cstdint>
+#include <string>
+
+#include "arrow/types/primitive.h"
+
+namespace arrow {
+
+struct UInt8Type : public PrimitiveType<UInt8Type> {
+  PRIMITIVE_DECL(UInt8Type, uint8_t, UINT8, 1, "uint8");
+};
+
+struct Int8Type : public PrimitiveType<Int8Type> {
+  PRIMITIVE_DECL(Int8Type, int8_t, INT8, 1, "int8");
+};
+
+struct UInt16Type : public PrimitiveType<UInt16Type> {
+  PRIMITIVE_DECL(UInt16Type, uint16_t, UINT16, 2, "uint16");
+};
+
+struct Int16Type : public PrimitiveType<Int16Type> {
+  PRIMITIVE_DECL(Int16Type, int16_t, INT16, 2, "int16");
+};
+
+struct UInt32Type : public PrimitiveType<UInt32Type> {
+  PRIMITIVE_DECL(UInt32Type, uint32_t, UINT32, 4, "uint32");
+};
+
+struct Int32Type : public PrimitiveType<Int32Type> {
+  PRIMITIVE_DECL(Int32Type, int32_t, INT32, 4, "int32");
+};
+
+struct UInt64Type : public PrimitiveType<UInt64Type> {
+  PRIMITIVE_DECL(UInt64Type, uint64_t, UINT64, 8, "uint64");
+};
+
+struct Int64Type : public PrimitiveType<Int64Type> {
+  PRIMITIVE_DECL(Int64Type, int64_t, INT64, 8, "int64");
+};
+
+// Array containers
+
+typedef PrimitiveArrayImpl<UInt8Type> UInt8Array;
+typedef PrimitiveArrayImpl<Int8Type> Int8Array;
+
+typedef PrimitiveArrayImpl<UInt16Type> UInt16Array;
+typedef PrimitiveArrayImpl<Int16Type> Int16Array;
+
+typedef PrimitiveArrayImpl<UInt32Type> UInt32Array;
+typedef PrimitiveArrayImpl<Int32Type> Int32Array;
+
+typedef PrimitiveArrayImpl<UInt64Type> UInt64Array;
+typedef PrimitiveArrayImpl<Int64Type> Int64Array;
+
+// Builders
+
+typedef PrimitiveBuilder<UInt8Type, UInt8Array> UInt8Builder;
+typedef PrimitiveBuilder<UInt16Type, UInt16Array> UInt16Builder;
+typedef PrimitiveBuilder<UInt32Type, UInt32Array> UInt32Builder;
+typedef PrimitiveBuilder<UInt64Type, UInt64Array> UInt64Builder;
+
+typedef PrimitiveBuilder<Int8Type, Int8Array> Int8Builder;
+typedef PrimitiveBuilder<Int16Type, Int16Array> Int16Builder;
+typedef PrimitiveBuilder<Int32Type, Int32Array> Int32Builder;
+typedef PrimitiveBuilder<Int64Type, Int64Array> Int64Builder;
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_INTEGER_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/json.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/json.cc b/cpp/src/arrow/types/json.cc
new file mode 100644
index 0000000..b29b957
--- /dev/null
+++ b/cpp/src/arrow/types/json.cc
@@ -0,0 +1,42 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/types/json.h"
+
+#include <vector>
+
+#include "arrow/types/boolean.h"
+#include "arrow/types/integer.h"
+#include "arrow/types/floating.h"
+#include "arrow/types/null.h"
+#include "arrow/types/string.h"
+#include "arrow/types/union.h"
+
+namespace arrow {
+
+static const TypePtr Null(new NullType());
+static const TypePtr Int32(new Int32Type());
+static const TypePtr String(new StringType());
+static const TypePtr Double(new DoubleType());
+static const TypePtr Bool(new BooleanType());
+
+static const std::vector<TypePtr> json_types = {Null, Int32, String,
+                                                Double, Bool};
+TypePtr JSONScalar::dense_type = TypePtr(new DenseUnionType(json_types));
+TypePtr JSONScalar::sparse_type = TypePtr(new SparseUnionType(json_types));
+
+} // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/23c4b08d/cpp/src/arrow/types/json.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/json.h b/cpp/src/arrow/types/json.h
new file mode 100644
index 0000000..91fd132
--- /dev/null
+++ b/cpp/src/arrow/types/json.h
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef ARROW_TYPES_JSON_H
+#define ARROW_TYPES_JSON_H
+
+#include "arrow/type.h"
+
+namespace arrow {
+
+struct JSONScalar : public DataType {
+  bool dense;
+
+  static TypePtr dense_type;
+  static TypePtr sparse_type;
+
+  explicit JSONScalar(bool dense = true, bool nullable = true)
+      : DataType(TypeEnum::JSON_SCALAR, nullable),
+        dense(dense) {}
+};
+
+} // namespace arrow
+
+#endif // ARROW_TYPES_JSON_H


Mime
View raw message