@@ -507,6 +507,47 @@ public void testWithFilter() throws Throwable {
507
507
importTable .close ();
508
508
}
509
509
510
+ /**
511
+ * Create a simple table, run an Export Job on it, Import with bulk output and enable largeResult
512
+ */
513
+ @ Test
514
+ public void testBulkImportAndLargeResult () throws Throwable {
515
+ // Create simple table to export
516
+ TableDescriptor desc = TableDescriptorBuilder
517
+ .newBuilder (TableName .valueOf (name .getMethodName ()))
518
+ .setColumnFamily (ColumnFamilyDescriptorBuilder .newBuilder (FAMILYA ).setMaxVersions (5 ).build ())
519
+ .build ();
520
+ UTIL .getAdmin ().createTable (desc );
521
+ Table exportTable = UTIL .getConnection ().getTable (desc .getTableName ());
522
+
523
+ Put p1 = new Put (ROW1 );
524
+ p1 .addColumn (FAMILYA , QUAL , now , QUAL );
525
+
526
+ // Having another row would actually test the filter.
527
+ Put p2 = new Put (ROW2 );
528
+ p2 .addColumn (FAMILYA , QUAL , now , QUAL );
529
+
530
+ exportTable .put (Arrays .asList (p1 , p2 ));
531
+
532
+ // Export the simple table
533
+ String [] args = new String [] { name .getMethodName (), FQ_OUTPUT_DIR , "1000" };
534
+ assertTrue (runExport (args ));
535
+
536
+ // Import to a new table
537
+ final String IMPORT_TABLE = name .getMethodName () + "import" ;
538
+ desc = TableDescriptorBuilder .newBuilder (TableName .valueOf (IMPORT_TABLE ))
539
+ .setColumnFamily (ColumnFamilyDescriptorBuilder .newBuilder (FAMILYA ).setMaxVersions (5 ).build ())
540
+ .build ();
541
+ UTIL .getAdmin ().createTable (desc );
542
+
543
+ String O_OUTPUT_DIR =
544
+ new Path (OUTPUT_DIR + 1 ).makeQualified (FileSystem .get (UTIL .getConfiguration ())).toString ();
545
+
546
+ args = new String [] { "-D" + Import .BULK_OUTPUT_CONF_KEY + "=" + O_OUTPUT_DIR ,
547
+ "-D" + Import .HAS_LARGE_RESULT + "=" + true , IMPORT_TABLE , FQ_OUTPUT_DIR , "1000" };
548
+ assertTrue (runImport (args ));
549
+ }
550
+
510
551
/**
511
552
* Count the number of keyvalues in the specified table with the given filter
512
553
* @param table the table to scan
0 commit comments