Support DISTINCT ON (...) (#852)

* Support "DISTINCT ON (...)"

* a test

* fix the merge
This commit is contained in:
Aljaž Mur Eržen 2023-04-27 21:34:54 +02:00 committed by GitHub
parent f72e2ec382
commit 3b1076c194
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 96 additions and 31 deletions

View file

@ -445,7 +445,7 @@ fn parse_quote_identifiers_2() {
Statement::Query(Box::new(Query {
with: None,
body: Box::new(SetExpr::Select(Box::new(Select {
distinct: false,
distinct: None,
top: None,
projection: vec![SelectItem::UnnamedExpr(Expr::Identifier(Ident {
value: "quoted ` identifier".into(),
@ -479,7 +479,7 @@ fn parse_quote_identifiers_3() {
Statement::Query(Box::new(Query {
with: None,
body: Box::new(SetExpr::Select(Box::new(Select {
distinct: false,
distinct: None,
top: None,
projection: vec![SelectItem::UnnamedExpr(Expr::Identifier(Ident {
value: "`quoted identifier`".into(),
@ -857,7 +857,7 @@ fn parse_select_with_numeric_prefix_column_name() {
assert_eq!(
q.body,
Box::new(SetExpr::Select(Box::new(Select {
distinct: false,
distinct: None,
top: None,
projection: vec![SelectItem::UnnamedExpr(Expr::Identifier(Ident::new(
"123col_$@123abc"
@ -896,7 +896,7 @@ fn parse_select_with_concatenation_of_exp_number_and_numeric_prefix_column() {
assert_eq!(
q.body,
Box::new(SetExpr::Select(Box::new(Select {
distinct: false,
distinct: None,
top: None,
projection: vec![
SelectItem::UnnamedExpr(Expr::Value(Value::Number(
@ -1075,7 +1075,7 @@ fn parse_substring_in_select() {
Box::new(Query {
with: None,
body: Box::new(SetExpr::Select(Box::new(Select {
distinct: true,
distinct: Some(Distinct::Distinct),
top: None,
projection: vec![SelectItem::UnnamedExpr(Expr::Substring {
expr: Box::new(Expr::Identifier(Ident {
@ -1372,7 +1372,7 @@ fn parse_hex_string_introducer() {
Statement::Query(Box::new(Query {
with: None,
body: Box::new(SetExpr::Select(Box::new(Select {
distinct: false,
distinct: None,
top: None,
projection: vec![SelectItem::UnnamedExpr(Expr::IntroducedString {
introducer: "_latin1".to_string(),