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

SPARK-18677: Fix parsing ['key'] in JSON path expressions. #16107

Closed
wants to merge 1 commit into from

Conversation

rdblue
Copy link
Contributor

@rdblue rdblue commented Dec 1, 2016

What changes were proposed in this pull request?

This fixes the parser rule to match named expressions, which doesn't work for two reasons:

  1. The name match is not coerced to a regular expression (missing .r)
  2. The surrounding literals are incorrect and attempt to escape a single quote, which is unnecessary

How was this patch tested?

This adds test cases for named expressions using the bracket syntax, including one with quoted spaces.

@rxin
Copy link
Contributor

rxin commented Dec 1, 2016

cc @hvanhovell

@SparkQA
Copy link

SparkQA commented Dec 1, 2016

Test build #69502 has finished for PR 16107 at commit 1c0cc09.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Dec 2, 2016

Seems correct to me, yes.

@NathanHowell
Copy link

I wrote the buggy version, doh... but this LGTM. Thanks for fix.

@hvanhovell
Copy link
Contributor

hvanhovell commented Dec 2, 2016

LGTM - merging to master/2.1/2.0. Thanks!

asfgit pushed a commit that referenced this pull request Dec 2, 2016
## What changes were proposed in this pull request?

This fixes the parser rule to match named expressions, which doesn't work for two reasons:
1. The name match is not coerced to a regular expression (missing .r)
2. The surrounding literals are incorrect and attempt to escape a single quote, which is unnecessary

## How was this patch tested?

This adds test cases for named expressions using the bracket syntax, including one with quoted spaces.

Author: Ryan Blue <blue@apache.org>

Closes #16107 from rdblue/SPARK-18677-fix-json-path.

(cherry picked from commit 4877897)
Signed-off-by: Herman van Hovell <hvanhovell@databricks.com>
asfgit pushed a commit that referenced this pull request Dec 2, 2016
## What changes were proposed in this pull request?

This fixes the parser rule to match named expressions, which doesn't work for two reasons:
1. The name match is not coerced to a regular expression (missing .r)
2. The surrounding literals are incorrect and attempt to escape a single quote, which is unnecessary

## How was this patch tested?

This adds test cases for named expressions using the bracket syntax, including one with quoted spaces.

Author: Ryan Blue <blue@apache.org>

Closes #16107 from rdblue/SPARK-18677-fix-json-path.

(cherry picked from commit 4877897)
Signed-off-by: Herman van Hovell <hvanhovell@databricks.com>
@asfgit asfgit closed this in 4877897 Dec 2, 2016
@rdblue
Copy link
Contributor Author

rdblue commented Dec 2, 2016

Thanks for the quick review!

robert3005 pushed a commit to palantir/spark that referenced this pull request Dec 15, 2016
## What changes were proposed in this pull request?

This fixes the parser rule to match named expressions, which doesn't work for two reasons:
1. The name match is not coerced to a regular expression (missing .r)
2. The surrounding literals are incorrect and attempt to escape a single quote, which is unnecessary

## How was this patch tested?

This adds test cases for named expressions using the bracket syntax, including one with quoted spaces.

Author: Ryan Blue <blue@apache.org>

Closes apache#16107 from rdblue/SPARK-18677-fix-json-path.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
## What changes were proposed in this pull request?

This fixes the parser rule to match named expressions, which doesn't work for two reasons:
1. The name match is not coerced to a regular expression (missing .r)
2. The surrounding literals are incorrect and attempt to escape a single quote, which is unnecessary

## How was this patch tested?

This adds test cases for named expressions using the bracket syntax, including one with quoted spaces.

Author: Ryan Blue <blue@apache.org>

Closes apache#16107 from rdblue/SPARK-18677-fix-json-path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants