Skip to content

Wrong result for parsing special double number value #1619

Closed

Description

@goldmedal

Description

I tried to use the nightly commit in the upstream DataFusion (nightly commit) and the tests failed.

I think it's a bug caused by #1551. Consider the following SQL:

select 0. as c1

It should be parsed to

ExprWithAlias { 
  expr: Value(Number("0.", false)), 
  alias: Ident { value: "c1", quote_style: None }
}

but it seems to be parsed to

CompositeAccess { 
  expr: Value(Number("0", false)), 
  key: Ident { value: "as", quote_style: None, span: Span(Location(0,0)..Location(0,0))
}

We should handle this case in parse_compound_field_access, too.

Activity

  1. goldmedal commented on Dec 26, 2024

    @goldmedal
    ContributorAuthor

    I'll take a look at this issue soon.

  2. self-assigned this
    on Dec 26, 2024
  3. goldmedal commented on Dec 26, 2024

    @goldmedal
    ContributorAuthor

    After some tests, I believe this syntax is broken by #1600 and #1598

  4. alamb commented on Dec 28, 2024

    @alamb
    Contributor

    Thanks @goldmedal and @iffyio

    Do we need to make a patch release for sqlparser 53.0.0?

    By my reading this is an issue that was introduced after that release but before any other release (and thus does not affect the released 53.0.0)

  5. goldmedal commented on Dec 28, 2024

    @goldmedal
    ContributorAuthor

    Do we need to make a patch release for sqlparser 53.0.0?

    I think we don't need to do it.

    By my reading this is an issue that was introduced after that release but before any other release (and thus does not affect the released 53.0.0)

    Exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions