-
Notifications
You must be signed in to change notification settings - Fork 7
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
Used st_collect
only when it's needed
#178
base: master
Are you sure you want to change the base?
Conversation
|
||
var TYPE = 'centroid'; | ||
|
||
var PARAMS = { | ||
source : Node.PARAM.NODE(Node.GEOMETRY.ANY), | ||
category_column : Node.PARAM.NULLABLE(Node.PARAM.STRING()), | ||
aggregation: Node.PARAM.NULLABLE(Node.PARAM.STRING(), 'count'), | ||
aggregation_column: Node.PARAM.NULLABLE(Node.PARAM.STRING()) | ||
aggregation: Node.PARAM.NULLABLE(Node.PARAM.ENUM('avg', 'count', 'max', 'min', 'sum'), null), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we change the default count
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it a real nullable
; if aggregation
comes with null then the ENUM
replaces it with count
and never is null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's the purpose of having a default value, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we need a nullable enum, if aggregation
comes with null
value, we shouldn't set count
as default, should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? I mean, it's nice to have the count by default, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't mean the node/analysis has to follow those defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if category_column
is null
and st_collect
is not used, we are forcing to have a count column
filled entirely with 1
. right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no category column the aggregation doesn't matter so you just don't do it. It will happen the same if there is no category column and the user provides an aggregation operation and an aggregation column, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, It will.
That's why we need to have the aggregation default to null
to avoid to do aggregations if category column is not present.
I think, I don't get your point. 😢
CR: @rochoa |
Fixes #127, validates analysis for invalid inputs, uses
st_collect
when needed.