svn commit: r946716 - in /websites/staging/sqoop/trunk/content: ./ index.html issue-tracking.html license.html mail-lists.html project-info.html source-repository.html team-list.html

2015-04-07 Thread buildbot
Author: buildbot
Date: Wed Apr  8 00:00:33 2015
New Revision: 946716

Log:
Staging update by buildbot for sqoop

Modified:
websites/staging/sqoop/trunk/content/   (props changed)
websites/staging/sqoop/trunk/content/index.html
websites/staging/sqoop/trunk/content/issue-tracking.html
websites/staging/sqoop/trunk/content/license.html
websites/staging/sqoop/trunk/content/mail-lists.html
websites/staging/sqoop/trunk/content/project-info.html
websites/staging/sqoop/trunk/content/source-repository.html
websites/staging/sqoop/trunk/content/team-list.html

Propchange: websites/staging/sqoop/trunk/content/
--
--- cms:source-revision (original)
+++ cms:source-revision Wed Apr  8 00:00:33 2015
@@ -1 +1 @@
-1667167
+1671977

Modified: websites/staging/sqoop/trunk/content/index.html
==
--- websites/staging/sqoop/trunk/content/index.html (original)
+++ websites/staging/sqoop/trunk/content/index.html Wed Apr  8 00:00:33 2015
@@ -1,13 +1,13 @@
 !DOCTYPE html
 !--
- | Generated by Apache Maven Doxia at 2015-03-17
+ | Generated by Apache Maven Doxia at 2015-04-08
  | Rendered using Apache Maven Fluido Skin 1.3.0
 --
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
   head
 meta charset=UTF-8 /
 meta name=viewport content=width=device-width, initial-scale=1.0 /
-meta name=Date-Revision-mmdd content=20150317 /
+meta name=Date-Revision-mmdd content=20150408 /
 meta http-equiv=Content-Language content=en /
 titleSqoop - /title
 link rel=stylesheet href=./css/apache-maven-fluido-1.3.0.min.css /
@@ -228,7 +228,7 @@
 
 
 
-  li id=publishDate class=pull-rightLast Published: 
2015-03-17/li 
+  li id=publishDate class=pull-rightLast Published: 
2015-04-08/li 
 
 /ul
   /div

Modified: websites/staging/sqoop/trunk/content/issue-tracking.html
==
--- websites/staging/sqoop/trunk/content/issue-tracking.html (original)
+++ websites/staging/sqoop/trunk/content/issue-tracking.html Wed Apr  8 
00:00:33 2015
@@ -1,13 +1,13 @@
 !DOCTYPE html
 !--
- | Generated by Apache Maven Doxia at 2015-03-17
+ | Generated by Apache Maven Doxia at 2015-04-08
  | Rendered using Apache Maven Fluido Skin 1.3.0
 --
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
   head
 meta charset=UTF-8 /
 meta name=viewport content=width=device-width, initial-scale=1.0 /
-meta name=Date-Revision-mmdd content=20150317 /
+meta name=Date-Revision-mmdd content=20150408 /
 meta http-equiv=Content-Language content=en /
 titleSqoop - Issue Tracking/title
 link rel=stylesheet href=./css/apache-maven-fluido-1.3.0.min.css /
@@ -228,7 +228,7 @@
 
 
 
-  li id=publishDate class=pull-rightLast Published: 
2015-03-17/li 
+  li id=publishDate class=pull-rightLast Published: 
2015-04-08/li 
 
 /ul
   /div

Modified: websites/staging/sqoop/trunk/content/license.html
==
--- websites/staging/sqoop/trunk/content/license.html (original)
+++ websites/staging/sqoop/trunk/content/license.html Wed Apr  8 00:00:33 2015
@@ -1,13 +1,13 @@
 !DOCTYPE html
 !--
- | Generated by Apache Maven Doxia at 2015-03-17
+ | Generated by Apache Maven Doxia at 2015-04-08
  | Rendered using Apache Maven Fluido Skin 1.3.0
 --
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
   head
 meta charset=UTF-8 /
 meta name=viewport content=width=device-width, initial-scale=1.0 /
-meta name=Date-Revision-mmdd content=20150317 /
+meta name=Date-Revision-mmdd content=20150408 /
 meta http-equiv=Content-Language content=en /
 titleSqoop - Project License/title
 link rel=stylesheet href=./css/apache-maven-fluido-1.3.0.min.css /
@@ -228,7 +228,7 @@
 
 
 
-  li id=publishDate class=pull-rightLast Published: 
2015-03-17/li 
+  li id=publishDate class=pull-rightLast Published: 
2015-04-08/li 
 
 /ul
   /div

