sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject svn commit: r1365691 - in /sqoop/trunk: ./ ivy/ src/java/org/apache/sqoop/metastore/hsqldb/ src/test/com/cloudera/sqoop/ src/test/com/cloudera/sqoop/hive/ src/test/com/cloudera/sqoop/manager/ src/test/com/cloudera/sqoop/mapreduce/db/ src/test/com/cloud...
Date Wed, 25 Jul 2012 18:33:11 GMT
Author: jarcec
Date: Wed Jul 25 18:33:11 2012
New Revision: 1365691

URL: http://svn.apache.org/viewvc?rev=1365691&view=rev
Log:
SQOOP-519. Update the version of hsqldb decadency to 2.X.

(Cheolsoo Park via Jarek Jarcec Cecho)

Modified:
    sqoop/trunk/ivy.xml
    sqoop/trunk/ivy/libraries.properties
    sqoop/trunk/ivy/sqoop-test.xml
    sqoop/trunk/ivy/sqoop.xml
    sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbJobStorage.java
    sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbMetaStore.java
    sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroExport.java
    sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java
    sqoop/trunk/src/test/com/cloudera/sqoop/TestExport.java
    sqoop/trunk/src/test/com/cloudera/sqoop/TestMultiCols.java
    sqoop/trunk/src/test/com/cloudera/sqoop/hive/TestHiveImport.java
    sqoop/trunk/src/test/com/cloudera/sqoop/manager/DirectMySQLExportTest.java
    sqoop/trunk/src/test/com/cloudera/sqoop/manager/JdbcMySQLExportTest.java
    sqoop/trunk/src/test/com/cloudera/sqoop/manager/MySQLCompatTest.java
    sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleCompatTest.java
    sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleExportTest.java
    sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java
    sqoop/trunk/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java

Modified: sqoop/trunk/ivy.xml
URL: http://svn.apache.org/viewvc/sqoop/trunk/ivy.xml?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/ivy.xml (original)
+++ sqoop/trunk/ivy.xml Wed Jul 25 18:33:11 2012
@@ -74,6 +74,7 @@ under the License.
       rev="${hadoop.version}" conf="hadoop23->default">
       <artifact name="hadoop-common" type="jar" />
       <artifact name="hadoop-common" type="jar" m:classifier="tests"/>
+      <exclude org="hsqldb" module="hsqldb"/>
     </dependency>
     <dependency org="org.apache.hadoop" name="hadoop-hdfs"
       rev="${hadoop.version}" conf="hadoop23->default">
@@ -106,7 +107,7 @@ under the License.
       conf="common->master" />
     <dependency org="junit" name="junit" rev="${junit.version}"
       conf="test->default"/>
-    <dependency org="hsqldb" name="hsqldb" rev="${hsqldb.version}"
+    <dependency org="org.hsqldb" name="hsqldb" rev="${hsqldb.version}"
       conf="common->default;redist->default"/>
     <dependency org="commons-io" name="commons-io" rev="${commons-io.version}"
       conf="common->default;redist->default"/>

Modified: sqoop/trunk/ivy/libraries.properties
URL: http://svn.apache.org/viewvc/sqoop/trunk/ivy/libraries.properties?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/ivy/libraries.properties (original)
+++ sqoop/trunk/ivy/libraries.properties Wed Jul 25 18:33:11 2012
@@ -28,7 +28,7 @@ commons-io.version=1.4
 commons-lang.version=2.4
 commons-logging.version=1.0.4
 
-hsqldb.version=1.8.0.10
+hsqldb.version=2.2.8
 
 ivy.version=2.1.0
 

Modified: sqoop/trunk/ivy/sqoop-test.xml
URL: http://svn.apache.org/viewvc/sqoop/trunk/ivy/sqoop-test.xml?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/ivy/sqoop-test.xml (original)
+++ sqoop/trunk/ivy/sqoop-test.xml Wed Jul 25 18:33:11 2012
@@ -47,7 +47,7 @@ under the License.
       rev="${hadoop-core.cloudera.version}" conf="common->default"/>
     <dependency org="junit" name="junit" rev="${junit.version}"
       conf="common->default"/>
-    <dependency org="hsqldb" name="hsqldb" rev="${hsqldb.version}"
+    <dependency org="org.hsqldb" name="hsqldb" rev="${hsqldb.version}"
       conf="common->default"/>
   </dependencies>
 </ivy-module>

Modified: sqoop/trunk/ivy/sqoop.xml
URL: http://svn.apache.org/viewvc/sqoop/trunk/ivy/sqoop.xml?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/ivy/sqoop.xml (original)
+++ sqoop/trunk/ivy/sqoop.xml Wed Jul 25 18:33:11 2012
@@ -42,7 +42,7 @@ under the License.
   <dependencies>
     <dependency org="org.apache.hadoop" name="hadoop-core"
       rev="${hadoop.version}" conf="common->default"/>
