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

    https://github.com/apache/incubator-phoenix/pull/30#discussion_r12062725
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/FirstByLastByBaseClientAggregator.java
 ---
    @@ -0,0 +1,160 @@
    +/*
    + * 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.phoenix.expression.aggregator;
    +
    +import java.io.IOException;
    +import org.apache.phoenix.expression.Expression;
    +import org.apache.phoenix.expression.function.LengthFunction;
    +import org.apache.phoenix.parse.FunctionParseNode;
    +import org.apache.phoenix.schema.PDataType;
    +import org.apache.phoenix.schema.tuple.SingleKeyValueTuple;
    +import org.apache.phoenix.schema.tuple.Tuple;
    +import org.apache.phoenix.util.BinarySerializableComparator;
    +import org.apache.phoenix.util.ByteUtil;
    +import org.apache.phoenix.util.FirstByLastByDataContainer;
    +import org.apache.phoenix.util.FirstByLastByOffsetDataContainer;
    +import java.util.List;
    +import java.util.Set;
    +import java.util.TreeMap;
    +import org.apache.hadoop.hbase.filter.BinaryComparator;
    +import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
    +import org.apache.phoenix.schema.SortOrder;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +/**
    + *
    + * @author tzolkincz
    + */
    [email protected](name = LengthFunction.NAME, args = {
    --- End diff --
    
    Hi, thanks for your review.
    Yes, the syntax is different, but the idea is same. Oracle like syntax 
should by supported in future, as Taylor wrote above.
    Current syntax for function is LAST_VALUE(arg1, arg2[, arg3]).
    arg1 specify column witch will be get data from
    arg2 specify column for order these (arg1) values
    arg3 optional argument, says Nth row to select (after sort by arg2 column)
    Return value is determined by sorting data from arg1 column by column arg2. 
if is Nth value specified it is returned Nth element from sorted set.
    Dataset is regularly selected by WHERE clause.
    Is that answer to your question?


---
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.
---

Reply via email to