Re: [PR] Add PostgreSQL specfic "CREATE TYPE t AS ENUM (...)" support. [datafusion-sqlparser-rs]

2024-10-08 Thread via GitHub


iffyio commented on code in PR #1460:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1460#discussion_r1792219167


##
src/dialect/postgresql.rs:
##
@@ -138,6 +138,14 @@ impl Dialect for PostgreSqlDialect {
 fn parse_statement(&self, parser: &mut Parser) -> Option> {
 if parser.parse_keyword(Keyword::COMMENT) {
 Some(parse_comment(parser))
+} else if parser.parse_keyword(Keyword::CREATE) {
+match parse_create(parser) {
+Some(result) => Some(result),
+None => {
+parser.prev_token(); // unconsume the CREATE if we didn't 
end up parsing anything
+None
+}

Review Comment:
   it might be possible to simplify this if we call `prev_token()` before 
calling `parse_create`? thinking since the latter already returns an Option 
representing the same result



##
src/ast/mod.rs:
##
@@ -3181,6 +3181,14 @@ pub enum Statement {
 representation: UserDefinedTypeRepresentation,
 },
 /// ```sql
+/// CREATE TYPE  AS ENUM
+/// ```
+/// Note: this is a PostgreSQL-specific statement. See 

+CreateTypeAsEnum {
+name: ObjectName,
+labels: Vec,
+},

Review Comment:
   I'm thinking it could make sense to include it as part of the existing 
`CreateType`, especially since its already an enum there wouldn't be as much of 
disadvantage in terms of backwards compatibility? then going forward we'd be 
able to extend it in a similar manner with future extensions to the statement. 
something like:
   ```rust
   pub enum UserDefinedTypeRepresentation {
   Composite {
   attributes: Vec,
   },
   // new variant
   Enum(CreateTypeEnum)
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
For additional commands, e-mail: dev-h...@datafusion.apache.org



Re: [VOTE] Release DataFusion Python Bindings 42.0.0 RC1

2024-10-08 Thread Michael Ward
+1 (non-binding)

On Tue, Oct 8, 2024 at 6:23 AM Andrew Lamb  wrote:

> +1 (binding)
>
> This looks like a great release to me. Thanks Tim and Andy for keeping
> things moving along.
>
> Verified on an m3 mac
>
> Andrew
>
> On Tue, Oct 8, 2024 at 5:23 AM Tim Saucer  wrote:
>
> > +1 non-binding
> >
> > Verified on m2 mac in python 3.10 and 3.12.
> >
> > Note: We need to add one line in the updated verification instructions to
> > do a submodule init and update.
> >
> >
> > On Tue, Oct 8, 2024 at 1:03 AM L. C. Hsieh  wrote:
> >
> > > +1 (binding)
> > >
> > > Verified on M3 Mac.
> > >
> > > Thanks Andy.
> > >
> > > On Mon, Oct 7, 2024 at 9:50 PM Andy Grove  >
> > > wrote:
> > > >
> > > > Hi,
> > > >
> > > > I would like to propose a release of the Apache DataFusion Python
> > > Bindings,
> > > > version 42.0.0.
> > > >
> > > > This release candidate is based on commit:
> > > af2d66581817c21048ad77729069b7af40b4ba98 [1]
> > > > The proposed release tarball and signatures are hosted at [2].
> > > > The changelog is located at [3].
> > > > The Python wheels are located at [4].
> > > >
> > > > Please download, verify checksums and signatures, run the unit tests,
> > > and vote
> > > > on the release. The vote will be open for at least 72 hours.
> > > >
> > > > Only votes from PMC members are binding, but all members of the
> > > community are
> > > > encouraged to test the release and vote with "(non-binding)".
> > > >
> > > > The standard verification procedure is documented at
> > >
> >
> https://github.com/apache/datafusion-python/blob/main/dev/release/README.md#verifying-release-candidates
> > > .
> > > >
> > > > [ ] +1 Release this as Apache DataFusion Python 42.0.0
> > > > [ ] +0
> > > > [ ] -1 Do not release this as Apache DataFusion Python 42.0.0
> > because...
> > > >
> > > > Here is my vote:
> > > >
> > > > +1 (verified on Mac M3)
> > > >
> > > > [1]:
> > >
> >
> https://github.com/apache/datafusion-python/tree/af2d66581817c21048ad77729069b7af40b4ba98
> > > > [2]:
> > >
> >
> https://dist.apache.org/repos/dist/dev/datafusion/apache-datafusion-python-42.0.0-rc1
> > > > [3]:
> > >
> >
> https://github.com/apache/datafusion-python/blob/af2d66581817c21048ad77729069b7af40b4ba98/CHANGELOG.md
> > > > [4]: https://test.pypi.org/project/datafusion/42.0.0/
> > > >
> > > >
> > > > -
> > > > To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
> > > > For additional commands, e-mail: dev-h...@datafusion.apache.org
> > > >
> > >
> > > -
> > > To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
> > > For additional commands, e-mail: dev-h...@datafusion.apache.org
> > >
> > >
> >
>


-- 
Michael Ward


Re: [PR] Add support for ASC and DESC in CREATE TABLE column constraints for SQLite. [datafusion-sqlparser-rs]

2024-10-08 Thread via GitHub


alamb merged PR #1462:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1462


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
For additional commands, e-mail: dev-h...@datafusion.apache.org



Re: [PR] Add support of `EXPLAIN QUERY PLAN` syntax for SQLite dialect [datafusion-sqlparser-rs]

2024-10-08 Thread via GitHub


alamb merged PR #1458:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1458


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
For additional commands, e-mail: dev-h...@datafusion.apache.org



Re: [I] `EXPLAIN QUERY PLAN` fails to parse (sqlite) [datafusion-sqlparser-rs]

2024-10-08 Thread via GitHub


alamb closed issue #1455: `EXPLAIN QUERY PLAN` fails to parse (sqlite)
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1455


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
For additional commands, e-mail: dev-h...@datafusion.apache.org



Re: [PR] Add support for quantified comparison predicates (ALL/ANY/SOME) [datafusion-sqlparser-rs]

2024-10-08 Thread via GitHub


iffyio commented on code in PR #1459:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1459#discussion_r1792185691


##
src/ast/mod.rs:
##
@@ -646,12 +646,16 @@ pub enum Expr {
 regexp: bool,
 },
 /// `ANY` operation e.g. `foo > ANY(bar)`, comparison operator is one of 
`[=, >, <, =>, =<, !=]`
+/// 
https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#_8_9_quantified_comparison_predicate

Review Comment:
   I'm thinking we can link to 
[snowflake](https://docs.snowflake.com/en/sql-reference/operators-subquery#all-any)
 instead? Since that's a supported dialect that has the subquery functionality. 
The current link  doesnt seem to refer to any specific dialect so it could add 
confusion later on when trying to figure what features in the parser to maintain



##
src/parser/mod.rs:
##
@@ -2639,10 +2632,22 @@ impl<'a> Parser<'a> {
 };
 
 if let Some(op) = regular_binary_operator {
-if let Some(keyword) = self.parse_one_of_keywords(&[Keyword::ANY, 
Keyword::ALL]) {
+if let Some(keyword) =
+self.parse_one_of_keywords(&[Keyword::ANY, Keyword::ALL, 
Keyword::SOME])
+{
 self.expect_token(&Token::LParen)?;
-let right = self.parse_subexpr(precedence)?;
-self.expect_token(&Token::RParen)?;
+let right = if self.is_query_ahead() {
+// We have a subquery ahead (SELECT\WITH ...) need to 
rewind and
+// use the parenthesis for parsing the subquery as an 
expression.
+self.prev_token(); // SELECT
+self.prev_token(); // LParen
+self.parse_subexpr(precedence)?

Review Comment:
   Ah right that makes sense!



##
src/ast/mod.rs:
##
@@ -650,6 +650,8 @@ pub enum Expr {
 left: Box,
 compare_op: BinaryOperator,
 right: Box,
+// ANY and SOME are synonymous

Review Comment:
   Ah cool! Can we include the link in the comment here as well? It could help 
later on in case someone comes across this and wonders the same



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
For additional commands, e-mail: dev-h...@datafusion.apache.org



Re: [VOTE] Release DataFusion Python Bindings 42.0.0 RC1

2024-10-08 Thread Andrew Lamb
+1 (binding)

This looks like a great release to me. Thanks Tim and Andy for keeping
things moving along.

Verified on an m3 mac

Andrew

On Tue, Oct 8, 2024 at 5:23 AM Tim Saucer  wrote:

> +1 non-binding
>
> Verified on m2 mac in python 3.10 and 3.12.
>
> Note: We need to add one line in the updated verification instructions to
> do a submodule init and update.
>
>
> On Tue, Oct 8, 2024 at 1:03 AM L. C. Hsieh  wrote:
>
> > +1 (binding)
> >
> > Verified on M3 Mac.
> >
> > Thanks Andy.
> >
> > On Mon, Oct 7, 2024 at 9:50 PM Andy Grove 
> > wrote:
> > >
> > > Hi,
> > >
> > > I would like to propose a release of the Apache DataFusion Python
> > Bindings,
> > > version 42.0.0.
> > >
> > > This release candidate is based on commit:
> > af2d66581817c21048ad77729069b7af40b4ba98 [1]
> > > The proposed release tarball and signatures are hosted at [2].
> > > The changelog is located at [3].
> > > The Python wheels are located at [4].
> > >
> > > Please download, verify checksums and signatures, run the unit tests,
> > and vote
> > > on the release. The vote will be open for at least 72 hours.
> > >
> > > Only votes from PMC members are binding, but all members of the
> > community are
> > > encouraged to test the release and vote with "(non-binding)".
> > >
> > > The standard verification procedure is documented at
> >
> https://github.com/apache/datafusion-python/blob/main/dev/release/README.md#verifying-release-candidates
> > .
> > >
> > > [ ] +1 Release this as Apache DataFusion Python 42.0.0
> > > [ ] +0
> > > [ ] -1 Do not release this as Apache DataFusion Python 42.0.0
> because...
> > >
> > > Here is my vote:
> > >
> > > +1 (verified on Mac M3)
> > >
> > > [1]:
> >
> https://github.com/apache/datafusion-python/tree/af2d66581817c21048ad77729069b7af40b4ba98
> > > [2]:
> >
> https://dist.apache.org/repos/dist/dev/datafusion/apache-datafusion-python-42.0.0-rc1
> > > [3]:
> >
> https://github.com/apache/datafusion-python/blob/af2d66581817c21048ad77729069b7af40b4ba98/CHANGELOG.md
> > > [4]: https://test.pypi.org/project/datafusion/42.0.0/
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
> > > For additional commands, e-mail: dev-h...@datafusion.apache.org
> > >
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
> > For additional commands, e-mail: dev-h...@datafusion.apache.org
> >
> >
>


Re: [VOTE] Release DataFusion Python Bindings 42.0.0 RC1

2024-10-08 Thread Tim Saucer
+1 non-binding

Verified on m2 mac in python 3.10 and 3.12.

Note: We need to add one line in the updated verification instructions to
do a submodule init and update.


On Tue, Oct 8, 2024 at 1:03 AM L. C. Hsieh  wrote:

> +1 (binding)
>
> Verified on M3 Mac.
>
> Thanks Andy.
>
> On Mon, Oct 7, 2024 at 9:50 PM Andy Grove 
> wrote:
> >
> > Hi,
> >
> > I would like to propose a release of the Apache DataFusion Python
> Bindings,
> > version 42.0.0.
> >
> > This release candidate is based on commit:
> af2d66581817c21048ad77729069b7af40b4ba98 [1]
> > The proposed release tarball and signatures are hosted at [2].
> > The changelog is located at [3].
> > The Python wheels are located at [4].
> >
> > Please download, verify checksums and signatures, run the unit tests,
> and vote
> > on the release. The vote will be open for at least 72 hours.
> >
> > Only votes from PMC members are binding, but all members of the
> community are
> > encouraged to test the release and vote with "(non-binding)".
> >
> > The standard verification procedure is documented at
> https://github.com/apache/datafusion-python/blob/main/dev/release/README.md#verifying-release-candidates
> .
> >
> > [ ] +1 Release this as Apache DataFusion Python 42.0.0
> > [ ] +0
> > [ ] -1 Do not release this as Apache DataFusion Python 42.0.0 because...
> >
> > Here is my vote:
> >
> > +1 (verified on Mac M3)
> >
> > [1]:
> https://github.com/apache/datafusion-python/tree/af2d66581817c21048ad77729069b7af40b4ba98
> > [2]:
> https://dist.apache.org/repos/dist/dev/datafusion/apache-datafusion-python-42.0.0-rc1
> > [3]:
> https://github.com/apache/datafusion-python/blob/af2d66581817c21048ad77729069b7af40b4ba98/CHANGELOG.md
> > [4]: https://test.pypi.org/project/datafusion/42.0.0/
> >
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
> > For additional commands, e-mail: dev-h...@datafusion.apache.org
> >
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
> For additional commands, e-mail: dev-h...@datafusion.apache.org
>
>


Re: [PR] Add support for quantified comparison predicates (ALL/ANY/SOME) [datafusion-sqlparser-rs]

2024-10-08 Thread via GitHub


yoavcloud commented on PR #1459:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1459#issuecomment-2400352384

   Pushed doc changes as recommended.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@datafusion.apache.org
For additional commands, e-mail: dev-h...@datafusion.apache.org