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 DD2B8200D0E for ; Tue, 12 Sep 2017 01:21:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DB34C1609C5; Mon, 11 Sep 2017 23:21:05 +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 2E33A1609C4 for ; Tue, 12 Sep 2017 01:21:05 +0200 (CEST) Received: (qmail 52695 invoked by uid 500); 11 Sep 2017 23:21:03 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 52686 invoked by uid 99); 11 Sep 2017 23:21:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2017 23:21:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B6B7718A831 for ; Mon, 11 Sep 2017 23:21:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id NJdrPVYKzBFh for ; Mon, 11 Sep 2017 23:21:01 +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 76CF060CE6 for ; Mon, 11 Sep 2017 23:21:01 +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 BDDE6E06BF for ; Mon, 11 Sep 2017 23:21:00 +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 4977124137 for ; Mon, 11 Sep 2017 23:21:00 +0000 (UTC) Date: Mon, 11 Sep 2017 23:21:00 +0000 (UTC) From: "Eugene Koifman (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-17138) FileSinkOperator doesn't create empty files for acid path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 11 Sep 2017 23:21:06 -0000 [ https://issues.apache.org/jira/browse/HIVE-17138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16162213#comment-16162213 ] Eugene Koifman commented on HIVE-17138: --------------------------------------- See also TestTxnNoBuckets.testUnionRemove() {noformat} int[][] values = {{1,2},{3,4},{5,6},{7,8},{9,10}}; runStatementOnDriver("insert into " + TxnCommandsBaseForTests.Table.ACIDTBL + makeValuesClause(values));//this creates 1 delta_0000013_0000013_0000/bucket_00001 {noformat} but before "move" in Hive I see 2 buckets - so we drop then empty 0 bucket during move somewhere... > FileSinkOperator doesn't create empty files for acid path > --------------------------------------------------------- > > Key: HIVE-17138 > URL: https://issues.apache.org/jira/browse/HIVE-17138 > Project: Hive > Issue Type: Bug > Components: Transactions > Affects Versions: 2.2.0 > Reporter: Eugene Koifman > Assignee: Eugene Koifman > > For bucketed tables, FileSinkOperator is expected (in some cases) to produce a specific number of files even if they are empty. > FileSinkOperator.closeOp(boolean abort) has logic to create files even if empty. > This doesn't property work for Acid path. For Insert, the OrcRecordUpdater(s) is set up in createBucketForFileIdx() which creates the actual bucketN file (as of HIVE-14007, it does it regardless of whether RecordUpdater sees any rows). This causes empty (i.e.ORC metadata only) bucket files to be created for multiFileSpray=true if a particular FileSinkOperator.process() sees at least 1 row. For example, > {noformat} > create table fourbuckets (a int, b int) clustered by (a) into 4 buckets stored as orc TBLPROPERTIES ('transactional'='true'); > insert into fourbuckets values(0,1),(1,1); > with mapreduce.job.reduces = 1 or 2 > {noformat} > For Update/Delete path, OrcRecordWriter is created lazily when the 1st row that needs to land there is seen. Thus it never creates empty buckets no mater what the value of _skipFiles_ in closeOp(boolean). > Once Split Update does the split early (in operator pipeline) only the Insert path will matter since base and delta are the only files split computation, etc looks at. delete_delta is only for Acid internals so there is never any reason for create empty files there. > Also make sure to close RecordUpdaters in FileSinkOperator.abortWriters() -- This message was sent by Atlassian JIRA (v6.4.14#64029)