Comments (4)
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.
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.
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.
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)
- "Leaking" of `_expr_*` columns into result relations HOT 3
- Display compiler errors in the Playground in the "Compiled SQL" tab instead of footer HOT 3
- Can not infer where a column is from but then the error message says that column is available? HOT 2
- append doesn't check column, column order matters HOT 2
- Can't put `#` in an alias name - it's treated as a comment HOT 2
- Better support for DuckDB data-import syntax HOT 2
- Aliases on relations HOT 13
- Wrong output when tables are used and columns have same name HOT 10
- Language changes out of new resolver? HOT 3
- Nightly tests failed HOT 1
- Release 0.13 HOT 1
- Queries that return nested tuples HOT 1
- Reformatting an alias omits quoting HOT 2
- DevContainer: Need to run `git config ... --add safe.directory` one time HOT 5
- After adding 1500k line of db schema type definition to default_db module, `prqlc compile` takes more than 1G ram & 2 min even for simplest query. HOT 1
- Nightly tests failed HOT 1
- How to abstract table filtering using function? HOT 2
- Nightly tests failed HOT 1
- Nightly tests failed
- Select columns collection is inaccurate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prql.