Git Product home page Git Product logo

Comments (4)

max-sixty avatar max-sixty commented on September 27, 2024 1

Nice find!

I think GlareDB will follow the Postgres spec.

(We disabled their tests recently since there were some inconsistencies in a new version — I think we shouldn't prioritize GlareDB highly relative to Postgres...)

from prql.

eitsupi avatar eitsupi commented on September 27, 2024 1

Since GlareDB (i.e., DataFusion behind it) copies Postgres syntax, it simply copied Postgres' when implementing the GlareDB dialect. In other words it was not set up to match GlareDB, it was there originally.

from prql.

max-sixty avatar max-sixty commented on September 27, 2024

Thanks @MaksimMisin

(@m-span this is an example of a small SQL gen issue. Those will persist through any changes to the resolver. While this isn't exactly a foundational issue, it would be a nice intro to that end of the compiler...)

from prql.

m-span avatar m-span commented on September 27, 2024

After a little exploring, I found the relevant lines of code

sql/gen_expr.rs::395-399:

            let value = if ctx.dialect.requires_quotes_intervals() {
                Box::new(sql_ast::Expr::Value(Value::SingleQuotedString(vau.n.to_string())))
            } else {
                Box::new(translate_literal(Literal::Integer(vau.n), ctx)?)
            };

It appears that this exception to use quotes on the value 2 in '2' WEEK is only done for postgres and glaredb.

Interestingly enough, while I do see that Postgres documentation states that it requires special quoting as described by the OP, I can't find anywhere in the GlareDb documentation where it requires the value to be quoted by itself. Certainly no other databases require this, to my knowledge. The documentation is quite sparse on this topic @max-sixty Is this actually the desired behavior for GlareDb? If so, should it also be adjusted to meet the postgres spec?

This is a weird spec, to fail on WEEK but not DAY

from prql.

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.