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

Fix :start and :end json accesses on snowflake #1110

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

jmhain
Copy link
Contributor

@jmhain jmhain commented Jan 24, 2024

No description provided.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7633710337

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 87.578%

Totals Coverage Status
Change from base Build 7632579793: -0.02%
Covered Lines: 19205
Relevant Lines: 21929

💛 - Coveralls

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jmhain

@@ -229,6 +229,24 @@ fn parse_json_using_colon() {
);

snowflake().one_statement_parses_to("SELECT a:b::int FROM t", "SELECT CAST(a:b AS INT) FROM t");

let sql = "SELECT a:start, a:end FROM t";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked for a few minutes and couldn't actually find any mention of this syntax in the documentation. 🤯 but I trust you it exists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the regular : operator for accessing a field within an OBJECT / VARIANT. start and end aren't special here, they're just field names that SF permits but we were failing to parse. Maybe it would have been clearer if I used SELECT a:start, a:end FROM (select parse_json('{"start":0,"end":1}') a) for the test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Got it

@alamb alamb merged commit 4be8117 into apache:main Jan 25, 2024
10 checks passed
@jmhain jmhain deleted the sf-json-start-end branch January 25, 2024 20:16
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.

3 participants