[
https://issues.apache.org/jira/browse/TAJO-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14135463#comment-14135463
]
ASF GitHub Bot commented on TAJO-910:
-------------------------------------
Github user hyunsik commented on a diff in the pull request:
https://github.com/apache/tajo/pull/138#discussion_r17601979
--- Diff:
tajo-core/src/main/java/org/apache/tajo/engine/planner/PlannerUtil.java ---
@@ -75,19 +84,32 @@ public static boolean checkIfSimpleQuery(LogicalPlan
plan) {
boolean noGroupBy = !plan.getRootBlock().hasNode(NodeType.GROUP_BY);
boolean noWhere = !plan.getRootBlock().hasNode(NodeType.SELECTION);
boolean noJoin = !plan.getRootBlock().hasNode(NodeType.JOIN);
- boolean singleRelation = plan.getRootBlock().hasNode(NodeType.SCAN)
+ boolean singleRelation = (plan.getRootBlock().hasNode(NodeType.SCAN)
|| plan.getRootBlock().hasNode(NodeType.PARTITIONS_SCAN))
&&
PlannerUtil.getRelationLineage(plan.getRootBlock().getRoot()).length == 1;
boolean noComplexComputation = false;
if (singleRelation) {
ScanNode scanNode = plan.getRootBlock().getNode(NodeType.SCAN);
- if (!scanNode.getTableDesc().hasPartition() && scanNode.hasTargets()
- && scanNode.getTargets().length ==
scanNode.getInSchema().size()) {
+ if (scanNode == null) {
+ scanNode = plan.getRootBlock().getNode(NodeType.PARTITIONS_SCAN);
+ }
+ if (scanNode.hasTargets()) {
+ if (scanNode.getTableDesc().hasPartition()) {
+ int numPartitionColumns =
scanNode.getTableDesc().getPartitionMethod().getExpressionSchema().size();
+ if (scanNode.getTargets().length !=
scanNode.getInSchema().size() + numPartitionColumns) {
--- End diff --
I can understand what if-condition mean. But, it is hard for other code
readers to figure out its meaning. Please explain the purpose of this condition
briefly.
> Simple query (non-forwarded query) should be supported against partition
> tables.
> --------------------------------------------------------------------------------
>
> Key: TAJO-910
> URL: https://issues.apache.org/jira/browse/TAJO-910
> Project: Tajo
> Issue Type: Improvement
> Components: distributed query plan, physical operator, tajo master
> Reporter: Hyunsik Choi
> Assignee: Hyoungjun Kim
> Fix For: 0.9.0
>
>
> There are two types of queries according to whether a query is executed
> across cluster nodes or not.
> We call a query which is executed across cluster nodes *forwarded query*,
> meaning that TajoMaster forwards the query to a query master. In contrast, we
> call a query without distributed execution *simple query* or *non-forwarded
> query*, which executed in only client side. The following query is an example
> of simple query.
> {code}
> select * from table limit 10;
> {code}
> Currently, simple query is only supported against a normal table. We also
> should support it against partitioned tables.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)