Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-26 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 26, 2017, 9:38 오전)


Review request for hive.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
28fa7a5783 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  
itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestHiveSessionImpl.java
 76059f8b07 
  
itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java
 da01a2947d 
  itests/src/test/resources/testconfiguration.properties 32a6418552 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java e802d42a4d 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 443be545d4 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
2c55011d71 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
  ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
  ql/src/test/results/clientnegative/authorization_kill_query.q.out 
PRE-CREATION 
  ql/src/test/results/clientpositive/kill_query.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdReq.java
 PRE-CREATION 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdResp.java
 PRE-CREATION 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-25 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 26, 2017, 4:37 오전)


Review request for hive.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
28fa7a5783 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  
itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestHiveSessionImpl.java
 76059f8b07 
  
itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java
 da01a2947d 
  itests/src/test/resources/testconfiguration.properties 8f523215c3 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java e802d42a4d 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 443be545d4 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
2c55011d71 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
  ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
  ql/src/test/results/clientnegative/authorization_kill_query.q.out 
PRE-CREATION 
  ql/src/test/results/clientpositive/kill_query.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdReq.java
 PRE-CREATION 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdResp.java
 PRE-CREATION 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-25 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 25, 2017, 8:23 오전)


Review request for hive.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
28fa7a5783 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java e802d42a4d 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 443be545d4 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
2c55011d71 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
  ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
  ql/src/test/results/clientnegative/authorization_kill_query.q.out 
PRE-CREATION 
  ql/src/test/results/clientpositive/kill_query.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdReq.java
 PRE-CREATION 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdResp.java
 PRE-CREATION 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  service/src/java/org/apache/hive/service/cli/CLIService.java 689b948a87 
  service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java 
43fbb00e32 
  service/src/java/org/apache/hive/service/cli/ICLIService.java 9f2039c971 
  

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-25 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 25, 2017, 8:12 오전)


Review request for hive.


Changes
---

Fixed unit test failures, and applied feedback about transaction handling and 
queryIdToOperation map.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
28fa7a5783 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java e802d42a4d 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 443be545d4 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
2c55011d71 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  service/src/java/org/apache/hive/service/cli/CLIService.java 689b948a87 
  service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java 
43fbb00e32 
  service/src/java/org/apache/hive/service/cli/ICLIService.java 9f2039c971 
  service/src/java/org/apache/hive/service/cli/operation/OperationManager.java 
46f524d17d 
  service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java 
906565c1ce 
  service/src/java/org/apache/hive/service/cli/session/SessionManager.java 
50826890da 
  
service/src/java/org/apache/hive/service/cli/thrift/RetryingThriftCLIServiceClient.java
 0e76c91520 
  service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java 
9880fc6082 
  
service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java 
617bc40952 
  service/src/java/org/apache/hive/service/server/HiveServer2.java e5f449122b 
  
service/src/test/org/apache/hive/service/cli/session/TestSessionManagerMetrics.java
 efc2e1a9d6 


Diff: 

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-25 Thread Teddy Choi


> On 9 24, 2017, 12:18 오전, Thejas Nair wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/Driver.java
> > Line 718 (original)
> > 
> >
> > KILL_QUERY shoudl also not need any txn to be started. Why remove it 
> > from here ?

It was removed by mistake during Hive 1 port. I'll revert it.


> On 9 24, 2017, 12:18 오전, Thejas Nair wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
> > Line 3041 (original), 3041 (patched)
> > 
> >
> > Why the change in log message ? the use of "{}" is preferred as it 
> > doesn't involve string concatenation if that log level isn't enabled.

Hive 1 doesn't support {} notation. It's more compatible code for Hive 1, 2, 3.


> On 9 24, 2017, 12:18 오전, Thejas Nair wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
> > Line 2582 (original), 2583 (patched)
> > 
> >
> > Is there a problem if we call the authorization method even if 
> > hs2Hostname is null ?
> > It seems safer secuirty practise to make the authorization call even if 
> > the hs2Hostname is null for some reason.

A null hs2HostName throws NPE while putting the name in a map. I will find 
other way to handle a null name.


> On 9 24, 2017, 12:18 오전, Thejas Nair wrote:
> > service/src/java/org/apache/hive/service/cli/CLIService.java
> > Lines 614 (patched)
> > 
> >
> > any reason for this change ? QueryState seems to provide a good 
> > abstraction for queryId

Hive 1 doesn't have QueryState. It's more compatible code for Hive 1, 2, 3.


> On 9 24, 2017, 12:18 오전, Thejas Nair wrote:
> > service/src/java/org/apache/hive/service/cli/operation/OperationManager.java
> > Line 63 (original)
> > 
> >
> > why revert this approach of tracking the mapping using the hashmap ? 
> > That looks like more optimized route and cleaner as well.

It was removed by mistake during Hive 1 port. I'll revert it.


- Teddy


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review186067
---


On 9 23, 2017, 7:53 오전, Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated 9 23, 2017, 7:53 오전)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
> 28fa7a5783 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   metastore/src/gen/thrift/gen-py/__init__.py e69de29bb2 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 6616cba7d1 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ad5b3a3098 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java 

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-23 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review186067
---




ql/src/java/org/apache/hadoop/hive/ql/Driver.java
Line 718 (original)


KILL_QUERY shoudl also not need any txn to be started. Why remove it from 
here ?



ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
Line 3041 (original), 3041 (patched)


Why the change in log message ? the use of "{}" is preferred as it doesn't 
involve string concatenation if that log level isn't enabled.



ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
Line 2582 (original), 2583 (patched)


Is there a problem if we call the authorization method even if hs2Hostname 
is null ?
It seems safer secuirty practise to make the authorization call even if the 
hs2Hostname is null for some reason.



service/src/java/org/apache/hive/service/cli/CLIService.java
Lines 614 (patched)


any reason for this change ? QueryState seems to provide a good abstraction 
for queryId



service/src/java/org/apache/hive/service/cli/operation/OperationManager.java
Line 63 (original)


why revert this approach of tracking the mapping using the hashmap ? That 
looks like more optimized route and cleaner as well.


- Thejas Nair


On Sept. 23, 2017, 7:53 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 23, 2017, 7:53 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
> 28fa7a5783 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   metastore/src/gen/thrift/gen-py/__init__.py e69de29bb2 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 6616cba7d1 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ad5b3a3098 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
>   
> 

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-23 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 23, 2017, 7:53 오전)


Review request for hive.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
28fa7a5783 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  metastore/src/gen/thrift/gen-py/__init__.py e69de29bb2 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java 6616cba7d1 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ad5b3a3098 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
251decac9b 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
  ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
  ql/src/test/results/clientnegative/authorization_kill_query.q.out 
PRE-CREATION 
  ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdReq.java
 PRE-CREATION 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdResp.java
 PRE-CREATION 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  service/src/java/org/apache/hive/service/cli/CLIService.java 689b948a87 
  service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java 
43fbb00e32 
  service/src/java/org/apache/hive/service/cli/ICLIService.java 9f2039c971 
  

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-20 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review185828
---




service/src/java/org/apache/hive/service/server/KillQueryImpl.java
Lines 39 (patched)


the tool or user might not know which HS2 instance has query id, it is 
possible that this one doesn't have it. The current code can result in an NPE.
It would be better to just log that information and return.


- Thejas Nair


On Sept. 20, 2017, 9:24 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 20, 2017, 9:24 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
> 28fa7a5783 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   itests/src/test/resources/testconfiguration.properties d472bb3f9e 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 714ea1f3fd 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
>   
> ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
>  1a89eb1263 
>   ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
>   ql/src/test/results/clientnegative/authorization_kill_query.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
>   service-rpc/if/TCLIService.thrift 976ca9b6b3 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp 874a81bf6b 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 
> 5d7caf9783 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
>   
> service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
>  6dba0512b4 
>   
> 

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-20 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 20, 2017, 9:24 오전)


Review request for hive.


Changes
---

6th patch applied all of Thejas' feedbacks and added a unit test for LLAP.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniLlap.java 
28fa7a5783 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  itests/src/test/resources/testconfiguration.properties d472bb3f9e 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 714ea1f3fd 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
251decac9b 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 97c8124293 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
  ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
  ql/src/test/results/clientnegative/authorization_kill_query.q.out 
PRE-CREATION 
  ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp 874a81bf6b 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdReq.java
 PRE-CREATION 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdResp.java
 PRE-CREATION 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb 2772170d2e 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-20 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review185775
---




jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
Lines 42 (patched)


I think it would be cleaner if new instance of ZooKeeperHiveClientHelper 
doesn't have to be created.
The lifetime of these objects is only until the 'public' methods of this 
api is invoked, so it would be good to have configureConnParams and 
getDirectParamsList as static methods.

Maybe break up preConfigureConnParams into two methods (getZkClient and 
getServerHosts);
ie 
void configureConnParams(JdbcConnectionParams connParams) throws 
ZooKeeperHiveClientException {
try {
  CuratorFramework zooKeeperClient = getZkClient(connParams);
List serverHosts = getServerHosts(zooKeeperClient);
..
..


- Thejas Nair


On Sept. 20, 2017, 12:31 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 20, 2017, 12:31 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscovery.java 
> b153679dc8 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   itests/src/test/resources/testconfiguration.properties d472bb3f9e 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
>   
> ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
>  1a89eb1263 
>   ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
>   ql/src/test/results/clientnegative/authorization_kill_query.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
>   service-rpc/if/TCLIService.thrift 976ca9b6b3 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
>   

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-20 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review185774
---




service/src/java/org/apache/hive/service/cli/operation/OperationManager.java
Line 218 (original), 222 (patched)


it would be cleaner to just call removeOperation instead of following - 

handleToOperation.remove(operationHandle, operation);
  queryIdToOperation.remove(operation.getQueryState().getQueryId(), 
operation);
  if (operation instanceof SQLOperation) {
removeSafeQueryInfo(operationHandle);
  }
  return operation;
}



jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
Lines 122 (patched)


can you remove these whitespaces that show up as red


- Thejas Nair


On Sept. 20, 2017, 12:31 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 20, 2017, 12:31 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscovery.java 
> b153679dc8 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   itests/src/test/resources/testconfiguration.properties d472bb3f9e 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
>   
> ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
>  1a89eb1263 
>   ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
>   ql/src/test/results/clientnegative/authorization_kill_query.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
>   service-rpc/if/TCLIService.thrift 976ca9b6b3 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp 874a81bf6b 
>   

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-19 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review185762
---




jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
Lines 40 (patched)


this is used only in preConfigureConnParams, doesn't need to be a class 
variable



jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
Lines 41 (patched)


this is used only in preConfigureConnParams, doesn't need to be a class 
variable



jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
Line 73 (original), 73 (patched)


maybe call it updateParamsWithZKServerNode ?



jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
Lines 131 (patched)


applyFromServerNode can call 
directConnParams.setCurrentHostZnodePath(serverNode)  instead of it being 
called from outside right before it, as it is part of the setup for a specific 
zk node that got picked.


- Thejas Nair


On Sept. 20, 2017, 12:31 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 20, 2017, 12:31 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscovery.java 
> b153679dc8 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   itests/src/test/resources/testconfiguration.properties d472bb3f9e 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
>   
> ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
>  1a89eb1263 
>   ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
>   ql/src/test/results/clientnegative/authorization_kill_query.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
>   

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-19 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 20, 2017, 12:31 오전)


Review request for hive.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscovery.java 
b153679dc8 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  itests/src/test/resources/testconfiguration.properties d472bb3f9e 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
251decac9b 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
  ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
  ql/src/test/results/clientnegative/authorization_kill_query.q.out 
PRE-CREATION 
  ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp 874a81bf6b 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdReq.java
 PRE-CREATION 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdResp.java
 PRE-CREATION 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb 2772170d2e 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  service/src/java/org/apache/hive/service/cli/CLIService.java 689b948a87 
  

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-19 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review185756
---




jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
Lines 130 (patched)


unused. remove ?



jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
Lines 132 (patched)


unused. remove ?



jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
Lines 633 (patched)


Add a comment that this is internal api to be used for testing ?
You can use @VisibleForTesting annotation.


- Thejas Nair


On Sept. 19, 2017, 9:28 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 19, 2017, 9:28 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscovery.java 
> b153679dc8 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   itests/src/test/resources/testconfiguration.properties d472bb3f9e 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
>   
> ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
>  1a89eb1263 
>   ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
>   ql/src/test/results/clientnegative/authorization_kill_query.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
>   service-rpc/if/TCLIService.thrift 976ca9b6b3 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp 874a81bf6b 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 
> 5d7caf9783 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
>   service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp 

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-19 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review185753
---




itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java
Lines 1452 (patched)


the fail, assert etc from this thread would not cause the test to actually 
fail.
Only fail/asserts etc in main test method thread would have an impact.
See 
https://stackoverflow.com/questions/2596493/junit-assert-in-thread-throws-exception

Maybe just capture it and validate using uncaughtexceptionhandler ?



itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java
Lines 1460 (patched)


lets call it "killing the query" and name the thread tKill



itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java
Lines 1465 (patched)


time mentioned in the comment is incorrect. maybe just remove the comment, 
the next line is quite obvious.



itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java
Lines 1473 (patched)


let the exception propogate to uncaughtexceptionhandler ?


- Thejas Nair


On Sept. 19, 2017, 9:28 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 19, 2017, 9:28 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscovery.java 
> b153679dc8 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   itests/src/test/resources/testconfiguration.properties d472bb3f9e 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
>   jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
> 8d6003ad06 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
>   
> ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
>  1a89eb1263 
>   ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
>   

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-19 Thread Teddy Choi

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/
---

(Updated 9 19, 2017, 9:28 오전)


Review request for hive.


Changes
---

Fixed query ID management.


Bugs: HIVE-17483
https://issues.apache.org/jira/browse/HIVE-17483


Repository: hive-git


Description
---

