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

Fix logic for window’s default as #3810

Merged
merged 6 commits into from
May 24, 2018
Merged

Fix logic for window’s default as #3810

merged 6 commits into from
May 24, 2018

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented May 24, 2018

_field was wrong as multiple fields can have the same aggregate op

@kanitw kanitw requested review from domoritz and AkshatSh May 24, 2018 18:43
@@ -26,7 +26,8 @@ export class WindowTransformNode extends DataFlowNode {
}

private getDefaultName(windowFieldDef: WindowFieldDef): string {
return windowFieldDef.as === undefined ? String(windowFieldDef.op) + '_field' : windowFieldDef.as;
const {as, op, field} = windowFieldDef;
return as || (field ? `${op}_${field}` : op);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with nested fields? Why not use vgField?

@@ -26,7 +27,8 @@ export class WindowTransformNode extends DataFlowNode {
}

private getDefaultName(windowFieldDef: WindowFieldDef): string {
return windowFieldDef.as === undefined ? String(windowFieldDef.op) + '_field' : windowFieldDef.as;
const {as, op} = windowFieldDef;
return as || vgField(windowFieldDef, {op});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this still seems hacky.... let me refactor more

@kanitw kanitw merged commit f180e0c into master May 24, 2018
@kanitw kanitw deleted the kw/window-as branch May 24, 2018 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants