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