Yicong-Huang commented on code in PR #5896:
URL: https://github.com/apache/texera/pull/5896#discussion_r3509204932
##########
frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts:
##########
@@ -545,6 +550,16 @@ export class OperatorPropertyEditFrameComponent implements
OnInit, OnChanges, On
mappedField.type = "datasetversionselector";
}
+ // Aggregate: the attribute is optional for `count` (an empty attribute
means COUNT(*),
+ // counting all rows) and required for every other function. Show the
required marker
+ // (red *) accordingly, based on the sibling aggFunction within the same
row.
+ if (this.currentOperatorSchema?.operatorType === "Aggregate" &&
mappedField.key === "attribute") {
+ mappedField.expressions = {
+ ...mappedField.expressions,
+ "props.required": (field: FormlyFieldConfig) =>
field.parent?.model?.aggFunction !== AGGREGATE_COUNT,
+ };
+ }
Review Comment:
can we add a test about this logic:
- count will make attribute optional
- other aggregate func stays requiring attribute
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]