You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2019/05/07 14:45:00 UTC
[GitHub] [hive] sankarh commented on a change in pull request #617:
HIVE-21679: Replicating a CTAS event creating an MM table fails.
sankarh commented on a change in pull request #617: HIVE-21679: Replicating a CTAS event creating an MM table fails.
URL: https://github.com/apache/hive/pull/617#discussion_r281667133
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -7483,7 +7483,17 @@ protected Operator genFileSinkPlan(String dest, QB qb, Operator input)
if (ctx.getExplainConfig() != null) {
writeId = 0L; // For explain plan, txn won't be opened and doesn't make sense to allocate write id
} else {
- writeId = txnMgr.getTableWriteId(tblDesc.getDatabaseName(), tblDesc.getTableName());
+ String dbName = tblDesc.getDatabaseName();
+ String tableName = tblDesc.getTableName();
+
+ // CreateTableDesc stores table name as db.table. So, need to decode it before allocating
+ // write id.
+ if ((dbName == null) || tableName.contains(".")) {
+ String[] names = Utilities.getDbTableName(tableName);
+ dbName = names[0];
Review comment:
If dbName is null, then we expect to have db.table in tableName. CreateTableDesc.toTable for reference.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org