Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS API must support SKIP as an aggregation type #4780

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public class JsTotalsTableConfig {
JsAggregationOperation.LAST,
JsAggregationOperation.COUNT_DISTINCT,
JsAggregationOperation.DISTINCT,
JsAggregationOperation.UNIQUE);
JsAggregationOperation.UNIQUE,
JsAggregationOperation.SKIP);

/**
* Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
Expand Down Expand Up @@ -111,7 +112,6 @@ public class JsTotalsTableConfig {
*/
public JsArray<String> groupBy = new JsArray<>();

private AggregateRequest grpcRequest;
private JsArray<String> customColumns;
private JsArray<String> dropColumns;

Expand Down Expand Up @@ -406,6 +406,10 @@ public AggregateRequest buildRequest(JsArray<Column> allColumns) {
// case JsAggregationOperation.WSUM: {
// // TODO #3302 support this
// }
case JsAggregationOperation.SKIP: {
// cancel entirely, start the loop again
return;
}
default:
JsLog.warn("Aggregation " + aggregationType + " not supported, ignoring");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ public RollupRequest buildRequest(JsArray<Column> tableColumns) {
// case JsAggregationOperation.WSUM: {
// // TODO #3302 support this
// }
case JsAggregationOperation.SKIP: {
// cancel entirely, start the loop again
return;
}
default:
JsLog.warn("Aggregation " + aggregationType + " not supported, ignoring");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,18 @@ public class JsAggregationOperation {
*/
LAST = "Last",
UNIQUE = "Unique";
/**
* Indicates that this column should not be aggregated. String value is "Skip".
*/

// Array operation isn't legal in all contexts, just omit it for now
// ARRAY = "Array",
// These need some other parameter to function, not supported yet
// TODO #3302 support these
// SORTED_FIRST="SortedFirst",
// SORTED_LAST="SortedLast",
// WSUM = "WeightedSum";
@Deprecated

/**
* Indicates that this column should not be aggregated. String value is "Skip".
*/
public static final String SKIP = "Skip";

@JsIgnore
Expand All @@ -89,7 +90,8 @@ public static boolean canAggregateType(String aggregationType, String columnType
case DISTINCT:
case FIRST:
case LAST:
case UNIQUE: {
case UNIQUE:
case SKIP: {
// These operations are always safe
return true;
}
Expand Down
Loading