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_r280289161
##########
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();
+ Path tabLocation = new Path(tTable.getSd().getLocation());
+ List<Path> newFilesList = new ArrayList<>();
+ try {
+ context.getDb().listFilesInsideAcidDirectory(tabLocation,
Review comment:
Done.
----------------------------------------------------------------
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]