-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add rename PPL function #618
Conversation
There is one problem, when the rename command is not followed by the fields command, |
please check out the next code that should help remove the double projected fields: |
please also add README examples of this command usage |
44c19b4
to
3239ac8
Compare
returns
Documentation says that parse command can override existing field, at least in the "main sql plugin" https://github.com/opensearch-project/sql/blob/main/docs/user/ppl/cmd/parse.rst#example-2-override-an-existing-field |
@kt-eliatra thanks - this looks like an issue in the |
We opened this issue regarding the parse command: #650 (thx @kt-eliatra) But our assumption is that replacing a existing column with new computed column with same name is impossible to do in spark. |
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.
Some CI test are failing - plz review
Please add usage example in the readme.md doc
3239ac8
to
1f5e137
Compare
it should be fine now |
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.
Can u plz resolve the latest conflict ?
thanks
a539744
to
f3062b8
Compare
done |
@kt-eliatra sorry agains - plz resolve latest conflict... |
Signed-off-by: Kacper Trochimiak <kacper.trochimiak@eliatra.com>
Signed-off-by: Kacper Trochimiak <kacper.trochimiak@eliatra.com>
Signed-off-by: Kacper Trochimiak <kacper.trochimiak@eliatra.com>
Signed-off-by: Kacper Trochimiak <kacper.trochimiak@eliatra.com>
f3062b8
to
0df487c
Compare
np, done :) |
OH, there is a PR for Further, may not need to be done in this PR, the |
@kt-eliatra plz fix |
Signed-off-by: Hendrik Saly <hendrik.saly@eliatra.com>
done |
|
||
test("test single renamed field in fields command") { | ||
val frame = sql(s""" | ||
| source = $testTable | rename age as renamed_age | fields name, renamed_age |
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.
Could you test the following case:
| source = $testTable | rename age as renamed_age | fields age
Ref #618 (comment)
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.
@lukasz-soszynski-eliatra is on 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.
So far, the query source = $testTable | rename age as renamed_age | fields age
has worked "correctly"; that is, the field age
was present in the query result. I introduced corrections and updated the tests. Currently, the execution of the previously mentioned query causes an error.
Signed-off-by: Lukasz Soszynski <lukasz.soszynski@eliatra.com>
Description
This PR implements the rename PPL function.
Issues Resolved
#509
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.