sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kathl...@apache.org
Subject git commit: SQOOP-1077: Integration: Create Netezza provider
Date Sun, 16 Jun 2013 06:09:35 GMT
Updated Branches:
  refs/heads/sqoop2 d7bd4ad43 -> 66a296ead


SQOOP-1077: Integration: Create Netezza provider

(Jarek Jarcec Cecho via Kate Ting)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/66a296ea
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/66a296ea
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/66a296ea

Branch: refs/heads/sqoop2
Commit: 66a296ead2d2bc28ca99e81304aed9aff120a9c3
Parents: d7bd4ad
Author: Kate Ting <kathleen@apache.org>
Authored: Sun Jun 16 02:08:37 2013 -0400
Committer: Kate Ting <kathleen@apache.org>
Committed: Sun Jun 16 02:08:37 2013 -0400

----------------------------------------------------------------------
 pom.xml                                         |  6 ++
 test/pom.xml                                    | 22 ++++++
 .../apache/sqoop/test/db/NetezzaProvider.java   | 83 ++++++++++++++++++++
 .../minicluster/TomcatSqoopMiniCluster.java     |  1 +
 4 files changed, 112 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/66a296ea/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4173c48..43a84c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -112,6 +112,7 @@ limitations under the License.
     <jdbc.oracle.version>11.2.0.3</jdbc.oracle.version>
     <jdbc.sqlserver.version>4.0</jdbc.sqlserver.version>
     <jdbc.teradata.version>14.00.00.21</jdbc.teradata.version>
+    <jdbc.netezza.version>6.0</jdbc.netezza.version>
   </properties>
 
   <dependencies>
@@ -386,6 +387,11 @@ limitations under the License.
         <artifactId>terajdbc4</artifactId>
         <version>${jdbc.teradata.version}</version>
       </dependency>
+      <dependency>
+        <groupId>com.ibm.netezza</groupId>
+        <artifactId>nzjdbc3</artifactId>
+        <version>${jdbc.netezza.version}</version>
+      </dependency>
      <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-all</artifactId>

http://git-wip-us.apache.org/repos/asf/sqoop/blob/66a296ea/test/pom.xml
----------------------------------------------------------------------
diff --git a/test/pom.xml b/test/pom.xml
index 4947e1c..b7ea1ed 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -303,6 +303,28 @@ limitations under the License.
       </dependencies>
     </profile>
 
+    <!--
+      Netezza JDBC Driver
+      Install: mvn install:install-file -DgroupId=com.ibm.netezza -DartifactId=nzjdbc3 -Dversion=6.0
-Dpackaging=jar -Dfile=/path/to/the/jar/nzjdbc3.jar
+      Usage: mvn integration-test -Djdbc.netezza
+    -->
+    <profile>
+      <id>jdbc-netezza</id>
+
+      <activation>
+        <property>
+          <name>jdbc.netezza</name>
+        </property>
+      </activation>
+
+      <dependencies>
+        <dependency>
+          <groupId>com.ibm.netezza</groupId>
+          <artifactId>nzjdbc3</artifactId>
+        </dependency>
+      </dependencies>
+    </profile>
+
   </profiles>
 
 </project>

http://git-wip-us.apache.org/repos/asf/sqoop/blob/66a296ea/test/src/main/java/org/apache/sqoop/test/db/NetezzaProvider.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/sqoop/test/db/NetezzaProvider.java b/test/src/main/java/org/apache/sqoop/test/db/NetezzaProvider.java
new file mode 100644
index 0000000..4e5bb0d
--- /dev/null
+++ b/test/src/main/java/org/apache/sqoop/test/db/NetezzaProvider.java
@@ -0,0 +1,83 @@
+/**
+ * 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.sqoop.test.db;
+
+/**
+ * Netezza Provider that will connect to remote Netezza server.
+ *
+ * JDBC can be configured via system properties. Default value is server running
+ * on the same box (localhost) that is access via sqoop/sqoop credentials.
+ */
+public class NetezzaProvider extends DatabaseProvider {
+
+  public static final String DRIVER = "org.netezza.Driver";
+
+  private static final String CONNECTION = System.getProperties().getProperty(
+    "sqoop.provider.netezza.jdbc",
+    "jdbc:netezza://localhost/test"
+  );
+
+  private static final String USERNAME = System.getProperties().getProperty(
+    "sqoop.provider.netezza.username",
+    "sqoop"
+  );
+
+  private static final String PASSWORD = System.getProperties().getProperty(
+    "sqoop.provider.netezza.password",
+    "sqoop"
+  );
+
+  @Override
+  public String getConnectionUrl() {
+    return CONNECTION;
+  }
+
+  @Override
+  public String getConnectionUsername() {
+    return USERNAME;
+  }
+
+  @Override
+  public String getConnectionPassword() {
+    return PASSWORD;
+  }
+
+  @Override
+  public String escapeColumnName(String columnName) {
+    return escapeObjectName(columnName);
+  }
+
+  @Override
+  public String escapeTableName(String tableName) {
+    return escapeObjectName(tableName);
+  }
+
+  public String escapeObjectName(String name) {
+    return '"' + name + '"';
+  }
+
+  @Override
+  public String escapeValueString(String value) {
+    return "'" + value + "'";
+  }
+
+  @Override
+  public String getJdbcDriver() {
+    return DRIVER;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/66a296ea/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java
b/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java
index 2aa55dc..e2f1675 100644
--- a/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java
+++ b/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java
@@ -98,6 +98,7 @@ public class TomcatSqoopMiniCluster extends SqoopMiniCluster {
          jar.contains("oracle")   || // Oracle driver
          jar.contains("terajdbc") || // Teradata driver
          jar.contains("tdgs")     || // Teradata driver
+         jar.contains("nzjdbc")   || // Netezza driver
          jar.contains("sqljdbc")  || // Microsoft SQL Server driver
          jar.contains("google")      // Google libraries (guava, ...)
        ) {


Mime
View raw message