-
Notifications
You must be signed in to change notification settings - Fork 525
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
feat: implement infer_return_type in frontend #3295
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3295 +/- ##
==========================================
- Coverage 73.23% 73.21% -0.02%
==========================================
Files 748 748
Lines 101766 101785 +19
==========================================
+ Hits 74524 74525 +1
- Misses 27242 27260 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job! LGTM!
Later we can cache the plan to acheive high efficiency.
} | ||
|
||
fn user_authenticator(&self) -> &UserAuthenticator { | ||
&self.user_authenticator | ||
} | ||
} | ||
|
||
fn infer(session: Arc<SessionImpl>, stmt: Statement) -> Result<Vec<PgFieldDescriptor>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some docstring.
@ZENOTME I assume the implementation change is invisible to users. Correct? Thanks. |
Yes |
What's changed and what's your intention?
The original implementation of infer_return_type interface in frontend is copied from run_statement. It will actually execute the statement and get the result description from the result of execution. This implementation is primarily for testing purposes but it's inefficient. Infer_return_type API is to get the result description but needn't execute.
Hence we give a new implementation for infer_return_type. It calls a new function "infer", "infer" will get the result description
of the query statement but not execute.
Checklist
./risedev check
(or alias,./risedev c
)Refer to a related PR or issue link (optional)
#3131