-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
572 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,13 +20,15 @@ | |
import com.flipkart.foxtrot.common.Opcodes; | ||
import com.flipkart.foxtrot.common.enums.CountPrecision; | ||
import com.flipkart.foxtrot.common.query.Filter; | ||
import com.flipkart.foxtrot.common.stats.Stat; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.apache.commons.lang3.builder.ToStringBuilder; | ||
import org.hibernate.validator.constraints.NotEmpty; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* User: Santanu Sinha ([email protected]) | ||
|
@@ -41,8 +43,13 @@ public class GroupRequest extends ActionRequest { | |
@NotEmpty | ||
private String table; | ||
|
||
// Kept for backward compatibility | ||
private String uniqueCountOn; | ||
|
||
private String aggregationField; | ||
|
||
private Stat aggregationType; | ||
|
||
@NotNull | ||
@NotEmpty | ||
private List<String> nesting; | ||
|
@@ -53,46 +60,29 @@ public GroupRequest() { | |
super(Opcodes.GROUP); | ||
} | ||
|
||
public GroupRequest(List<Filter> filters, String table, String uniqueCountOn, List<String> nesting) { | ||
public GroupRequest(List<Filter> filters, String table, String uniqueCountOn, | ||
String aggregationField, Stat aggregationType, | ||
List<String> nesting, CountPrecision precision) { | ||
super(Opcodes.GROUP, filters); | ||
this.table = table; | ||
this.uniqueCountOn = uniqueCountOn; | ||
this.aggregationField = aggregationField; | ||
this.aggregationType = aggregationType; | ||
this.nesting = nesting; | ||
this.precision = precision; | ||
} | ||
|
||
public <T> T accept(ActionRequestVisitor<T> visitor) { | ||
return visitor.visit(this); | ||
} | ||
|
||
public String getTable() { | ||
return table; | ||
} | ||
|
||
public void setTable(String table) { | ||
this.table = table; | ||
} | ||
|
||
public String getUniqueCountOn() { | ||
return uniqueCountOn; | ||
} | ||
|
||
public void setUniqueCountOn(String uniqueCountOn) { | ||
this.uniqueCountOn = uniqueCountOn; | ||
} | ||
|
||
public List<String> getNesting() { | ||
return nesting; | ||
} | ||
|
||
public void setNesting(List<String> nesting) { | ||
this.nesting = nesting; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this).appendSuper(super.toString()) | ||
.append("table", table) | ||
.append("aggregationType", aggregationType) | ||
.append("uniqueCountOn", uniqueCountOn) | ||
.append("aggregationField", aggregationField) | ||
.append("nesting", nesting) | ||
.toString(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.