Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planner: Support "select from model where input in (...)" #279

Open
ea-rus opened this issue Jul 4, 2023 · 0 comments
Open

Planner: Support "select from model where input in (...)" #279

ea-rus opened this issue Jul 4, 2023 · 0 comments
Labels

Comments

@ea-rus
Copy link
Contributor

ea-rus commented Jul 4, 2023

Support multiple model calls in selecting from predictor with using IN statement.

This select

SELECT * FROM model 
WHERE a IN (100,101) 

Should call model twice, with two inputs and return two records in output.
Equivalent calls:

SELECT * FROM model WHERE a = 100;
SELECT * FROM model WHERE a = 101;

Edge cases

  1. second field is constant
SELECT * FROM model WHERE a IN (100,101) and b = 1

is converted to:

SELECT * FROM model WHERE a = 100 and b = 1;
SELECT * FROM model WHERE a = 101 and b = 1;
  1. second field is list of equal length
SELECT * FROM model WHERE a IN (100,101) and b IN (1,2)

is converted to:

SELECT * FROM model WHERE a = 100 and b = 1;
SELECT * FROM model WHERE a = 101 and b = 2;
  1. second field is list of different length
SELECT * FROM model WHERE a IN (100,101) and b IN (1,2,3)

raises an error

  1. first field is subselect
SELECT * FROM model WHERE a IN (select a from table1)

Raise not supported ?
To be able to handle this case this logic should be implemented in mindsdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant