Skip to content

Commit a57b1f7

Browse files
author
poornachandra
authored
Merge pull request #5 from data-integrations/feature/cdap-6.0-compat
Update directive to work with CDAP 6.0
2 parents 2309a57 + 895c194 commit a57b1f7

File tree

6 files changed

+103
-69
lines changed

6 files changed

+103
-69
lines changed

pom.xml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright © 2019 CDAP
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
~ use this file except in compliance with the License. You may obtain a copy of
7+
~ the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
~ License for the specific language governing permissions and limitations under
15+
~ the License.
16+
-->
17+
218
<project xmlns="http://maven.apache.org/POM/4.0.0"
319
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
420
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -7,7 +23,7 @@
723
<groupId>com.example</groupId>
824
<artifactId>simple-udds</artifactId>
925
<name>Simple User Defined Directives</name>
10-
<version>1.0.1</version>
26+
<version>1.1.0</version>
1127
<packaging>jar</packaging>
1228

1329
<properties>
@@ -16,12 +32,32 @@
1632
<docs.dir>docs</docs.dir>
1733
<!-- this is here because project.basedir evaluates to null in the script build step -->
1834
<main.basedir>${project.basedir}</main.basedir>
19-
<cdap.version>5.1.2</cdap.version>
20-
<wrangler.version>3.0.1</wrangler.version>
35+
<cdap.version>6.0.0-SNAPSHOT</cdap.version>
36+
<wrangler.version>4.0.0</wrangler.version>
2137
<commons.codec.version>1.10</commons.codec.version>
2238
<junit.version>4.12</junit.version>
2339
</properties>
2440

41+
<licenses>
42+
<license>
43+
<name>The Apache Software License, Version 2.0</name>
44+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
45+
</license>
46+
</licenses>
47+
48+
<developers>
49+
<developer>
50+
<name>CDAP</name>
51+
<email>[email protected]</email>
52+
<organization>CDAP</organization>
53+
<organizationUrl>http://cdap.io</organizationUrl>
54+
</developer>
55+
</developers>
56+
57+
<issueManagement>
58+
<url>https://issues.cask.co/browse/CDAP</url>
59+
</issueManagement>
60+
2561
<distributionManagement>
2662
<repository>
2763
<id>sonatype.release</id>
@@ -45,19 +81,19 @@
4581
<!-- Core Dependencies -->
4682

4783
<dependency>
48-
<groupId>co.cask.wrangler</groupId>
84+
<groupId>io.cdap.wrangler</groupId>
4985
<artifactId>wrangler-api</artifactId>
5086
<version>${wrangler.version}</version>
5187
<scope>provided</scope>
5288
</dependency>
5389
<dependency>
54-
<groupId>co.cask.cdap</groupId>
90+
<groupId>io.cdap.cdap</groupId>
5591
<artifactId>cdap-api</artifactId>
5692
<version>${cdap.version}</version>
5793
<scope>provided</scope>
5894
</dependency>
5995
<dependency>
60-
<groupId>co.cask.cdap</groupId>
96+
<groupId>io.cdap.cdap</groupId>
6197
<artifactId>cdap-etl-api</artifactId>
6298
<version>${cdap.version}</version>
6399
<scope>provided</scope>
@@ -73,7 +109,7 @@
73109

74110
<!-- Testing Dependencies -->
75111
<dependency>
76-
<groupId>co.cask.wrangler</groupId>
112+
<groupId>io.cdap.wrangler</groupId>
77113
<artifactId>wrangler-test</artifactId>
78114
<version>${wrangler.version}</version>
79115
<scope>test</scope>
@@ -139,12 +175,12 @@
139175
<artifactId>maven-antrun-plugin</artifactId>
140176
</plugin>
141177
<plugin>
142-
<groupId>co.cask</groupId>
178+
<groupId>io.cdap</groupId>
143179
<artifactId>cdap-maven-plugin</artifactId>
144-
<version>1.0.1</version>
180+
<version>1.1.0</version>
145181
<configuration>
146182
<cdapArtifacts>
147-
<parent>system:wrangler-transform[3.2.0,4.0.0-SNAPSHOT)</parent>
183+
<parent>system:wrangler-transform[4.0.0,5.0.0)</parent>
148184
</cdapArtifacts>
149185
</configuration>
150186
<executions>

src/main/java/org/example/directives/RowHash.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@
1616

1717
package org.example.directives;
1818

