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

[BUG] Existing field cannot be overriden with parse command #650

Open
kt-eliatra opened this issue Sep 12, 2024 · 1 comment
Open

[BUG] Existing field cannot be overriden with parse command #650

kt-eliatra opened this issue Sep 12, 2024 · 1 comment
Labels
bug Something isn't working PPL Pipe Processing Language support untriaged

Comments

@kt-eliatra
Copy link
Contributor

What is the bug?
According to https://github.com/opensearch-project/sql/blob/main/docs/user/ppl/cmd/parse.rst#example-2-override-an-existing-field, the parse command can be used to override an existing field. It doesn't work in spark ppl.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Create table and add data
CREATE TABLE test (
   name STRING, age INT, email STRING, street_address STRING
);

INSERT INTO test VALUES 
("Alice", 30, "alice@example.com", "123 Main St, Seattle"),
("Bob", 55, "bob@test.org", "456 Elm St, Portland"),
("Charlie", 65, "charlie@domain.net", "789 Pine St, San Francisco"),
("David", 19, "david@anotherdomain.com", "101 Maple St, New York");
  1. Run command like
source=test | parse email '.+@(?<email>.+)' | fields email;
  1. It returns
[AMBIGUOUS_REFERENCE] Reference `email` is ambiguous, could be: [`email`, `spark_catalog`.`default`.`test`.`email`].

What is the expected behavior?
Values from the existing email column are overridden by values computed by the parse command.

What is your host/environment?

  • OS: Linux Mint

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

@kt-eliatra kt-eliatra added bug Something isn't working untriaged labels Sep 12, 2024
@salyh
Copy link
Contributor

salyh commented Sep 12, 2024

Is it even possible to replace a existing column with a new computed column with same name in spark? Not sure about this.

@YANG-DB YANG-DB added the PPL Pipe Processing Language support label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PPL Pipe Processing Language support untriaged
Projects
None yet
Development

No branches or pull requests

3 participants