ashutosh-bapat commented on a change in pull request #608: Hive21598 : CTAS on 
ACID table during incremental does not replicated data.
URL: https://github.com/apache/hive/pull/608#discussion_r280290288
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/CreateTableOperation.java
 ##########
 @@ -140,6 +145,26 @@ private void createTableNonReplaceMode(Table tbl) throws 
HiveException {
       Table createdTable = context.getDb().getTable(tbl.getDbName(), 
tbl.getTableName());
       DataContainer dc = new DataContainer(createdTable.getTTable());
       
context.getQueryState().getLineageState().setLineage(createdTable.getPath(), 
dc, createdTable.getCols());
+
+      // We did not create the table when moving the data files for a 
non-partitioned table and
+      // thus could not add a write notification required for a transactional 
table. Do that
+      // here, after we have created the table. Since this is a newly created 
table, listing all
+      // the files in the directory and listing only the ones corresponding to 
the given id
+      // doesn't have much difference.
+      if (!createdTable.isPartitioned() && 
AcidUtils.isTransactionalTable(createdTable)) {
+        org.apache.hadoop.hive.metastore.api.Table tTable = 
createdTable.getTTable();
 
 Review comment:
   That's true, however, it's not possible to get writeId from createdTable, 
without getting tTable right now. We could write getWriteId wrapper for 
createdTable() but that means getTTable is called twice. A function call has 
some minimal invocation cost. This code avoids that.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to