Skip to content

Commit

Permalink
PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning…
Browse files Browse the repository at this point in the history
… NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)
  • Loading branch information
samarthjain committed May 17, 2017
1 parent 2cb617f commit 0e652b6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@
package org.apache.phoenix.expression.function;

import java.util.List;

import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.phoenix.expression.Expression;
import org.apache.phoenix.schema.types.PDataType;
import org.apache.phoenix.schema.tuple.Tuple;
import org.apache.phoenix.schema.types.PDataType;

/**
* (FIRST|LAST|NTH)_VALUE build in function interface
*
*/
abstract public class FirstLastValueBaseFunction extends DelegateConstantToCountAggregateFunction {

public static String NAME = null;

public FirstLastValueBaseFunction() {
}

Expand All @@ -50,11 +49,6 @@ public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
return true;
}

@Override
public String getName() {
return NAME;
}

@Override
public PDataType getDataType() {
return children.get(2).getDataType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.phoenix.expression.function;

import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.phoenix.expression.Expression;
import org.apache.phoenix.expression.LiteralExpression;
Expand Down Expand Up @@ -69,4 +70,9 @@ public Aggregator newClientAggregator() {

return aggregator;
}

@Override
public String getName() {
return NAME;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.phoenix.expression.function;

import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.phoenix.expression.Expression;
import org.apache.phoenix.expression.LiteralExpression;
Expand Down Expand Up @@ -72,4 +73,9 @@ public Aggregator newClientAggregator() {
return aggregator;
}

@Override
public String getName() {
return NAME;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
package org.apache.phoenix.expression.function;

import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.phoenix.expression.Expression;
import org.apache.phoenix.expression.LiteralExpression;
import org.apache.phoenix.expression.aggregator.Aggregator;
import org.apache.phoenix.expression.aggregator.FirstLastValueBaseClientAggregator;
import org.apache.phoenix.expression.aggregator.FirstLastValueServerAggregator;
import org.apache.phoenix.parse.NthValueAggregateParseNode;
import org.apache.phoenix.parse.FunctionParseNode;
import org.apache.phoenix.parse.NthValueAggregateParseNode;
import org.apache.phoenix.schema.types.PBoolean;
import org.apache.phoenix.schema.types.PInteger;

Expand Down Expand Up @@ -80,4 +81,9 @@ public Aggregator newClientAggregator() {
return aggregator;
}

@Override
public String getName() {
return NAME;
}

}

0 comments on commit 0e652b6

Please sign in to comment.