Skip to content

Allow array to be used as a function name again #432

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

Merged
merged 5 commits into from
Mar 8, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Mar 8, 2022

Rationale

#429 accidentally introduced a regression that found while testing downstream in DataFusion : apache/datafusion#1956

In particular, sql parser used to parse queries like this:

SELECT array(c1, cast(c2 as varchar)) FROM test

As a call to a function named array. However, after #429 it generates a parser error: SQL(ParserError("Expected [, found: ("))',

Changes

  1. Restore the behavior of parsing array(..) as a function call.
  2. Tests for same

Note array[] is still parsed as an array expression.

More details here #429 (comment)

cc @monadbobo

@alamb alamb changed the title Allow array to be used as a function Allow array to be used as a function name Mar 8, 2022
@coveralls
Copy link

coveralls commented Mar 8, 2022

Pull Request Test Coverage Report for Build 1953124295

  • 14 of 14 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 90.449%

Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.77%
Totals Coverage Status
Change from base Build 1952654180: -0.01%
Covered Lines: 7273
Relevant Lines: 8041

💛 - Coveralls

@alamb alamb changed the title Allow array to be used as a function name Allow array to be used as a function name again Mar 8, 2022
@alamb alamb merged commit a28bbcd into apache:main Mar 8, 2022
@alamb alamb deleted the alamb/array_function_name branch March 8, 2022 18:25
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1953121049

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • 20 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.01%) to 90.449%

Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.77%
tests/sqlparser_common.rs 19 99.02%
Totals Coverage Status
Change from base Build 1952654180: -0.01%
Covered Lines: 7273
Relevant Lines: 8041

💛 - Coveralls

@coveralls
Copy link

coveralls commented Aug 23, 2024

Pull Request Test Coverage Report for Build 1953094762

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • 155 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.01%) to 90.449%

Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.77%
tests/sqlparser_common.rs 19 99.02%
src/ast/mod.rs 135 77.54%
Totals Coverage Status
Change from base Build 1952654180: -0.01%
Covered Lines: 7273
Relevant Lines: 8041

💛 - Coveralls

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.

2 participants