For administrators, it is important to be able to kill queries if required. 
Currently, there is no clean way to do it.
It would help to have a "kill query " command that can be run using 
odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
running in that instance.
Authorization will have to be done to ensure that the user that is invoking the 
API is allowed to perform this action.
In case of SQL std authorization, this would require admin role.


Diffs (updated)
-

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
4a9af80fdc 
  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscovery.java 
b153679dc8 
  
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
 e8051e40f2 
  itests/src/test/resources/testconfiguration.properties d472bb3f9e 
  jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
  jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
  jdbc/src/java/org/apache/hive/jdbc/Utils.java bfae8b9e41 
  jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 8d6003ad06 
  ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
  ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
251decac9b 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
553dd64b5f 
  ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
  ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
  ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
 04e5565506 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
 3af97ea02f 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
 41983f1b4c 
  
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
 da99972e0c 
  ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
  
ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
 1a89eb1263 
  ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
  ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
  ql/src/test/results/clientnegative/authorization_kill_query.q.out 
PRE-CREATION 
  ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
  service-rpc/if/TCLIService.thrift 976ca9b6b3 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.h 5fd423da6e 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp 3597d44f2d 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp 874a81bf6b 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp 5d7caf9783 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h cb62db00ea 
  service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp ec3f066516 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
 6dba0512b4 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdReq.java
 PRE-CREATION 
  
service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetQueryIdResp.java
 PRE-CREATION 
  service-rpc/src/gen/thrift/gen-php/TCLIService.php d283145b69 
  service-rpc/src/gen/thrift/gen-php/Types.php f34a0cf30a 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote 62b87a35cc 
  service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py 35f2ae47c7 
  service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py acc8c3a1b6 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb a50fe259f7 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb 2772170d2e 
  service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb 6695aee298 
  service/src/java/org/apache/hive/service/cli/CLIService.java 689b948a87 
  

Re: Review Request 62373: [HIVE-17483] HS2 kill command to kill queries using query id

2017-09-18 Thread Thejas Nair

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62373/#review185634
---




itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java
Lines 1425 (patched)


remove ?



itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java
Lines 1439 (patched)


parallel statement execution within same connection can have issues. Better 
to use 2nd connection for kill query



jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
Lines 181 (patched)


Can we re-use methods used by regular HiveConnection constructor code path 
to get the list of URLS ?

The duplication of code to read from ZK again here can be a maintainence 
problem.



service/src/java/org/apache/hive/service/cli/operation/OperationManager.java
Lines 386 (patched)


maintaining a hashmap of queryid to operation will help with performance, 
and also the case of killing from same connection.


- Thejas Nair


On Sept. 18, 2017, 4:57 a.m., Teddy Choi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62373/
> ---
> 
> (Updated Sept. 18, 2017, 4:57 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-17483
> https://issues.apache.org/jira/browse/HIVE-17483
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> For administrators, it is important to be able to kill queries if required. 
> Currently, there is no clean way to do it.
> It would help to have a "kill query " command that can be run using 
> odbc/jdbc against a HiveServer2 instance, to kill a query with that queryid 
> running in that instance.
> Authorization will have to be done to ensure that the user that is invoking 
> the API is allowed to perform this action.
> In case of SQL std authorization, this would require admin role.
> 
> 
> Diffs
> -
> 
>   itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java 
> 1108934df2 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java 
> 4a9af80fdc 
>   
> itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestServiceDiscoveryWithMiniHS2.java
>  e8051e40f2 
>   itests/src/test/resources/testconfiguration.properties d472bb3f9e 
>   jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java 1311d2d88c 
>   jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java c6bd41feb7 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 4e7c80f184 
>   ql/src/java/org/apache/hadoop/hive/ql/QueryState.java fa7c32386b 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 8aa2d90b76 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java 131c1e1bb5 
>   ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java da8c1e2305 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 251decac9b 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b5792ac485 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 429e0d995a 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 003e09fd13 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java 
> 553dd64b5f 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java 2b9e897a54 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java e1f1f53c3c 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/KillQueryDesc.java PRE-CREATION 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationUtils.java
>  04e5565506 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HiveOperationType.java
>  3af97ea02f 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java
>  41983f1b4c 
>   
> ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
>  da99972e0c 
>   ql/src/java/org/apache/hadoop/hive/ql/session/KillQuery.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/NullKillQuery.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java 8b64407d53 
>   
> ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java
>  1a89eb1263 
>   ql/src/test/queries/clientnegative/authorization_kill_query.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/kill_query.q PRE-CREATION 
>   ql/src/test/results/clientnegative/authorization_kill_query.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/llap/kill_query.q.out PRE-CREATION 
>   service-rpc/if/TCLIService.thrift 976ca9b6b3 
>