[ 
https://issues.apache.org/jira/browse/TAJO-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14054785#comment-14054785
 ] 

ASF GitHub Bot commented on TAJO-774:
-------------------------------------

Github user hyunsik commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/13#discussion_r14645200
  
    --- Diff: 
tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/WindowAggExec.java
 ---
    @@ -0,0 +1,340 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.tajo.engine.planner.physical;
    +
    +import com.google.common.collect.Lists;
    +import org.apache.tajo.catalog.Column;
    +import org.apache.tajo.catalog.Schema;
    +import org.apache.tajo.catalog.SortSpec;
    +import org.apache.tajo.datum.Datum;
    +import org.apache.tajo.engine.eval.WindowFunctionEval;
    +import org.apache.tajo.engine.function.FunctionContext;
    +import org.apache.tajo.engine.planner.logical.WindowAggNode;
    +import org.apache.tajo.engine.planner.logical.WindowSpec;
    +import org.apache.tajo.storage.Tuple;
    +import org.apache.tajo.storage.TupleComparator;
    +import org.apache.tajo.storage.VTuple;
    +import org.apache.tajo.worker.TaskAttemptContext;
    +
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.Collections;
    +import java.util.Iterator;
    +import java.util.List;
    +
    +/**
    + * The sort-based window aggregation operator
    + */
    +public class WindowAggExec extends UnaryPhysicalExec {
    +  // plan information
    +  protected final int outputColumnNum;
    +  protected final int nonFunctionColumnNum;
    +  protected final int nonFunctionColumns[];
    +
    +  protected final int functionNum;
    +  protected final WindowFunctionEval functions[];
    +
    +  protected Schema schemaForOrderBy;
    +  protected int sortKeyColumns[];
    +  protected final boolean hasPartitionKeys;
    +  protected final int partitionKeyNum;
    +  protected final int partitionKeyIds[];
    +
    +  // for evaluation
    +  protected FunctionContext contexts [];
    +  protected Tuple lastKey = null;
    +  protected boolean noMoreTuples = false;
    +  private boolean [] orderedFuncFlags;
    +  private boolean [] aggFuncFlags;
    +  private boolean [] windowFuncFlags;
    +  private boolean [] endUnboundedFollowingFlags;
    +  private boolean [] endCurrentRowFlags;
    +
    +  private boolean endCurrentRow = false;
    --- End diff --
    
    Window function is still ongoing work. They will be used in the next work.


> Implement logical plan part and physical executor for window function.
> ----------------------------------------------------------------------
>
>                 Key: TAJO-774
>                 URL: https://issues.apache.org/jira/browse/TAJO-774
>             Project: Tajo
>          Issue Type: Sub-task
>          Components: planner/optimizer
>            Reporter: Hyunsik Choi
>            Assignee: Hyunsik Choi
>             Fix For: 0.9.0
>
>
> See the title. The main objective of this issue is to implement the logical 
> planning part for window function support.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to