Skip to content

Commit

Permalink
Add alps branch (sql-machine-learning#305)
Browse files Browse the repository at this point in the history
* add alps branch

* defer log info
  • Loading branch information
tonyyang-svail committed Apr 26, 2019
1 parent 7632989 commit 67ba1fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 6 additions & 2 deletions sql/alps_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func resolveExpression(e interface{}) (interface{}, error) {
default:
return nil, fmt.Errorf("not supported expr in ALPS submitter: %s", headName)
}
return nil, nil
}

func transformToIntList(list []interface{}) ([]int, error) {
Expand Down Expand Up @@ -331,7 +330,12 @@ func generateEstimatorCreator(estimator string, attrs []*attribute) (string, err
}

func genALPS(w io.Writer, pr *extendedSelect, fts fieldTypes, db *DB) error {
// TODO
// TODO(uuleon): codegen alps
return nil
}

func submitALPS(w *PipeWriter, pr *extendedSelect, db *DB) error {
// TODO(uuleon): codegen & exec alps
return nil
}

Expand Down
13 changes: 8 additions & 5 deletions sql/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func runExtendedSQL(slct string, db *DB, pr *extendedSelect) *PipeReader {
err := func() error {
startAt := time.Now()
log.Infof("Starting runExtendedSQL:%s", slct)
defer log.Infof("runExtendedSQL finished, elapsed:%v", time.Since(startAt))

// NOTE: the temporary directory must be in a host directory
// which can be mounted to Docker containers. If I don't
Expand All @@ -190,13 +191,15 @@ func runExtendedSQL(slct string, db *DB, pr *extendedSelect) *PipeReader {
}
defer os.RemoveAll(cwd)

// FIXME(tony): temporary branch to alps
if os.Getenv("SQLFLOW_submitter") == "alps" {
return submitALPS(wr, pr, db)
}

if pr.train {
e = train(pr, slct, db, cwd, wr)
} else {
e = pred(pr, db, cwd, wr)
return train(pr, slct, db, cwd, wr)
}
log.Infof("runExtendedSQL finished, elapsed:%v", time.Since(startAt))
return e
return pred(pr, db, cwd, wr)
}()

if err != nil {
Expand Down

0 comments on commit 67ba1fb

Please sign in to comment.