private void loadDataNonAcid2AcidConversion() throws Exception {
    dropTables("T", "Tstage");
    runStatementOnDriver("create table T (a int, b int) stored as orc tblproperties('transactional'='false')");
    //per acid write to test nonAcid2acid conversion mixed with load data
    runStatementOnDriver("insert into T values(0,2),(0,4)");
    runStatementOnDriver("create table Tstage (a int, b int) stored as orc tblproperties('transactional'='false')");
    runStatementOnDriver("insert into Tstage values(1,2),(3,4)");
    //make 2 more inserts so that we have 000000_0_copy_1, 000000_0_copy_2 files in export
    //export works at file level so if you have copy_N in the table dir, you'll have those in output
    runStatementOnDriver("insert into Tstage values(2,2),(3,3)");
    runStatementOnDriver("insert into Tstage values(4,4),(5,5)");
    //create a file we'll import later
    runStatementOnDriver("export table Tstage to '" + getWarehouseDir() +"/1'");
    runStatementOnDriver("truncate table Tstage");//clean the staging table

    //now convert T to acid
    runStatementOnDriver("alter table T SET TBLPROPERTIES ('transactional' = 'true')");
    //and do a Load Data into the same table, which should now land in a delta/
    // (with 000000_0, 000000_0_copy_1, 000000_0_copy_2)
    runStatementOnDriver("load data local inpath '" + getWarehouseDir() + "/1/data' into table T");

    String testQuery = "select ROW__ID, a, b, INPUT__FILE__NAME from T order by ROW__ID";
/*
{"writeid":0,"bucketid":536870912,"rowid":0}     0       2/000000_0
{"writeid":0,"bucketid":536870912,"rowid":1}     0       4/000000_0
{"writeid":1,"bucketid":536870912,"rowid":0}    4       4/delta_0000001_0000001_0000/000000_0
{"writeid":1,"bucketid":536870912,"rowid":1}    5       5/delta_0000001_0000001_0000/000000_0
*/
    String[][] expected = new String[][] {
        //from pre-acid insert
        {"{\"writeid\":0,\"bucketid\":536870912,\"rowid\":0}\t0\t2", "t/000000_0"},
        {"{\"writeid\":0,\"bucketid\":536870912,\"rowid\":1}\t0\t4", "t/000000_0"},
        //from Load Data into acid converted table
        {"{\"writeid\":10000001,\"bucketid\":536870912,\"rowid\":0}\t1\t2",
            "t/delta_10000001_10000001_0000/000000_0"},
        {"{\"writeid\":10000001,\"bucketid\":536870912,\"rowid\":1}\t3\t4",
            "t/delta_10000001_10000001_0000/000000_0"},
        {"{\"writeid\":10000001,\"bucketid\":536936448,\"rowid\":0}\t2\t2",
            "t/delta_10000001_10000001_0000/000001_0"},
        {"{\"writeid\":10000001,\"bucketid\":536936448,\"rowid\":1}\t3\t3",
            "t/delta_10000001_10000001_0000/000001_0"},
        {"{\"writeid\":10000001,\"bucketid\":537001984,\"rowid\":0}\t4\t4",
            "t/delta_10000001_10000001_0000/000002_0"},
        {"{\"writeid\":10000001,\"bucketid\":537001984,\"rowid\":1}\t5\t5",
            "t/delta_10000001_10000001_0000/000002_0"},
    };
    checkResult(expected, testQuery, "load data inpath");

    //create more staging data with copy_N files and do LD+Overwrite
    runStatementOnDriver("insert into Tstage values(5,6),(7,8)");
    runStatementOnDriver("insert into Tstage values(8,8)");
    runStatementOnDriver("export table Tstage to '" + getWarehouseDir() +"/2'");
    runStatementOnDriver("load data local inpath '" + getWarehouseDir() + "/2/data' overwrite into table T");

    String[][] expected2 = new String[][] {
        {"{\"writeid\":10000002,\"bucketid\":536870912,\"rowid\":0}\t5\t6",
            "t/base_10000002/000000_0"},
        {"{\"writeid\":10000002,\"bucketid\":536870912,\"rowid\":1}\t7\t8", "t/base_10000002/000000_0"},
        {"{\"writeid\":10000002,\"bucketid\":536936448,\"rowid\":0}\t8\t8",

            "t/base_10000002/000001_0"}
    };
    checkResult(expected2, testQuery, "load data inpath overwrite");

    //create 1 more delta_x_x so that compactor has > dir file to compact
    runStatementOnDriver("insert into T values(9,9)");
    runStatementOnDriver("alter table T compact 'major'");
    TestTxnCommands2.runWorker(hiveConf);

    String[][] expected3 = new String[][] {
        {"{\"writeid\":10000002,\"bucketid\":536870912,\"rowid\":0}\t5\t6",
            "t/base_10000003_v0000013/bucket_00000"},
        {"{\"writeid\":10000002,\"bucketid\":536870912,\"rowid\":1}\t7\t8",
            "t/base_10000003_v0000013/bucket_00000"},
        {"{\"writeid\":10000002,\"bucketid\":536936448,\"rowid\":0}\t8\t8",
            "t/base_10000003_v0000013/bucket_00001"},
        {"{\"writeid\":10000003,\"bucketid\":536870912,\"rowid\":0}\t9\t9",
            "t/base_10000003_v0000013/bucket_00000"}
    };
    checkResult(expected3, testQuery, "load data inpath overwrite (major)");
  }
Load Data [overwrite] in to an (un-)partitioned acid converted table
ql/src/test/org/apache/hadoop/hive/ql/TestTxnLoadData.java