-    <dependency org="hsqldb" name="hsqldb" rev="${hsqldb.version}"
+    <dependency org="org.hsqldb" name="hsqldb" rev="${hsqldb.version}"
       conf="common->default"/>
     <dependency org="commons-io" name="commons-io" rev="${commons-io.version}"
       conf="common->default"/>

Modified: sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbJobStorage.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbJobStorage.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbJobStorage.java (original)
+++ sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbJobStorage.java Wed Jul 25
18:33:11 2012
@@ -177,7 +177,7 @@ public class HsqldbJobStorage extends Jo
             metastoreUser, metastorePassword);
       }
 
-      connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+      connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
       connection.setAutoCommit(false);
 
       // Initialize the root schema.
@@ -596,17 +596,25 @@ public class HsqldbJobStorage extends Jo
     PreparedStatement s;
     String curVal = getRootProperty(propertyName, version);
     if (null == curVal) {
-      // INSERT the row.
-      s = connection.prepareStatement("INSERT INTO " + getRootTableName()
-          + " (propval, propname, version) VALUES ( ? , ? , ? )");
-    } else if (version == null) {
-      // UPDATE an existing row with a null version
-      s = connection.prepareStatement("UPDATE " + getRootTableName()
-          + " SET propval = ? WHERE  propname = ? AND version IS NULL");
+      if (null == version) {
+          // INSERT the row with a null version.
+          s = connection.prepareStatement("INSERT INTO " + getRootTableName()
+              + " (propval, propname, version) VALUES ( ? , ? , NULL )");
+      } else {
+          // INSERT the row with a non-null version.
+          s = connection.prepareStatement("INSERT INTO " + getRootTableName()
+              + " (propval, propname, version) VALUES ( ? , ? , ? )");
+      }
     } else {
-      // UPDATE an existing row with non-null version.
-      s = connection.prepareStatement("UPDATE " + getRootTableName()
-          + " SET propval = ? WHERE  propname = ? AND version = ?");
+      if (null == version) {
+        // UPDATE an existing row with a null version.
+        s = connection.prepareStatement("UPDATE " + getRootTableName()
+            + " SET propval = ? WHERE  propname = ? AND version IS NULL");
+      } else {
+        // UPDATE an existing row with non-null version.
+        s = connection.prepareStatement("UPDATE " + getRootTableName()
+            + " SET propval = ? WHERE  propname = ? AND version = ?");
+      }
     }
 
     try {

Modified: sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbMetaStore.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbMetaStore.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbMetaStore.java (original)
+++ sqoop/trunk/src/java/org/apache/sqoop/metastore/hsqldb/HsqldbMetaStore.java Wed Jul 25
18:33:11 2012
@@ -30,7 +30,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.util.StringUtils;
 
 import org.hsqldb.Server;
-import org.hsqldb.ServerConstants;
+import org.hsqldb.server.ServerConstants;
 
 import com.cloudera.sqoop.SqoopOptions;
 

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroExport.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroExport.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroExport.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroExport.java Wed Jul 25 18:33:11 2012
@@ -315,7 +315,7 @@ public class TestAvroExport extends Expo
       colGenerator(100, Schema.create(Schema.Type.INT), 100, "INTEGER"),
       colGenerator(200L, Schema.create(Schema.Type.LONG), 200L, "BIGINT"),
       // HSQLDB maps REAL to double, not float:
-      colGenerator(1.0f, Schema.create(Schema.Type.FLOAT), 1.0d, "REAL"),
+      colGenerator(1.0d, Schema.create(Schema.Type.DOUBLE), 1.0d, "REAL"),
       colGenerator(2.0d, Schema.create(Schema.Type.DOUBLE), 2.0d, "DOUBLE"),
       colGenerator("s", Schema.create(Schema.Type.STRING), "s", "VARCHAR(8)"),
       colGenerator(ByteBuffer.wrap(b), Schema.create(Schema.Type.BYTES),

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java Wed Jul 25 18:33:11 2012
@@ -136,7 +136,7 @@ public class TestAvroImport extends Impo
     checkField(fields.get(0), "DATA_COL0", Schema.Type.BOOLEAN);
     checkField(fields.get(1), "DATA_COL1", Schema.Type.INT);
     checkField(fields.get(2), "DATA_COL2", Schema.Type.LONG);
-    checkField(fields.get(3), "DATA_COL3", Schema.Type.FLOAT);
+    checkField(fields.get(3), "DATA_COL3", Schema.Type.DOUBLE);
     checkField(fields.get(4), "DATA_COL4", Schema.Type.DOUBLE);
     checkField(fields.get(5), "DATA_COL5", Schema.Type.STRING);
     checkField(fields.get(6), "DATA_COL6", Schema.Type.BYTES);
@@ -145,7 +145,7 @@ public class TestAvroImport extends Impo
     assertEquals("DATA_COL0", true, record1.get("DATA_COL0"));
     assertEquals("DATA_COL1", 100, record1.get("DATA_COL1"));
     assertEquals("DATA_COL2", 200L, record1.get("DATA_COL2"));
-    assertEquals("DATA_COL3", 1.0f, record1.get("DATA_COL3"));
+    assertEquals("DATA_COL3", 1.0d, record1.get("DATA_COL3"));
     assertEquals("DATA_COL4", 2.0, record1.get("DATA_COL4"));
     assertEquals("DATA_COL5", new Utf8("s"), record1.get("DATA_COL5"));
     Object object = record1.get("DATA_COL6");

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/TestExport.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/TestExport.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/TestExport.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/TestExport.java Wed Jul 25 18:33:11 2012
@@ -751,6 +751,11 @@ public class TestExport extends ExportJo
     assertColMinAndMax(forIdx(1), genTime);
   }
 
+  /** @return the text representation of double */
+  protected String getDoubleTextOut(double v) {
+    return Double.toString(v) + "E0";
+  }
+
   public void testNumericTypes() throws IOException, SQLException {
     final int TOTAL_RECORDS = 9;
 
@@ -758,11 +763,11 @@ public class TestExport extends ExportJo
     ColumnGenerator genFloat = new ColumnGenerator() {
       public String getExportText(int rowNum) {
         double v = 3.141 * (double) (rowNum + 1);
-        return "" + v;
+        return Double.toString(v);
       }
       public String getVerifyText(int rowNum) {
         double v = 3.141 * (double) (rowNum + 1);
-        return "" + v;
+        return getDoubleTextOut(v);
       }
       public String getType() {
         return "FLOAT";

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/TestMultiCols.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/TestMultiCols.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/TestMultiCols.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/TestMultiCols.java Wed Jul 25 18:33:11 2012
@@ -134,7 +134,7 @@ public class TestMultiCols extends Impor
   public void testMixed4() {
     String [] types = { "NUMERIC", "INTEGER", "NUMERIC" };
     String [] insertVals = { "-42", "17", "33333333333333333333333.1714" };
-    String validateLine = "-42,17,33333333333333333333333.1714";
+    String validateLine = "-42,17,33333333333333333333333";
 
     verifyTypes(types, insertVals, validateLine);
   }
@@ -142,7 +142,7 @@ public class TestMultiCols extends Impor
   public void testMixed5() {
     String [] types = { "NUMERIC", "INTEGER", "NUMERIC" };
     String [] insertVals = { "null", "17", "33333333333333333333333.0" };
-    String validateLine = "null,17,33333333333333333333333.0";
+    String validateLine = "null,17,33333333333333333333333";
 
     verifyTypes(types, insertVals, validateLine);
   }

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/hive/TestHiveImport.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/hive/TestHiveImport.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/hive/TestHiveImport.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/hive/TestHiveImport.java Wed Jul 25 18:33:11 2012
@@ -373,8 +373,9 @@ public class TestHiveImport extends Impo
     BufferedReader br = new BufferedReader(fr);
     try {
       // verify the output
-      assertEquals(br.readLine(), "test with  new lines " + '\01' + "42"
-          + '\01' + "oh no  field delims ");
+      assertEquals("test with  new lines " + '\01' + "42" + '\01'
+          + "oh no  field delims                                           ",
+          br.readLine());
       assertEquals(br.readLine(), null); // should only be one line
     } catch (IOException ioe) {
       fail("Unable to read files generated from hive");
@@ -423,8 +424,9 @@ public class TestHiveImport extends Impo
     BufferedReader br = new BufferedReader(fr);
     try {
       // verify the output
-      assertEquals(br.readLine(), "test with new lines " + '\01' + "42"
-          + '\01' + "oh no   field delims  ");
+      assertEquals("test with new lines " + '\01' + "42" + '\01'
+          + "oh no   field delims                                            ",
+          br.readLine());
       assertEquals(br.readLine(), null); // should only be one line
     } catch (IOException ioe) {
       fail("Unable to read files generated from hive");

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/manager/DirectMySQLExportTest.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/manager/DirectMySQLExportTest.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/manager/DirectMySQLExportTest.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/manager/DirectMySQLExportTest.java Wed Jul 25
18:33:11 2012
@@ -77,6 +77,11 @@ public class DirectMySQLExportTest exten
     return "DROP TABLE IF EXISTS " + tableName;
   }
 
+  @Override
+  protected String getDoubleTextOut(double v) {
+    return Double.toString(v);
+  }
+
   @Before
   public void setUp() {
     super.setUp();

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/manager/JdbcMySQLExportTest.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/manager/JdbcMySQLExportTest.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/manager/JdbcMySQLExportTest.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/manager/JdbcMySQLExportTest.java Wed Jul 25 18:33:11
2012
@@ -78,6 +78,11 @@ public class JdbcMySQLExportTest extends
     return "DROP TABLE IF EXISTS " + tableName;
   }
 
+  @Override
+  protected String getDoubleTextOut(double v) {
+    return Double.toString(v);
+  }
+
   @Before
   public void setUp() {
     super.setUp();

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/manager/MySQLCompatTest.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/manager/MySQLCompatTest.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/manager/MySQLCompatTest.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/manager/MySQLCompatTest.java Wed Jul 25 18:33:11
2012
@@ -162,6 +162,11 @@ public class MySQLCompatTest extends Man
     return getNumericSeqOutput(numAsInserted);
   }
 
+  @Override
+  protected String getFixedCharSeqOut(int fieldWidth, String asInserted) {
+    return asInserted;
+  }
+
   @Test
   public void testYear() {
     verifyType("YEAR", "2012", "2012");

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleCompatTest.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleCompatTest.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleCompatTest.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleCompatTest.java Wed Jul 25 18:33:11
2012
@@ -164,6 +164,16 @@ public class OracleCompatTest extends Ma
   }
 
   @Override
+  protected String getNumericSeqOutput(String numAsInserted) {
+    return numAsInserted;
+  }
+
+  @Override
+  protected String getDecimalSeqOutput(String numAsInserted) {
+    return numAsInserted;
+  }
+
+  @Override
   protected String getBlobInsertStr(String blobData) {
     // Oracle wants blob data encoded as hex (e.g. '01fca3b5').
 

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleExportTest.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleExportTest.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleExportTest.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/manager/OracleExportTest.java Wed Jul 25 18:33:11
2012
@@ -264,6 +264,11 @@ public class OracleExportTest extends Te
     }
   }
 
+  @Override
+  protected String getDoubleTextOut(double v) {
+    return Double.toString(v);
+  }
+
   /** Make sure mixed update/insert export work correctly. */
   public void testUpsertTextExport() throws IOException, SQLException {
     final int TOTAL_RECORDS = 10;

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java
(original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java
Wed Jul 25 18:33:11 2012
@@ -181,10 +181,14 @@ public class TestDataDrivenDBInputFormat
 
       // Create the table.
       s.executeUpdate("CREATE TABLE " + DATE_TABLE + "(" + COL + " TIMESTAMP)");
-      s.executeUpdate("INSERT INTO " + DATE_TABLE + " VALUES('2010-04-01')");
-      s.executeUpdate("INSERT INTO " + DATE_TABLE + " VALUES('2010-04-02')");
-      s.executeUpdate("INSERT INTO " + DATE_TABLE + " VALUES('2010-05-01')");
-      s.executeUpdate("INSERT INTO " + DATE_TABLE + " VALUES('2011-04-01')");
+      s.executeUpdate("INSERT INTO " + DATE_TABLE
+          + " VALUES('2010-04-01 00:00:00')");
+      s.executeUpdate("INSERT INTO " + DATE_TABLE
+          + " VALUES('2010-04-02 00:00:00')");
+      s.executeUpdate("INSERT INTO " + DATE_TABLE
+          + " VALUES('2010-05-01 00:00:00')");
+      s.executeUpdate("INSERT INTO " + DATE_TABLE
+          + " VALUES('2011-04-01 00:00:00')");
 
       // commit this tx.
       connection.commit();

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java?rev=1365691&r1=1365690&r2=1365691&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java (original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java Wed Jul 25
18:33:11 2012
@@ -390,11 +390,27 @@ public abstract class ManagerCompatTestC
   }
 
   protected String getNumericSeqOutput(String numAsInserted) {
-    return numAsInserted;
+    int dotPos = numAsInserted.indexOf(".");
+    if (-1 == dotPos) {
+      // No dot in the original string; expand to add zeros after the
+      // dot.
+      return numAsInserted + ".00000";
+    } else {
+      // all other strings return as-is.
+      return numAsInserted;
+    }
   }
 
   protected String getDecimalSeqOutput(String numAsInserted) {
-    return numAsInserted;
+    int dotPos = numAsInserted.indexOf(".");
+    if (-1 == dotPos) {
+      // No dot in the original string; expand to add zeros after the
+      // dot.
+      return numAsInserted + ".00000";
+    } else {
+      // all other strings return as-is.
+      return numAsInserted;
+    }
   }
 
   /**
@@ -402,7 +418,7 @@ public abstract class ManagerCompatTestC
    * sequence file
    */
   protected String getFixedCharSeqOut(int fieldWidth, String asInserted) {
-    return asInserted;
+    return padString(fieldWidth, asInserted);
   }
 
   /**



Mime
View raw message