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 432A8200CDE for ; Tue, 8 Aug 2017 14:52:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4199816549E; Tue, 8 Aug 2017 12:52:17 +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 85A7216549B for ; Tue, 8 Aug 2017 14:52:16 +0200 (CEST) Received: (qmail 39560 invoked by uid 500); 8 Aug 2017 12:52:10 -0000 Mailing-List: contact dev-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 dev@arrow.apache.org Received: (qmail 39549 invoked by uid 99); 8 Aug 2017 12:52:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2017 12:52:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id F2C58C02CF for ; Tue, 8 Aug 2017 12:52:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id O19VHUdwqibj for ; Tue, 8 Aug 2017 12:52:05 +0000 (UTC) Received: from newmail.ccri.com (50-205-35-98-static.hfc.comcastbusiness.net [50.205.35.98]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 6653C5FB40 for ; Tue, 8 Aug 2017 12:52:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by newmail.ccri.com (Postfix) with ESMTP id D5497EB3B865 for ; Tue, 8 Aug 2017 08:52:03 -0400 (EDT) X-Virus-Scanned: amavisd-new at ccri.com Received: from newmail.ccri.com ([127.0.0.1]) by localhost (newmail.ccri.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3kqZH3lgdO73 for ; Tue, 8 Aug 2017 08:52:03 -0400 (EDT) Received: from [192.168.200.1] (unknown [192.168.200.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by newmail.ccri.com (Postfix) with ESMTPSA id AFA8EEB3B853 for ; Tue, 8 Aug 2017 08:52:03 -0400 (EDT) Subject: Re: buffer alignment (format/java/js) To: dev@arrow.apache.org References: From: Emilio Lahr-Vivaz Message-ID: Date: Tue, 8 Aug 2017 08:52:03 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US archived-at: Tue, 08 Aug 2017 12:52:17 -0000 After looking at it further, I think only the buffers themselves need to be aligned, not the metadata and/or schema. Would there be any problem with changing the alignment to 64 bytes then? Thanks, Emilio On 08/08/2017 08:08 AM, Emilio Lahr-Vivaz wrote: > I'm looking into buffer alignment in the java writer classes. > Currently some files written with the java streaming writer can't be > read due to the javascript TypedArray's restriction that the start > offset of the array must be a multiple of the data size of the array > type (i.e. Int32Vectors must start on a multiple of 4, Float64Vectors > must start on a multiple of 8, etc). From a cursory look at the java > writer, I believe that the schema that is written first is not aligned > at all, and then each record batch pads out its size to a multiple of > 8. So: > > 1. should the schema block pad itself so that the first record batch > is aligned, and is there any problem with doing so? > 2. is there any problem with changing the alignment to 64 bytes, as > recommended (but not required) by the spec? > > Thanks, > > Emilio