Github user hyunsik commented on a diff in the pull request:
https://github.com/apache/tajo/pull/630#discussion_r35504511
--- Diff:
tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMaster.java ---
@@ -286,6 +292,47 @@ public void stopQuery(QueryId queryId) {
finishedQueryMasterTasksCache.put(queryId, queryMasterTask);
+ // In INSERT .. SELECT ... queries or CTAS, dynamic partitions
should be added to catalog.
+ Query query = queryMasterTask.getQuery();
+ if (query.getState() == TajoProtos.QueryState.QUERY_SUCCEEDED &&
query.getResultDesc() != null) {
--- End diff --
Here is not good place to do this because we cannot guarantee the query
atomicity. In other words, a query is successfully completed but the partition
additions can be failed. Basically, we have to guarantee both the query
completion and partition addition or nothing.
QueryCompletedTransition::finalizeQuery in Query is the best place for this.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---