You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kaiwangchen (via GitHub)" <gi...@apache.org> on 2025/12/04 08:40:11 UTC

[I] Feature request: support non-equal quantified subquery [datafusion]

kaiwangchen opened a new issue, #19082:
URL: https://github.com/apache/datafusion/issues/19082

   ### Is your feature request related to a problem or challenge?
   
   Here is an example:
   
   ```
   create table t (c1 int, c2 int);
   insert into t values (1, 2);
   select c1 from t where c2 > any(select c2 - 1 from t);
   
   Error during planning: Unsupported AnyOp: '>', only '=' is supported
   ```
   
   ### Describe the solution you'd like
   
   ```
   D create table t (c1 int, c2 int);
   D insert into t values (1, 2);
   D select c1 from t where c2 > any(select c2 - 1 from t);
   ┌───────┐
   │  c1   │
   │ int32 │
   ├───────┤
   │   1   │
   └───────┘
   
   mysql> create table t (c1 int, c2 int);
   mysql> insert into t values (1, 2);
   mysql> select c1 from t where c2 > any(select c2 - 1 from t);
   +------+
   | c1   |
   +------+
   |    1 |
   +------+
   1 row in set (0.00 sec)
   ```
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Feature request: support non-equal quantified subquery [datafusion]

Posted by "waynexia (via GitHub)" <gi...@apache.org>.
waynexia closed issue #19082: Feature request: support non-equal quantified subquery
URL: https://github.com/apache/datafusion/issues/19082


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Feature request: support non-equal quantified subquery [datafusion]

Posted by "waynexia (via GitHub)" <gi...@apache.org>.
waynexia commented on issue #19082:
URL: https://github.com/apache/datafusion/issues/19082#issuecomment-3611935497

   FWIW, `= any` is currently implemented via `array_contains` udf. To implement a more general `ANY` feature (like align with PostgreSQL), treating `ANY` as a logical plan node with subquery, and converting it to `EXISTS`/`JOIN` might be more suitable
   
   https://github.com/apache/datafusion/blob/00e79523bba15b3bdc99c1948ed202277e229c23/datafusion/functions-nested/src/planner.rs#L124-L137


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org