Modified: websites/staging/sqoop/trunk/content/mail-lists.html
==
--- websites/staging/sqoop/trunk/content/mail-lists.html (original)
+++ websites/staging/sqoop/trunk/content/mail-lists.html Wed Apr  8 00:00:33 
2015
@@ -1,13 +1,13 @@
 !DOCTYPE html
 !--
- | Generated by Apache Maven Doxia at 2015-03-17
+ | Generated by Apache Maven Doxia at 2015-04-08
  | Rendered using Apache Maven Fluido Skin 1.3.0
 --
 html 

svn commit: r1671977 - /sqoop/site/trunk/pom.xml

2015-04-07 Thread arvind
Author: arvind
Date: Wed Apr  8 00:00:07 2015
New Revision: 1671977

URL: http://svn.apache.org/r1671977
Log:
CMS commit to sqoop by arvind

Modified:
sqoop/site/trunk/pom.xml

Modified: sqoop/site/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/sqoop/site/trunk/pom.xml?rev=1671977r1=1671976r2=1671977view=diff
==
--- sqoop/site/trunk/pom.xml (original)
+++ sqoop/site/trunk/pom.xml Wed Apr  8 00:00:07 2015
@@ -179,6 +179,14 @@
   /roles
 /developer
 developer
+  idgwenshap/id
+  nameGwen Shapira/name
+  organizationCloudera/organization
+  roles
+rolecommitter/role
+  /roles
+/developer
+developer
   idhshreedharan/id
   nameHari Shreedharan/name
   organizationCloudera/organization




sqoop git commit: SQOOP-2283: Support usage of --exec and --password-alias

2015-04-07 Thread gwenshap
Repository: sqoop
Updated Branches:
  refs/heads/trunk 240ec13a0 - d32137f15


SQOOP-2283: Support usage of --exec and --password-alias

(Abraham Elmahrek via Gwen Shapira)


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

Branch: refs/heads/trunk
Commit: d32137f15c06827dea50b293f4d422481cb374cd
Parents: 240ec13
Author: Gwen Shapira csh...@gmail.com
Authored: Tue Apr 7 19:15:59 2015 -0700
Committer: Gwen Shapira csh...@gmail.com
Committed: Tue Apr 7 19:15:59 2015 -0700

--
 src/java/org/apache/sqoop/SqoopOptions.java | 16 
 1 file changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/sqoop/blob/d32137f1/src/java/org/apache/sqoop/SqoopOptions.java
--
diff --git a/src/java/org/apache/sqoop/SqoopOptions.java 
b/src/java/org/apache/sqoop/SqoopOptions.java
index fc3d847..e4eb2f2 100644
--- a/src/java/org/apache/sqoop/SqoopOptions.java
+++ b/src/java/org/apache/sqoop/SqoopOptions.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.sqoop.accumulo.AccumuloConstants;
 import org.apache.sqoop.util.CredentialsUtil;
 import org.apache.sqoop.util.LoggingUtils;
+import org.apache.sqoop.util.password.CredentialProviderHelper;
 import org.apache.sqoop.validation.AbortOnFailureHandler;
 import org.apache.sqoop.validation.AbsoluteValidationThreshold;
 import org.apache.sqoop.validation.RowCountValidator;
@@ -677,6 +678,16 @@ public class SqoopOptions implements Cloneable {
   }
 }
 
