Giter VIP home page Giter VIP logo

Comments (13)

lelit avatar lelit commented on June 3, 2024 1

I have found several examples that trigger the "safety belt"

Thanks for the report: I will try to address all of them, as soon as I'll restart working on v2, hopefully next week.

from pglast.

rdunklau avatar rdunklau commented on June 3, 2024 1

@lelit I'm not sure I understand, we already have them here https://github.com/lelit/pglast/blob/v2/pglast/keywords.py don't we ?

from pglast.

rdunklau avatar rdunklau commented on June 3, 2024 1

I'm not familiar enough with the parser to know what it implies for a keyword to be in one particular set or another. It would seem like depending on the context, you should check some sets and not others...

from pglast.

lelit avatar lelit commented on June 3, 2024 1

@tscholak, I think I cured both problems with the recent commits, any chance you can try current master and (possibly) confirm?

Note to myself: I should spend a tad of time learning the new "GH Actions"...

from pglast.

lelit avatar lelit commented on June 3, 2024 1

Thanks, I missed that, sorry. Can you try again with latest master please?

from pglast.

lelit avatar lelit commented on June 3, 2024 1

Great, released as v1.12.

from pglast.

lelit avatar lelit commented on June 3, 2024

@rdunklau, the right vs "right" issue appears to require the list of reserved words: maybe there's a way in libpgquery to expose the list defined in src/include/parser/kwlist.h? I could not spend enough time figuring out how they are actually stored, see keywords.c...

from pglast.

lelit avatar lelit commented on June 3, 2024

Yes, sorry, one should never read (his own!) source code early in the morning, before first coffee!

from pglast.

lelit avatar lelit commented on June 3, 2024

That problem should be fixable by considering also TYPE_FUNC_NAME_KEYWORDS, instead of only RESERVED_KEYWORDS here. We should add a test to verify the behaviour with all different kinds of keyword (that is, checking also some COL_NAME_KEYWORDS and UNRESERVED_KEYWORDS...)

from pglast.

tscholak avatar tscholak commented on June 3, 2024

Thank you very much for the quick response!
I was not aware of the v2 effort. Are you saying that these issues are already fixed in the v2 branch?

Btw, the queries I am considering are from an open source dataset called Spider, https://yale-lily.github.io/spider. There are almost 10k queries in this dataset, and I think it could be a great asset for your work if you wanted to run a lot of there-and-back-again tests.

from pglast.

lelit avatar lelit commented on June 3, 2024

I was not aware of the v2 effort. Are you saying that these issues are already fixed in the v2 branch?

No, v1 and v2 are very close in functionality, but the latter targets PG12.

Btw, the queries I am considering are from an open source dataset called Spider, https://yale-lily.github.io/spider. There are almost 10k queries in this dataset, and I think it could be a great asset for your work if you wanted to run a lot of there-and-back-again tests.

Interesting indeed, thanks.

from pglast.

tscholak avatar tscholak commented on June 3, 2024

Hi @lelit, thank you very much for looking into this. The two changes you made fixed the examples reported above, well done! I'm very happy :)

What remained an issue though are nested intersect, union, and except blocks as mentioned in the last paragraph of my initial report.

Can you have a look please at situations like these:

(
    SELECT * FROM "table"
) INTERSECT (
    (
        SELECT * FROM "table"
    ) UNION (
        SELECT * FROM "table"
    )
)
(
    (
        SELECT * FROM "table"
    ) UNION (
        SELECT * FROM "table"
    )
) INTERSECT (
    SELECT * FROM "table"
)

etc.?

from pglast.

tscholak avatar tscholak commented on June 3, 2024

tried it, works as expected!!!

Thanks so much! Consider this issue closed.

from pglast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.