[ https://issues.apache.org/jira/browse/SENTRY-2439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16669343#comment-16669343 ]
Shishr Prakash commented on SENTRY-2439: ---------------------------------------- The issue is a side effect of changes introduced with Sentry version 1.7.0 with JIRA (SENTRY-498) This "SimpleSemanticAnalyzer.java" is added started from Sentry 1.7.0 based github. === $ git checkout remotes/origin/branch-1.6.0 $ grep -r DROP_TABLE_REGEX * $ git checkout remotes/origin/branch-1.7.0 Previous HEAD position was 85f2f676 SENTRY-900: User could access sentry metric info by curl without authorization (Dapeng Sun, reviewed by Colin Ma) HEAD is now at e98bc77c Adding signing configuration mbp-e825:sentry hzu$ grep -r DROP_TABLE_REGEX * sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/util/SimpleSemanticAnalyzer.java: private static final String DROP_TABLE_REGEX = "^DROP\\s+" + "TABLE\\s+" + "(IF\\s+EXISTS\\s+)?" sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/util/SimpleSemanticAnalyzer.java: OP_REGEX_MAP.put(HiveOperation.DROPTABLE, DROP_TABLE_REGEX); === > "is not match table meta grammar error" with sentry-1.7 > -------------------------------------------------------- > > Key: SENTRY-2439 > URL: https://issues.apache.org/jira/browse/SENTRY-2439 > Project: Sentry > Issue Type: Bug > Components: Sentry > Affects Versions: 1.7.0 > Reporter: Shishr Prakash > Priority: Major > > [What happened] > After enabling sentry I am getting below error with DDLs like DROP table . > similar to sentry bug-1845. > [1] https://issues.apache.org/jira/browse/SENTRY-1845 > ====Error === > 2 rows selected (0.171 seconds) > 0: jdbc:hive2://maprtest03:10000> DROP TABLE project_dev_out_hive; > Error: Error while compiling statement: FAILED: HiveAuthzPluginException > class > org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzPluginException: > this command DROP TABLE project_dev_out_hive is not match table meta grammar > (state=42000,code=40000) > ====== > It is not the same issue, but a similar issue for DROP TABLE command. The > Sentry regex pattern for DROP TABLE command does not seem to be supporting > backtick. > String DROP_TABLE_REGEX = "^DROP\s+" + "TABLE\s+" + "(IF\s+EXISTS\s+)?" + > "([A-Za-z0-9._]+)"; > Looks like it is not fixed in the latest version as well (the same pattern is > used in the master branch as well). Hive seems to be supporting this syntax. > ## Steps to Reproduce > Try dropping hive table with backticks as below > DROP TABLE `project_dev_out_hive`; > ### What you expected to happen > Sentry should understand backticks and it should work for every command. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)