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

Hold "go-describeTable" to codegen #318

Closed
weiguoz opened this issue Apr 29, 2019 · 0 comments · Fixed by #319
Closed

Hold "go-describeTable" to codegen #318

weiguoz opened this issue Apr 29, 2019 · 0 comments · Fixed by #319
Assignees
Labels

Comments

@weiguoz
Copy link
Collaborator

weiguoz commented Apr 29, 2019

Is your feature request related to a problem? Please describe.
In SQLFlow, we use "describeTable" to verify fields, read field type and gen python code. Such "describeTable" is read from database engine by database/sql driver. We mark it as "go-describeTable".

Meanwhile, we use db api to read "describeTable" and access database. We mark it as "python-describeTable".

Always, "python-describeTable" equals to "go-describeTable", but differ to sqlflow parser(sql.y). And each database has it's own "describeTable", as talked in "Add hive db-api in codegen".

statement:

SELECT *   
FROM iris.train 
TRAIN DNNClassifier
WITH n_classes = 3, hidden_units = [10, 20]
COLUMN train.sepal_length,train.sepal_width,train.petal_length,train.petal_width
LABEL class
INTO sqlflow_models.my_dnn_model;
  • hive
field type name
train.sepal_length FLOAT_TYPE
train.petal_length FLOAT_TYPE

Field name comes with a table name as prefix

  • mysql
field type name
sepal_length FLOAT
petal_length FLOAT

Describe the solution you'd like
If "go-describeTable" used to verify merely, the database description may be lost in codegen. The python code complains field not found. To avoid this, we should use sql.y's description to verify, and hold "go-describeTable" to codegen.

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

Successfully merging a pull request may close this issue.

2 participants