19-
import co.cask.cdap.api.annotation.Description;
20-
import co.cask.cdap.api.annotation.Name;
21-
import co.cask.cdap.api.annotation.Plugin;
22-
import co.cask.wrangler.api.Arguments;
23-
import co.cask.wrangler.api.Directive;
24-
import co.cask.wrangler.api.DirectiveExecutionException;
25-
import co.cask.wrangler.api.DirectiveParseException;
26-
import co.cask.wrangler.api.ErrorRowException;
27-
import co.cask.wrangler.api.ExecutorContext;
28-
import co.cask.wrangler.api.Row;
29-
import co.cask.wrangler.api.parser.ColumnName;
30-
import co.cask.wrangler.api.parser.Identifier;
31-
import co.cask.wrangler.api.parser.TokenType;
32-
import co.cask.wrangler.api.parser.UsageDefinition;
19+
import io.cdap.cdap.api.annotation.Description;
20+
import io.cdap.cdap.api.annotation.Name;
21+
import io.cdap.cdap.api.annotation.Plugin;
22+
import io.cdap.wrangler.api.Arguments;
23+
import io.cdap.wrangler.api.Directive;
24+
import io.cdap.wrangler.api.DirectiveExecutionException;
25+
import io.cdap.wrangler.api.DirectiveParseException;
26+
import io.cdap.wrangler.api.ErrorRowException;
27+
import io.cdap.wrangler.api.ExecutorContext;
28+
import io.cdap.wrangler.api.Row;
29+
import io.cdap.wrangler.api.parser.ColumnName;
30+
import io.cdap.wrangler.api.parser.Identifier;
31+
import io.cdap.wrangler.api.parser.TokenType;
32+
import io.cdap.wrangler.api.parser.UsageDefinition;
3333
import org.apache.commons.codec.digest.DigestUtils;
3434

3535
import java.util.List;
3636

3737
/**
3838
* This directive generates a the row hash using all the column values of a row.
3939
*/
40-
@Plugin(type = Directive.Type)
40+
@Plugin(type = Directive.TYPE)
4141
@Name(RowHash.NAME)
4242
@Description("Generates the row hash using different hashing techniques.")
4343
public final class RowHash implements Directive {

src/main/java/org/example/directives/TextLength.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@
1616

1717
package org.example.directives;
1818

19-
import co.cask.cdap.api.annotation.Description;
20-
import co.cask.cdap.api.annotation.Name;
21-
import co.cask.cdap.api.annotation.Plugin;
22-
import co.cask.cdap.api.common.Bytes;
23-
import co.cask.wrangler.api.Arguments;
24-
import co.cask.wrangler.api.Directive;
25-
import co.cask.wrangler.api.DirectiveExecutionException;
26-
import co.cask.wrangler.api.DirectiveParseException;
27-
import co.cask.wrangler.api.ErrorRowException;
28-
import co.cask.wrangler.api.ExecutorContext;
29-
import co.cask.wrangler.api.Row;
30-
import co.cask.wrangler.api.parser.ColumnName;
31-
import co.cask.wrangler.api.parser.TokenType;
32-
import co.cask.wrangler.api.parser.UsageDefinition;
19+
import io.cdap.cdap.api.annotation.Description;
20+
import io.cdap.cdap.api.annotation.Name;
21+
import io.cdap.cdap.api.annotation.Plugin;
22+
import io.cdap.cdap.api.common.Bytes;
23+
import io.cdap.wrangler.api.Arguments;
24+
import io.cdap.wrangler.api.Directive;
25+
import io.cdap.wrangler.api.DirectiveExecutionException;
26+
import io.cdap.wrangler.api.DirectiveParseException;
27+
import io.cdap.wrangler.api.ErrorRowException;
28+
import io.cdap.wrangler.api.ExecutorContext;
29+
import io.cdap.wrangler.api.Row;
30+
import io.cdap.wrangler.api.parser.ColumnName;
31+
import io.cdap.wrangler.api.parser.TokenType;
32+
import io.cdap.wrangler.api.parser.UsageDefinition;
3333

3434
import java.util.List;
3535

3636
/**
3737
* This class <code>TextReverse</code>implements a <code>Directive</code> interface
3838
* for reversing the text specified by the value of the <code>column</code>.
3939
*/
40-
@Plugin(type = Directive.Type)
40+
@Plugin(type = Directive.TYPE)
4141
@Name(TextLength.DIRECTIVE_NAME)
4242
@Description("Computes tthe length of the string.")
4343
public final class TextLength implements Directive {

src/main/java/org/example/directives/TextReverse.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@
1616

1717
package org.example.directives;
1818

19-
import co.cask.cdap.api.annotation.Description;
20-
import co.cask.cdap.api.annotation.Name;
21-
import co.cask.cdap.api.annotation.Plugin;
22-
import co.cask.cdap.api.common.Bytes;
23-
import co.cask.wrangler.api.Arguments;
24-
import co.cask.wrangler.api.Directive;
25-
import co.cask.wrangler.api.DirectiveExecutionException;
26-
import co.cask.wrangler.api.DirectiveParseException;
27-
import co.cask.wrangler.api.ErrorRowException;
28-
import co.cask.wrangler.api.ExecutorContext;
29-
import co.cask.wrangler.api.Row;
30-
import co.cask.wrangler.api.parser.ColumnName;
31-
import co.cask.wrangler.api.parser.TokenType;
32-
import co.cask.wrangler.api.parser.UsageDefinition;
19+
import io.cdap.cdap.api.annotation.Description;
20+
import io.cdap.cdap.api.annotation.Name;
21+
import io.cdap.cdap.api.annotation.Plugin;
22+
import io.cdap.cdap.api.common.Bytes;
23+
import io.cdap.wrangler.api.Arguments;
24+
import io.cdap.wrangler.api.Directive;
25+
import io.cdap.wrangler.api.DirectiveExecutionException;
26+
import io.cdap.wrangler.api.DirectiveParseException;
27+
import io.cdap.wrangler.api.ErrorRowException;
28+
import io.cdap.wrangler.api.ExecutorContext;
29+
import io.cdap.wrangler.api.Row;
30+
import io.cdap.wrangler.api.parser.ColumnName;
31+
import io.cdap.wrangler.api.parser.TokenType;
32+
import io.cdap.wrangler.api.parser.UsageDefinition;
3333

3434
import java.util.List;
3535

3636
/**
3737
* This class <code>TextReverse</code>implements a <code>Directive</code> interface
3838
* for reversing the text specified by the value of the <code>column</code>.
3939
*/
40-
@Plugin(type = Directive.Type)
40+
@Plugin(type = Directive.TYPE)
4141
@Name(TextReverse.DIRECTIVE_NAME)
4242
@Description("Reverses the text represented by the column.")
4343
public final class TextReverse implements Directive {

src/test/java/org/example/directives/RowHashTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616

1717
package org.example.directives;
1818

19-
import co.cask.wrangler.api.RecipePipeline;
20-
import co.cask.wrangler.api.Row;
21-
import co.cask.wrangler.test.TestingRig;
22-
import co.cask.wrangler.test.api.TestRecipe;
23-
import co.cask.wrangler.test.api.TestRows;
24-
import org.example.directives.RowHash;
19+
import io.cdap.wrangler.api.RecipePipeline;
20+
import io.cdap.wrangler.api.Row;
21+
import io.cdap.wrangler.test.TestingRig;
22+
import io.cdap.wrangler.test.api.TestRecipe;
23+
import io.cdap.wrangler.test.api.TestRows;
2524
import org.junit.Assert;
2625
import org.junit.Ignore;
2726
import org.junit.Test;
@@ -50,4 +49,4 @@ public void testBasicRowHash() throws Exception {
5049

5150
Assert.assertEquals(2, actual.size());
5251
}
53-
}
52+
}

src/test/java/org/example/directives/TextReverseTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616

1717
package org.example.directives;
1818

19-
import co.cask.wrangler.test.api.TestRecipe;
20-
import co.cask.wrangler.test.api.TestRows;
21-
import co.cask.wrangler.test.TestingRig;
22-
import co.cask.wrangler.api.RecipePipeline;
23-
import co.cask.wrangler.api.Row;
24-
import org.example.directives.TextReverse;
19+
import io.cdap.wrangler.api.RecipePipeline;
20+
import io.cdap.wrangler.api.Row;
21+
import io.cdap.wrangler.test.TestingRig;
22+
import io.cdap.wrangler.test.api.TestRecipe;
23+
import io.cdap.wrangler.test.api.TestRows;
2524
import org.junit.Assert;
2625
import org.junit.Ignore;
2726
import org.junit.Test;
@@ -52,4 +51,4 @@ public void testBasicReverse() throws Exception {
5251
Assert.assertEquals("eitloj", actual.get(0).getValue("b"));
5352
Assert.assertEquals("toor", actual.get(1).getValue("b"));
5453
}
55-
}
54+
}

0 commit comments

Comments
 (0)