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 3EC72200C8C for ; Tue, 6 Jun 2017 18:10:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3D232160BC3; Tue, 6 Jun 2017 16:10:27 +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 5B7C3160BC6 for ; Tue, 6 Jun 2017 18:10:26 +0200 (CEST) Received: (qmail 74035 invoked by uid 500); 6 Jun 2017 16:10:25 -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 73989 invoked by uid 99); 6 Jun 2017 16:10:24 -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; Tue, 06 Jun 2017 16:10:24 +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 BA07F1A046F for ; Tue, 6 Jun 2017 16:10:23 +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 YzoS4hPAIHBn for ; Tue, 6 Jun 2017 16:10:21 +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 55B7260DAD for ; Tue, 6 Jun 2017 16:10:20 +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 4F823E0D50 for ; Tue, 6 Jun 2017 16:10:19 +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 87F6121E16 for ; Tue, 6 Jun 2017 16:10:18 +0000 (UTC) Date: Tue, 6 Jun 2017 16:10:18 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5544) Out of heap running CTAS against text delimited MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 06 Jun 2017 16:10:27 -0000 [ https://issues.apache.org/jira/browse/DRILL-5544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16039174#comment-16039174 ] ASF GitHub Bot commented on DRILL-5544: --------------------------------------- Github user vdiravka commented on a diff in the pull request: https://github.com/apache/drill/pull/846#discussion_r119836279 --- Diff: exec/java-exec/src/main/java/org/apache/parquet/hadoop/ParquetColumnChunkPageWriteStore.java --- @@ -0,0 +1,269 @@ +/* + * 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. + */ +package org.apache.parquet.hadoop; + +import static org.apache.parquet.column.statistics.Statistics.getStatsBasedOnType; + +import java.io.Closeable; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.apache.drill.exec.store.parquet.ParquetDirectByteBufferAllocator; +import org.apache.parquet.bytes.BytesInput; +import org.apache.parquet.bytes.CapacityByteArrayOutputStream; +import org.apache.parquet.column.ColumnDescriptor; +import org.apache.parquet.column.Encoding; +import org.apache.parquet.column.page.DictionaryPage; +import org.apache.parquet.column.page.PageWriteStore; +import org.apache.parquet.column.page.PageWriter; +import org.apache.parquet.column.statistics.Statistics; +import org.apache.parquet.format.converter.ParquetMetadataConverter; +import org.apache.parquet.hadoop.CodecFactory.BytesCompressor; +import org.apache.parquet.io.ParquetEncodingException; +import org.apache.parquet.schema.MessageType; +import org.apache.parquet.bytes.ByteBufferAllocator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This is a copy of ColumnChunkPageWriteStore from parquet library except of OutputStream that is used here. + * Using of CapacityByteArrayOutputStream allows to use different ByteBuffer allocators. --- End diff -- Your first case is correct - for 10 runs * 512 (512Mb - default parquet block size in Drill) = 5Gb or for 40 runs we need 20Gb of memory. It is so much for heap memory, but ok for direct one. And we can control how much data can be buffered before writing to the disk with `store.parquet.block-size` option. > Out of heap running CTAS against text delimited > ----------------------------------------------- > > Key: DRILL-5544 > URL: https://issues.apache.org/jira/browse/DRILL-5544 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Parquet > Affects Versions: 1.10.0 > Environment: - 2 or 4 nodes cluster > - 4G or 8G of Java heap and more than 8G of direct memory > - planner.width.max_per_node = 40 > - store.parquet.compression = none > To generate lineitem.tbl file unzip dbgen.tgz archive and run: > {code}dbgen -TL -s 500{code} > Reporter: Vitalii Diravka > Assignee: Vitalii Diravka > Fix For: 1.11.0 > > Attachments: dbgen.tgz > > > This query causes the drillbit to hang: > {code} > create table xyz as > select > cast(columns[0] as bigint) l_orderkey, > cast(columns[1] as integer) l_poartkey, > cast(columns[2] as integer) l_suppkey, > cast(columns[3] as integer) l_linenumber, > cast(columns[4] as double) l_quantity, > cast(columns[5] as double) l_extendedprice, > cast(columns[6] as double) l_discount, > cast(columns[7] as double) l_tax, > cast(columns[8] as char(1)) l_returnflag, > cast(columns[9] as char(1)) l_linestatus, > cast(columns[10] as date) l_shipdate, > cast(columns[11] as date) l_commitdate, > cast(columns[12] as date) l_receiptdate, > cast(columns[13] as char(25)) l_shipinstruct, > cast(columns[14] as char(10)) l_shipmode, > cast(columns[15] as varchar(44)) l_comment > from > `lineitem.tbl`; > {code} > OOM "Java heap space" from the drillbit.log: > {code:title=drillbit.log|borderStyle=solid} > ... > 2017-02-07 22:38:11,031 [2765b496-0b5b-a3df-c252-a8bb9cd2e52f:frag:1:53] DEBUG o.a.d.e.s.p.ParquetDirectByteBufferAllocator - ParquetDirectByteBufferAllocator: Allocated 209715 bytes. Allocated ByteBuffer id: 1563631814 > 2017-02-07 22:38:16,478 [2765b496-0b5b-a3df-c252-a8bb9cd2e52f:frag:1:1] ERROR o.a.d.exec.server.BootStrapContext - org.apache.drill.exec.work.WorkManager$WorkerBee$1.run() leaked an exception. > java.lang.OutOfMemoryError: Java heap space > 2017-02-07 22:38:17,391 [2765b496-0b5b-a3df-c252-a8bb9cd2e52f:frag:1:13] ERROR o.a.drill.common.CatastrophicFailure - Catastrophic Failure Occurred, exiting. Information message: Unable to handle out of memory condition in FragmentExecutor. > ... > {code} > To reproduce the issue please see environment details. -- This message was sent by Atlassian JIRA (v6.3.15#6346)