kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject kudu git commit: Kudu-client ImportCsv small fix's
Date Wed, 09 Aug 2017 22:03:42 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 5d53a3b71 -> b0839fcdb


Kudu-client ImportCsv small fix's

Change-Id: I422e83d99db38be7a011ddc00b3412d542e2c181
Reviewed-on: http://gerrit.cloudera.org:8080/7584
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans <jdcryans@apache.org>


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

Branch: refs/heads/master
Commit: b0839fcdbf4a391adbc3b224d58a1ad667901637
Parents: 5d53a3b
Author: sany <sanysandish@gmail.com>
Authored: Fri Aug 4 13:09:46 2017 +0530
Committer: Jean-Daniel Cryans <jdcryans@apache.org>
Committed: Wed Aug 9 22:03:24 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/kudu/mapreduce/tools/ImportCsv.java   | 10 +++++-----
 .../java/org/apache/kudu/mapreduce/tools/ITImportCsv.java |  9 +++++----
 2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b0839fcd/java/kudu-client-tools/src/main/java/org/apache/kudu/mapreduce/tools/ImportCsv.java
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/src/main/java/org/apache/kudu/mapreduce/tools/ImportCsv.java
b/java/kudu-client-tools/src/main/java/org/apache/kudu/mapreduce/tools/ImportCsv.java
index f3e4d7b..4ee6d84 100644
--- a/java/kudu-client-tools/src/main/java/org/apache/kudu/mapreduce/tools/ImportCsv.java
+++ b/java/kudu-client-tools/src/main/java/org/apache/kudu/mapreduce/tools/ImportCsv.java
@@ -50,10 +50,10 @@ public class ImportCsv extends Configured implements Tool {
   /**
    * Sets up the actual job.
    *
-   * @param conf The current configuration.
-   * @param args The command line parameters.
-   * @return The newly created job.
-   * @throws java.io.IOException When setting up the job fails.
+   * @param conf the current configuration
+   * @param args the command line parameters
+   * @return the newly created job
+   * @throws java.io.IOException when setting up the job fails
    */
   @SuppressWarnings("deprecation")
   public static Job createSubmittableJob(Configuration conf, String[] args)
@@ -79,7 +79,7 @@ public class ImportCsv extends Configured implements Tool {
   }
 
   /*
-   * @param errorMsg Error message. Can be null.
+   * @param errorMsg error message. Can be null
    */
   private static void usage(final String errorMsg) {
     if (errorMsg != null && errorMsg.length() > 0) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/b0839fcd/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
b/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
index 4af8c59..cc5f904 100644
--- a/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
+++ b/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
@@ -36,6 +36,7 @@ import org.apache.kudu.ColumnSchema;
 import org.apache.kudu.Schema;
 import org.apache.kudu.Type;
 import org.apache.kudu.client.BaseKuduTest;
+import org.apache.kudu.client.KuduTable;
 import org.apache.kudu.client.CreateTableOptions;
 import org.apache.kudu.mapreduce.CommandLineParser;
 import org.apache.kudu.mapreduce.HadoopTestingUtility;
@@ -105,11 +106,11 @@ public class ITImportCsv extends BaseKuduTest {
     Job job = ImportCsv.createSubmittableJob(parser.getConfiguration(), parser.getRemainingArgs());
     assertTrue("Test job did not end properly", job.waitForCompletion(true));
 
+    KuduTable openTable = openTable(TABLE_NAME);
     assertEquals(1, job.getCounters().findCounter(ImportCsv.Counters.BAD_LINES).getValue());
-
-    assertEquals(3, countRowsInScan(
-        client.newScannerBuilder(openTable(TABLE_NAME)).build()));
-    // TODO: should verify the actual returned rows, not just the count!
+    assertEquals(3, countRowsInScan(client.newScannerBuilder(openTable).build()));
+    assertEquals("INT32 key=1, INT32 column1_i=3, DOUBLE column2_d=2.3, STRING column3_s=some
" +
+      "string, BOOL column4_b=true", scanTableToStrings(openTable).get(0));
   }
 
   private void writeCsvFile(File data) throws IOException {


Mime
View raw message