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 25269200C87 for ; Wed, 17 May 2017 23:18:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2398B160BCB; Wed, 17 May 2017 21:18:10 +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 6747F160BAC for ; Wed, 17 May 2017 23:18:09 +0200 (CEST) Received: (qmail 9177 invoked by uid 500); 17 May 2017 21:18:08 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 9167 invoked by uid 99); 17 May 2017 21:18:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 May 2017 21:18:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3103D1A0318 for ; Wed, 17 May 2017 21:18:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id rF4so2zpS0zl for ; Wed, 17 May 2017 21:18:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 3F6485FDEE for ; Wed, 17 May 2017 21:18:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6107EE0BCA for ; Wed, 17 May 2017 21:18:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 332DF263A8 for ; Wed, 17 May 2017 21:18:04 +0000 (UTC) Date: Wed, 17 May 2017 21:18:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5379) Set Hdfs Block Size based on Parquet Block Size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 17 May 2017 21:18:10 -0000 [ https://issues.apache.org/jira/browse/DRILL-5379?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1601= 4792#comment-16014792 ]=20 ASF GitHub Bot commented on DRILL-5379: --------------------------------------- Github user ppadma commented on a diff in the pull request: https://github.com/apache/drill/pull/826#discussion_r117112378 =20 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parq= uet/ParquetRecordWriter.java --- @@ -380,14 +384,21 @@ public void endRecord() throws IOException { =20 // since ParquetFileWriter will overwrite empty output file (app= end is not supported) // we need to re-apply file permission - parquetFileWriter =3D new ParquetFileWriter(conf, schema, path, = ParquetFileWriter.Mode.OVERWRITE); + if (useConfiguredBlockSize) { + // Round up blockSize to multiple of 64K. + long writeBlockSize =3D ((long) ceil((double)blockSize/BLOCKSI= ZE_MULTIPLE)) * BLOCKSIZE_MULTIPLE; + // Passing writeBlockSize creates files with this blockSize in= stead of filesystem default blockSize. + // Currently, this is supported only by filesystems included i= n + // BLOCK_FS_SCHEMES (ParquetFileWriter.java in parquet-mr), wh= ich includes HDFS. + // For other filesystems, it uses default blockSize configured= for the file system. + parquetFileWriter =3D new ParquetFileWriter(conf, schema, path= , ParquetFileWriter.Mode.OVERWRITE, writeBlockSize, 0); + } else { + parquetFileWriter =3D new ParquetFileWriter(conf, schema, path= , ParquetFileWriter.Mode.OVERWRITE); --- End diff -- =20 No. It does not. If user had previously changed the parquet block size,= that will be used in checkBlockSizeReached as before. So, parquet rowGroup= size will be same as configured parquet blockSize (not default). This opti= on only changes the behavior of how we write that parquet row group onto di= sk i.e. single block or not.=20 > Set Hdfs Block Size based on Parquet Block Size > ----------------------------------------------- > > Key: DRILL-5379 > URL: https://issues.apache.org/jira/browse/DRILL-5379 > Project: Apache Drill > Issue Type: Improvement > Components: Storage - Parquet > Affects Versions: 1.9.0 > Reporter: F M=C3=A9thot > Fix For: Future > > > It seems there a way to force Drill to store CTAS generated parquet file = as a single block when using HDFS. Java HDFS API allows to do that, files c= ould be created with the Parquet block-size set in a session or system conf= ig. > Since it is ideal to have single parquet file per hdfs block. > Here is the HDFS API that allow to do that: > http://archive.cloudera.com/cdh4/cdh/4/hadoop/api/org/apache/hadoop/fs/Fi= leSystem.html#create(org.apache.hadoop.fs.Path,%20boolean,%20int,%20short,%= 20long) > http://archive.cloudera.com/cdh4/cdh/4/hadoop/api/org/apache/hadoop/fs/Fi= leSystem.html#create(org.apache.hadoop.fs.Path,%20boolean,%20int,%20short,%= 20long) > Drill uses the hadoop ParquetFileWriter (https://github.com/Parquet/parqu= et-mr/blob/master/parquet-hadoop/src/main/java/parquet/hadoop/ParquetFileWr= iter.java). > This is where the file creation occurs so it might be tricky. > However, ParquetRecordWriter.java (https://github.com/apache/drill/blob/m= aster/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Parq= uetRecordWriter.java) in Drill creates the ParquetFileWriter with an hadoop= configuration object. > something to explore: Could the block size be set as a property within th= e Configuration object before passing it to ParquetFileWriter constructor? -- This message was sent by Atlassian JIRA (v6.3.15#6346)