Return-Path: X-Original-To: apmail-falcon-commits-archive@minotaur.apache.org Delivered-To: apmail-falcon-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A71A19A8B for ; Wed, 6 Apr 2016 20:40:08 +0000 (UTC) Received: (qmail 2533 invoked by uid 500); 6 Apr 2016 20:40:08 -0000 Delivered-To: apmail-falcon-commits-archive@falcon.apache.org Received: (qmail 2477 invoked by uid 500); 6 Apr 2016 20:40:07 -0000 Mailing-List: contact commits-help@falcon.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@falcon.apache.org Delivered-To: mailing list commits@falcon.apache.org Received: (qmail 2468 invoked by uid 99); 6 Apr 2016 20:40:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2016 20:40:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 50049DFDE0; Wed, 6 Apr 2016 20:40:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: balu@apache.org To: commits@falcon.apache.org Message-Id: <3e41f02baf5e49b0b18fd12bb4a997db@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: falcon git commit: FALCON-1881 Database export does not require fields tag in entity specification Date: Wed, 6 Apr 2016 20:40:07 +0000 (UTC) Repository: falcon Updated Branches: refs/heads/master 14b1bb8f4 -> fa66c17e9 FALCON-1881 Database export does not require fields tag in entity specification Database export does not require fields tag in entity specification Author: Venkatesan Ramachandran Reviewers: "Peeyush Bishnoi , Pallavi Rao , Balu Vellanki " Closes #83 from vramachan/FALCON-1881.20160331-1.ExportFieldsList Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/fa66c17e Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/fa66c17e Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/fa66c17e Branch: refs/heads/master Commit: fa66c17e967359c519c59717f52a705297595d3f Parents: 14b1bb8 Author: Venkatesan Ramachandran Authored: Wed Apr 6 13:39:42 2016 -0700 Committer: bvellanki Committed: Wed Apr 6 13:39:42 2016 -0700 ---------------------------------------------------------------------- .../falcon/entity/parser/FeedEntityParser.java | 16 +++-- .../entity/parser/FeedEntityParserTest.java | 4 +- .../feed/feed-export-exclude-fields-0.1.xml | 66 -------------------- .../config/feed/feed-export-fields-0.1.xml | 66 ++++++++++++++++++++ .../test/resources/feed-export-template6.xml | 6 -- 5 files changed, 79 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/fa66c17e/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java b/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java index c942862..2a9a852 100644 --- a/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java +++ b/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java @@ -110,7 +110,7 @@ public class FeedEntityParser extends EntityParser { if (FeedHelper.isExportEnabled(cluster)) { validateEntityExists(EntityType.DATASOURCE, FeedHelper.getExportDatasourceName(cluster)); validateFeedExportArgs(cluster); - validateFeedExportFieldExcludes(cluster); + validateFeedExportFields(cluster); } } @@ -709,10 +709,16 @@ public class FeedEntityParser extends EntityParser { } } - private void validateFeedExportFieldExcludes(Cluster feedCluster) throws FalconException { - if (FeedHelper.isFieldExcludes(feedCluster.getExport().getTarget())) { - throw new ValidationException(String.format("Field excludes are not supported " - + "currently in Feed import policy")); + /** + * Export infers the target fields from the destination. There is no need to enumerate or exclude the fields + * in the feed entity definition. + * + * @param feedCluster feed's cluster + * @throws FalconException + */ + private void validateFeedExportFields(Cluster feedCluster) throws FalconException { + if (feedCluster.getExport().getTarget().getFields() != null) { + throw new ValidationException(String.format("Feed Export does not expect Fields specification")); } } http://git-wip-us.apache.org/repos/asf/falcon/blob/fa66c17e/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java ---------------------------------------------------------------------- diff --git a/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java b/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java index 382a8c4..ceec3c4 100644 --- a/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java +++ b/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java @@ -1213,9 +1213,9 @@ public class FeedEntityParserTest extends AbstractTestBase { public void testExportFeedSqoopExcludeFields() throws Exception { storeEntity(EntityType.CLUSTER, "testCluster"); - InputStream feedStream = this.getClass().getResourceAsStream("/config/feed/feed-export-exclude-fields-0.1.xml"); + InputStream feedStream = this.getClass().getResourceAsStream("/config/feed/feed-export-fields-0.1.xml"); Feed feed = parser.parseAndValidate(feedStream); - Assert.fail("An exception should have been thrown: Feed Export policy not yet implement Field exclusion."); + Assert.fail("An exception should have been thrown: Feed Export policy does not require Fields specification."); } @Test (expectedExceptions = ValidationException.class) http://git-wip-us.apache.org/repos/asf/falcon/blob/fa66c17e/common/src/test/resources/config/feed/feed-export-exclude-fields-0.1.xml ---------------------------------------------------------------------- diff --git a/common/src/test/resources/config/feed/feed-export-exclude-fields-0.1.xml b/common/src/test/resources/config/feed/feed-export-exclude-fields-0.1.xml deleted file mode 100644 index 6753a00..0000000 --- a/common/src/test/resources/config/feed/feed-export-exclude-fields-0.1.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - consumer=consumer@xyz.com, owner=producer@xyz.com, _department_type=forecasting - - - - - - online,bi - _SUCCESS - - hours(1) - - UTC - - - - - - - - - - - - - - - id - name - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/falcon/blob/fa66c17e/common/src/test/resources/config/feed/feed-export-fields-0.1.xml ---------------------------------------------------------------------- diff --git a/common/src/test/resources/config/feed/feed-export-fields-0.1.xml b/common/src/test/resources/config/feed/feed-export-fields-0.1.xml new file mode 100644 index 0000000..8fda43d --- /dev/null +++ b/common/src/test/resources/config/feed/feed-export-fields-0.1.xml @@ -0,0 +1,66 @@ + + + + consumer=consumer@xyz.com, owner=producer@xyz.com, _department_type=forecasting + + + + + + online,bi + _SUCCESS + + hours(1) + + UTC + + + + + + + + + + + + + + + id + name + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/falcon/blob/fa66c17e/webapp/src/test/resources/feed-export-template6.xml ---------------------------------------------------------------------- diff --git a/webapp/src/test/resources/feed-export-template6.xml b/webapp/src/test/resources/feed-export-template6.xml index 0eb748b..0534257 100644 --- a/webapp/src/test/resources/feed-export-template6.xml +++ b/webapp/src/test/resources/feed-export-template6.xml @@ -31,12 +31,6 @@ - - - id - name - -