Open StpMax opened 4 months ago
Hi @StpMax ,
I have just started using MindsDB and am eager to help with this.
strategy: Add a new syntax rule to MindsDBParser.create_predictor
method, so that it can parse .view
segment, expand it to (select * from view)
and pass it down to CreatePredictor
.
Please advice on the same.
Thanks.
Yes I think it should create query from table name and then use it as it uses now For example this query
CREATE my_model FROM mindsdb.my_view PREDICT field_name
Should be converted to
CREATE my_model FROM (select * from mindsdb.my_view) PREDICT field_name
and this
CREATE my_model FROM `my.view` PREDICT field_name
to
CREATE my_model FROM (select * from `my.view`) PREDICT field_name
Hi @ea-rus, Thanks for clarifying this. I would like to work on it. Please assign it to me. Thanks, Nikhil.
Hi @ea-rus, I need one clarification though. Which of the following SQL statements is right?
I have examined the parsed output of 1, and mindsdb
gets passed in as the integration_name
and select * from view
gets passed in as query_str(raw_query tokens but stringified)
.
I was planning to go by this, which would result in the following query being parsed in the following way,
query: CREATE MODEL my_model FROM mindsdb.my_view PREDICT field_name
parsed_output: integration_name -> mindsdb, query_str -> "select * from my_view"
Thanks.
Both statements (1 and 2) are correct (should be parsed and executed) Yes, I think think it is ok:
query: CREATE MODEL my_model FROM mindsdb.my_view PREDICT field_name parsed_output: integration_name -> mindsdb, query_str -> "select * from my_view"`
At the moment creating model from view require a query to the view:
will be good to be able use
mindsdb.view
in the query: