@Test
  public void testImportPartitionedOrc() throws Exception {
    // Clear and drop table T,Tstage
    runStatementOnDriver("drop table if exists T");
    runStatementOnDriver("drop table if exists Tstage");

    // Create source table - Tstage
    runStatementOnDriver("create table Tstage (a int, b int) partitioned by (p int) stored"
        + " as orc tblproperties('transactional'='true')");

    // This creates an ORC data file with correct schema under table root
    runStatementOnDriver("insert into Tstage values(1,2,10),(3,4,11),(5,6,12)");
    final int[][] rows = { { 3 } };

    // Check Partitions statistics
    List<String> rsTstagePartitionsProperties = runStatementOnDriver("show partitions Tstage");
    for (String rsTstagePartition : rsTstagePartitionsProperties) {
      List<String> rsPartitionProperties =
          runStatementOnDriver("describe formatted Tstage partition(" + rsTstagePartition + ")");
      Assert.assertEquals("COLUMN_STATS_ACCURATE of partition " + rsTstagePartition + " of Tstage table", true,
          rsPartitionProperties.contains("\tCOLUMN_STATS_ACCURATE\t{\\\"BASIC_STATS\\\":\\\"true\\\"}"));
      Assert.assertEquals(" of partition " + rsTstagePartition + " of Tstage table", true,
          rsPartitionProperties.contains("\tnumRows             \t1                   "));
    }

    // Now we have an archive Tstage with 3 partitions
    runStatementOnDriver("export table Tstage to '" + getWarehouseDir() + "/1'");

    // Load T
    runStatementOnDriver("import table T from '" + getWarehouseDir() + "/1'");

    // Check basic stats in tblproperties of T
    List<String> rsTProperties = runStatementOnDriver("show tblproperties T");
    Assert.assertEquals("COLUMN_STATS_ACCURATE of T table", false,
        rsTProperties.contains("COLUMN_STATS_ACCURATE\t{\"BASIC_STATS\":\"true\"}"));
    Assert.assertEquals("numRows of T table", false, rsTProperties.contains("numRows\t3"));

    // Check Partitions statistics of T
    List<String> rsTPartitionsProperties = runStatementOnDriver("show partitions T");
    for (String rsTPartition : rsTPartitionsProperties) {
      List<String> rsPartitionProperties = runStatementOnDriver("describe formatted T partition(" + rsTPartition + ")");
      Assert.assertEquals("COLUMN_STATS_ACCURATE of partition " + rsTPartition + " of T table", false,
          rsPartitionProperties.contains("\tCOLUMN_STATS_ACCURATE\t{\\\"BASIC_STATS\\\":\\\"true\\\"}"));
      Assert.assertEquals(" of partition " + rsTPartition + " of T table", false,
          rsPartitionProperties.contains("\tnumRows             \t1                   "));
    }

    // Verify the count(*) output
    List<String> rs = runStatementOnDriver("select count(*) from T");
    Assert.assertEquals("Rowcount of imported table", TestTxnCommands2.stringifyValues(rows), rs);
  }
MM tables already work - mm_exim.q
Export creates a bunch of metadata in addition to data including all table props/IF/OF etc
Import from 'export' can create a table (any name specified) or add data into existing table.
If importing into existing table (un-partitioned) it must be empty.
If Import is creating a table it will be exactly like exported one except for the name.
ql/src/test/org/apache/hadoop/hive/ql/TestTxnExIm.java