#3026 PPL - fieldsummary command#3320
Draft
kenrickyap wants to merge 3 commits intoopensearch-project:mainfrom
Draft
#3026 PPL - fieldsummary command#3320kenrickyap wants to merge 3 commits intoopensearch-project:mainfrom
fieldsummary command#3320kenrickyap wants to merge 3 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Kenrick Yap <Kenrick.Yap@improving.com>
acarbonetto
reviewed
Feb 13, 2025
| List<String> includeFields = | ||
| node.getIncludeFields().stream() | ||
| .map(expr -> ((Field) expr).getField().toString()) | ||
| .toList(); |
Collaborator
There was a problem hiding this comment.
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 = |
Collaborator
There was a problem hiding this comment.
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); |
Collaborator
There was a problem hiding this comment.
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 <Kenrick.Yap@improving.com>
Signed-off-by: Kenrick Yap <Kenrick.Yap@improving.com>
a5f7214 to
3a4e7c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implement
fieldsummarycommand. 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.