-
Notifications
You must be signed in to change notification settings - Fork 899
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
[RFE / POC] Implement MiqExpression interpreter #22397
Comments
This issue has been automatically marked as stale because it has not been updated for at least 3 months. If you can still reproduce this issue on the current release or on Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
This issue has been automatically marked as stale because it has not been updated for at least 3 months. If you can still reproduce this issue on the current release or on Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
This issue has been automatically marked as stale because it has not been updated for at least 3 months. If you can still reproduce this issue on the current release or on |
If we can drop
ok,
Changes were made |
I also commented here (#22989 (comment)) with similar findings as you. I agree we can drop |
Overview
MiqExpression can run in both sql and ruby.
When it runs in ruby, it produces a string, regular expressions replaces the string a few times and then it is run through
eval
.A. Seems like the regular expression
gsub
in_subst
shouldn't be necessaryB. The regular expression swapping takes a lot of time.
C. We want to drop eval
D. We want to better understand the code / make it more maintainable.
@Fryguy goal: Lets walk the miq expression tree with a visitor instead of
eval(generated_string)
.@kbrock goal: Lets first generate a ruby string that doesn't require the
subst{_find}
to put values into it.This proposal I consider my goal a stepping stone to get the interpreter.
Mid Goals
Removing code and and reducing processing:
subst_match?
Steps
preprocess_exp!(exp.dup)
topreprocess_exp(exp)
operator.downcase
)Field
object forfield
andvalue
into the tree (vs repeatedField.parse
,col_details
,is_field?
)col_details
cache andget_cols_from_expression
includes_for_sql
MiqExpression.get_col_info
,MiqReport.get_col_info
from the ui if possible.preprocess_exp!
consumevalid?
.evaluate_atoms
no longer modify expression. (This will become the interpreter)evaluate_atoms
s/obj/rec/
in params for consistencyAggressive changes
find
operator (can we drop)?rec
to Condition.do_eval so value can be used directly instead of substituted_to_ruby
"find" - generate correct code and dropCondition.subst_find(str, rec)
_to_ruby
generate correct code and dropCondition.subst(str, rec)
preprocess_exp!
convert hashes into s-expression structsMaking an Interpreter
_to_ruby
strings (without the"
's) intoevaluate_atom_helper
The text was updated successfully, but these errors were encountered: