-
Notifications
You must be signed in to change notification settings - Fork 20
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
Provide Options
-like utilities for Hint
#251
Comments
We should research about real hints before designing.
For example, they are popular form of hints. Possible values of @{OPTIMIZER_VERSION=8} SELECT * FROM MyTable; @{OPTIMIZER_VERSION=default_version, OPTIMIZER_STATISTICS_PACKAGE=auto_20191128_14_47_22UTC}
SELECT * FROM MyTable; My current thought:
|
I see. Thank you for response @apstndb. I agree that additional research is needed and that it is low priority.
|
Motivation
ast.Options
has utility methods to access their fields, e.g.,(*ast.Options).Field(name string) (expr Expr, found bool)
(*ast.Options).BoolField(name string) (*bool, error)
IntegerField
andStringField
ast.Hint
looks likeast.Options
, but it does not have such utilities. Thus, we need to provide such utilities forast.Hint
.Implementation Ideas
In my thoughts, most of APIs between
ast.Options
andast.Hint
are shared, so we first introduce a newinterface
such as:Then, we will implement
Fielder
forast.Options
andast.Hint
and derive{Bool,Integer,String}Field
asFielder
methods.Questions
ast.Hint
may be paths. So, is it enough thatname
isstring
?name
can be dot-chained, and it is resolved in theField
method of each type.The text was updated successfully, but these errors were encountered: