sql-machine-learning / sqlflow

Brings SQL and AI together.
https://sqlflow.org
Apache License 2.0
5.09k stars 699 forks source link

SQLFlow Predict SQL generate ODPS UDF program #604

Closed Yancey1989 closed 5 years ago

Yancey1989 commented 5 years ago

Is your feature request related to a problem? Please describe.

SQLFlow would use ODPS UDF as the Alps prediction Job, for a simple example prediction UDF program:

set mst.model.name=push_common.model;
set mst.oss.id=aaa;
set mst.oss.key=bbb;

.....

SELECT sqlflow_projet.alps_inference(
            concat_ws(",",user_id,label)
            ,1
            ,"deep_id"
            ,COALESCE(deep_id, "")
        ) as (user_info, score)
FROM sqlflow_projet.users;

The SQLFlow Predict SQL can be like:

SELECT sqlflow_projet.alps_inference(
            concat_ws(',',user_id,label)
            ,1
            ,"deep_id"
            ,COALESCE(deep_id, "")
        ) AS (user_info, score)
FROM sqlflow_projet.users
PREDICT sqlflow_project.pred_result
USING sqlflow_model;

There would be two tasks to finish this feature:

NOTE: For the future, we need a more general solution to parse the standard SQL syntax.

tonyyang-svail commented 5 years ago

This issue has been fixed.