private static Task<?> alterSinglePartition(
          ImportTableDesc tblDesc, Table table, Warehouse wh, AlterTableAddPartitionDesc addPartitionDesc,
          ReplicationSpec replicationSpec, org.apache.hadoop.hive.ql.metadata.Partition ptn,
          EximUtil.SemanticAnalyzerWrapperContext x, boolean isReplication,
          String dumpRoot, ReplicationMetricCollector metricCollector) throws MetaException, IOException, HiveException {
    if ((replicationSpec != null) && (replicationSpec.isInReplicationScope())) {
      addPartitionDesc.setReplicationSpec(replicationSpec);
    }
    AlterTableAddPartitionDesc.PartitionDesc partSpec = addPartitionDesc.getPartitions().get(0);
    if (ptn == null) {
      fixLocationInPartSpec(tblDesc, table, wh, replicationSpec, partSpec, x);
    } else if (!externalTablePartition(tblDesc, replicationSpec)) {
      partSpec.setLocation(ptn.getLocation()); // use existing location
    }
    return TaskFactory.get(new DDLWork(x.getInputs(), x.getOutputs(), addPartitionDesc,
            isReplication, dumpRoot, metricCollector), x.getConf());
  }
The same code is used from both the "repl load" as well as "import".
Given that "repl load" now supports two modes "repl load dbName [location]" and
"repl load [location]" in which case the database name has to be taken from the table metadata
by default and then over-ridden if something specified on the command line.
<p>
hence for import to work correctly we have to pass in the sessionState default Db via the
parsedDbName parameter
ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java