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 CC0A0200B50 for ; Fri, 29 Jul 2016 10:10:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CA7CC160A79; Fri, 29 Jul 2016 08:10:00 +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 E9B67160A61 for ; Fri, 29 Jul 2016 10:09:59 +0200 (CEST) Received: (qmail 11792 invoked by uid 500); 29 Jul 2016 08:09:59 -0000 Mailing-List: contact notifications-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list notifications@asterixdb.apache.org Received: (qmail 11783 invoked by uid 99); 29 Jul 2016 08:09:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2016 08:09:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E1E1CC8080 for ; Fri, 29 Jul 2016 08:09:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.919 X-Spam-Level: X-Spam-Status: No, score=0.919 tagged_above=-999 required=6.31 tests=[SPF_FAIL=0.919] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qzpsSN0YEzcG for ; Fri, 29 Jul 2016 08:09:57 +0000 (UTC) Received: from unhygienix.ics.uci.edu (unhygienix.ics.uci.edu [128.195.14.130]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4497760D31 for ; Fri, 29 Jul 2016 08:09:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by unhygienix.ics.uci.edu (Postfix) with ESMTP id 9F4B1242050; Fri, 29 Jul 2016 01:09:55 -0700 (PDT) Date: Fri, 29 Jul 2016 01:09:55 -0700 From: "Murtadha Hubail (Code Review)" To: Michael Blow Message-ID: Reply-To: hubailmor@gmail.com X-Gerrit-MessageType: newchange Subject: Change in asterixdb[master]: ASTERIXDB-1363: Fix NPE on bulkload failure X-Gerrit-Change-Id: Ic1626baa63371834cc2abbe30366df506d817da6 X-Gerrit-ChangeURL: X-Gerrit-Commit: 96adf67f261ceb55b1e275f08c21a34ac26d4d6f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.8.4 archived-at: Fri, 29 Jul 2016 08:10:01 -0000 Murtadha Hubail has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/1033 Change subject: ASTERIXDB-1363: Fix NPE on bulkload failure ...................................................................... ASTERIXDB-1363: Fix NPE on bulkload failure Change-Id: Ic1626baa63371834cc2abbe30366df506d817da6 --- A asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql M asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml M hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java 4 files changed, 76 insertions(+), 2 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/33/1033/1 diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql new file mode 100644 index 0000000..963e105 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.1.ddl.aql @@ -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. + */ +/* + * Description : Bulkload non-empty index. + * Expected Res : Failure + * Date : 29 July 2016 + */ +drop dataverse OpenTinySocial if exists; +create dataverse OpenTinySocial; +use dataverse OpenTinySocial; + +create type FacebookMessageType as { + message-id: int64 +}; + +create dataset FacebookMessages(FacebookMessageType) +primary key message-id; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql new file mode 100644 index 0000000..21db981 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/load/load_non-empty_index/load_non-empty_index.2.update.aql @@ -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. + */ +/* + * Description : Bulkload non-empty index. + * Expected Res : Failure + * Date : 29 July 2016 + */ +use dataverse OpenTinySocial; + +load dataset FacebookMessages +using localfs +(("path"="asterix_nc1://data/tinysocial/fbm.adm"),("format"="adm")); + +load dataset FacebookMessages +using localfs +(("path"="asterix_nc1://data/tinysocial/fbm.adm"),("format"="adm")); \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml index b675ece..0553fba 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml @@ -6380,6 +6380,12 @@ + + load_non-empty_index + Cannot load an index that is not empty + + + dataset-with-meta load dataset is not supported on Datasets with Meta records diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java index 36b46a7..56cad89 100644 --- a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java +++ b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexBulkLoadOperatorNodePushable.java @@ -97,7 +97,10 @@ @Override public void close() throws HyracksDataException { try { - bulkLoader.end(); + // bulkloader can be null if an exception is thrown before it is initialized. + if (bulkLoader != null) { + bulkLoader.end(); + } } catch (Throwable th) { throw new HyracksDataException(th); } finally { @@ -123,4 +126,4 @@ writer.fail(); } } -} +} \ No newline at end of file -- To view, visit https://asterix-gerrit.ics.uci.edu/1033 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1626baa63371834cc2abbe30366df506d817da6 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Murtadha Hubail