You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "dengzhhu653 (via GitHub)" <gi...@apache.org> on 2023/05/09 08:59:37 UTC

[GitHub] [hive] dengzhhu653 commented on a diff in pull request #4276: HIVE-27304: Exclude CTAS condition while forming storage handler url …

dengzhhu653 commented on code in PR #4276:
URL: https://github.com/apache/hive/pull/4276#discussion_r1188343283


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizerV2.java:
##########
@@ -201,8 +201,7 @@ private static void addHivePrivObject(Entity privObject, Map<String, List<String
           HiveConf.ConfVars.HIVE_AUTHORIZATION_TABLES_ON_STORAGEHANDLERS)) {
         //TODO: add hive privilege object for storage based handlers for create and alter table commands.
         if (hiveOpType == HiveOperationType.CREATETABLE ||
-                hiveOpType == HiveOperationType.ALTERTABLE_PROPERTIES ||
-                hiveOpType == HiveOperationType.CREATETABLE_AS_SELECT) {

Review Comment:
   > So, we are not really reading anything from storage URL
   
   As far as I know, CTAS will read the source data from remote behind the scene.
   Just think aloud, how about inserting into a jdbc table, for example
   ```
   CREATE EXTERNAL TABLE default.jdbctable (DB_ID bigint)  STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'  TBLPROPERTIES (    'hive.sql.database.type' = 'MYSQL',    'hive.sql.jdbc.driver'   = 'com.mysql.jdbc.Driver',    'hive.sql.jdbc.url'      = 'jdbc:mysql://somehostname3306/hive1',    'hive.sql.dbcp.username' = 'hive1',    'hive.sql.dbcp.password' = 'hive1',    'hive.sql.query' = 'SELECT DB_ID FROM DBS' ) as select * from default.hivetablefromjdbc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org