+passwordAlias = props.getProperty(db.password.alias);
+if (passwordAlias != null) {
+  try {
+setPassword(CredentialProviderHelper.resolveAlias(getConf(), 
passwordAlias));
+return; // short-circuit
+  } catch (IOException e) {
+throw new RuntimeException(Unable to resolve credentials., e);
+  }
+}
+
 if (getBooleanProperty(props, db.require.password, false)) {
   // The user's password was stripped out from the metastore.
   // Require that the user enter it now.
@@ -753,6 +764,11 @@ public class SqoopOptions implements Cloneable {
   return;
 }
 
+if (getPasswordAlias() != null) { // short-circuit
+  putProperty(props, db.password.alias, getPasswordAlias());
+  return;
+}
+
 if (this.getConf().getBoolean(
   METASTORE_PASSWORD_KEY, METASTORE_PASSWORD_DEFAULT)) {
   // If the user specifies, we may store the password in the metastore.



sqoop git commit: SQOOP-2286: Ensure Sqoop generates valid avro column names

2015-04-07 Thread gwenshap
Repository: sqoop
Updated Branches:
  refs/heads/trunk d32137f15 - baf513512


SQOOP-2286: Ensure Sqoop generates valid avro column names

(Abraham Elmahrek via Gwen Shapira)


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

Branch: refs/heads/trunk
Commit: baf51351281842bd660572fcc05c89d6407913c5
Parents: d32137f
Author: Gwen Shapira csh...@gmail.com
Authored: Tue Apr 7 19:39:02 2015 -0700
Committer: Gwen Shapira csh...@gmail.com
Committed: Tue Apr 7 19:39:02 2015 -0700

--
 src/java/org/apache/sqoop/avro/AvroUtil.java| 23 +++-
 .../apache/sqoop/orm/AvroSchemaGenerator.java   |  3 ++-
 src/test/com/cloudera/sqoop/TestAvroImport.java | 21 ++
 3 files changed, 45 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/sqoop/blob/baf51351/src/java/org/apache/sqoop/avro/AvroUtil.java
--
diff --git a/src/java/org/apache/sqoop/avro/AvroUtil.java 
b/src/java/org/apache/sqoop/avro/AvroUtil.java
index 2fdf263..ee3cf62 100644
--- a/src/java/org/apache/sqoop/avro/AvroUtil.java
+++ b/src/java/org/apache/sqoop/avro/AvroUtil.java
@@ -24,6 +24,7 @@ import org.apache.avro.generic.GenericRecord;
 import org.apache.hadoop.io.BytesWritable;
 import org.apache.sqoop.lib.BlobRef;
 import org.apache.sqoop.lib.ClobRef;
+import org.apache.sqoop.orm.ClassWriter;
 
 import java.math.BigDecimal;
 import java.nio.ByteBuffer;
@@ -72,6 +73,25 @@ public final class AvroUtil {
   }
 
   /**
+   * Convert Column name into Avro column name.
+   */
+  public static String toAvroColumn(String column) {
+return toAvroIdentifier(column);
+  }
+
+  /**
+   * Format candidate to avro specifics
+   */
+  public static String toAvroIdentifier(String candidate) {
+String formattedCandidate = candidate.replaceAll(\\W+, );
+if (formattedCandidate.substring(0,1).matches([a-zA-Z_])) {
+  return formattedCandidate;
+} else {
+  return AVRO_ + formattedCandidate;
+}
+  }
+
+  /**
* Manipulate a GenericRecord instance.
*/
   public static GenericRecord toGenericRecord(MapString, Object fieldMap,
@@ -79,7 +99,8 @@ public final class AvroUtil {
 GenericRecord record = new GenericData.Record(schema);
 for (Map.EntryString, Object entry : fieldMap.entrySet()) {
   Object avroObject = toAvro(entry.getValue(), bigDecimalFormatString);
-  record.put(entry.getKey(), avroObject);
+  String avroColumn = toAvroColumn(entry.getKey());
+  record.put(avroColumn, avroObject);
 }
 return record;
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/baf51351/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
--
diff --git a/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java 
b/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
index 3c913a8..a73aa13 100644
--- a/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
+++ b/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
@@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory;
 
 import com.cloudera.sqoop.SqoopOptions;
 import com.cloudera.sqoop.manager.ConnManager;
+import org.apache.sqoop.avro.AvroUtil;
 
 /**
  * Creates an Avro schema to represent a table from a database.
@@ -60,7 +61,7 @@ public class AvroSchemaGenerator {
 
 ListField fields = new ArrayListField();
 for (String columnName : columnNames) {
-  String cleanedCol = ClassWriter.toJavaIdentifier(columnName);
+  String cleanedCol = 
AvroUtil.toAvroIdentifier(ClassWriter.toJavaIdentifier(columnName));
   int sqlType = columnTypes.get(columnName);
   Schema avroSchema = toAvroSchema(sqlType, columnName);
   Field field = new Field(cleanedCol, avroSchema, null, null);

http://git-wip-us.apache.org/repos/asf/sqoop/blob/baf51351/src/test/com/cloudera/sqoop/TestAvroImport.java
--
diff --git a/src/test/com/cloudera/sqoop/TestAvroImport.java 
b/src/test/com/cloudera/sqoop/TestAvroImport.java
index dd051f3..08b8aa9 100644
--- a/src/test/com/cloudera/sqoop/TestAvroImport.java
+++ b/src/test/com/cloudera/sqoop/TestAvroImport.java
@@ -206,6 +206,27 @@ public class TestAvroImport extends ImportJobTestCase {
 assertEquals(__NAME, 1987, record1.get(__NAME));
   }
 
+  public void testNonstandardCharactersInColumnName() throws IOException {
+String [] names = { avroå1 };
+String [] types = { INT };
+String [] vals = { 1987 };
+createTableWithColTypesAndNames(names, types, vals);
+
+runImport(getOutputArgv(true, null));
+
+Path