[
https://issues.apache.org/jira/browse/TAJO-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14642235#comment-14642235
]
ASF GitHub Bot commented on TAJO-1346:
--------------------------------------
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.
> Create dynamic partitions to CatalogStore by running insert query or CTAS
> query.
> --------------------------------------------------------------------------------
>
> Key: TAJO-1346
> URL: https://issues.apache.org/jira/browse/TAJO-1346
> Project: Tajo
> Issue Type: Sub-task
> Components: Physical Operator
> Reporter: Jaehwa Jung
> Assignee: Jaehwa Jung
>
> Currently, If new partitions are added to HDFS by ColPartitionStoreExec,
> CatalogStore will not be aware of these partitions. So, Tajo need to load
> newly added partitions automatically to CatalogStore by running insert query
> or CTAS query.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)