-
Notifications
You must be signed in to change notification settings - Fork 145
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
#3026 PPL - fieldsummary
command
#3320
base: main
Are you sure you want to change the base?
#3026 PPL - fieldsummary
command
#3320
Conversation
Signed-off-by: Kenrick Yap <[email protected]>
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.
needs w
List<String> includeFields = | ||
node.getIncludeFields().stream() | ||
.map(expr -> ((Field) expr).getField().toString()) | ||
.toList(); |
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.
you can do your filter and collect to map in your stream, and then return a map.
Map<String, ExprType> fieldsMap = env.lookupAllFields(Namespace.FIELD_NAME); | ||
|
||
if (node.getIncludeFields() != null) { | ||
List<String> includeFields = |
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.
consider: for each key in fieldsMap, check to see if it's in includedFields, and if not, remove it from the map.
context.push(); | ||
TypeEnvironment newEnv = context.peek(); | ||
|
||
newEnv.define(new Symbol(Namespace.FIELD_NAME, "Field"), ExprCoreType.STRING); |
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.
consider encapsulating all the types and lists for FieldSummary within a class, like a FieldSummaryAggregationExpression
. Then you can define enums for each column, and builders for the analyzer and parser.
Signed-off-by: Kenrick Yap <[email protected]>
Signed-off-by: Kenrick Yap <[email protected]>
a5f7214
to
3a4e7c4
Compare
Description
Implement
fieldsummary
command. Similar to spark implementation https://github.com/opensearch-project/opensearch-spark/pull/766/files#diff-e70358b83b0ba411a94e8e338f5542f44d184d5dbc49baa08ba41391d8f8ad7dRelated Issues
Resolves #3026
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.