[
https://issues.apache.org/jira/browse/IMPALA-10960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17426957#comment-17426957
]
carolinchen commented on IMPALA-10960:
--------------------------------------
hi [~stigahuang], thanks for your attention.
as two points you mentioned in comments:
1. rejecting queries not containing the expected format of comment seems
too strict for adhoc queries.
* As sql commet rule is a query option, which can be set by users themselves,
so it is flexible
* Defaultly, sql comment rule won't be set, which won't check any the query
statement, so it is performed as before. No query will be rejected.
2. if we can extract the info and expose them somewhere(e.g. in the
query profile).
this need to be considered in different situations:
* set the query option of sql comment rule and query comment pass the check
or without set query option
in this case, sql comment will be recorded in profile.
* set the query option of sql comment rule and query comment check failed.
in this case, we can only record info in logs. For the query
statement havn't be admmitted to the impala-server
above all, i will try to complete this issue as soon as possible. thank you
very much for your suggestions.
> Add query option for sql comment rule
> -------------------------------------
>
> Key: IMPALA-10960
> URL: https://issues.apache.org/jira/browse/IMPALA-10960
> Project: IMPALA
> Issue Type: New Feature
> Components: Backend
> Affects Versions: Impala 4.0.0
> Reporter: carolinchen
> Assignee: carolinchen
> Priority: Minor
> Labels: features
> Original Estimate: 12h
> Remaining Estimate: 12h
>
> SQL comment can be used to describe the SQL statements. with comments
> containing information about the SQL statements, This may help in easily
> correlating slow performance with source code.
> For better to use sql comment, we can set the sql comment rule with regular
> expression
> eg: set
> sql_comment_rule=/\*\s*author:\S+\s*?project:\S+\s*?desc:\S+\s*?.+\*/.+?;
> this example means that if the SQL statement want be addmitted by impala,
> its sql comment must include auther. project and desc's infomation. then we
> can trace the sql‘s origin.
> there are two steps:
> # Set sql_comment_rule by own way, with set sql_comment_rule query option in
> regular expression
> # Check the query‘s legality based on the sql_comment_rule which we have
> set. if check succeed, SQL can be admitted to Coordinator. otherwise, will
> refuse the query.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]