Neer393 commented on PR #5920: URL: https://github.com/apache/hive/pull/5920#issuecomment-3038538722
> Hi @Neer393, thanks for taking care of this. I know its a bad practice to put comment on closed PR but I have a question!! even after the patch, I'm still seeing the following error on HMS logs when I ran `drop scheduled query if exists drop4;`. The behaviour should be in sync with `drop database if exists` hence this error shouldn't be there IMO. > > ``` > 2025-07-05 12:50:17,362 ERROR metastore.HMSHandler: Caught exception > NoSuchObjectException(message:There is no scheduled query for: drop4@hive) > at org.apache.hadoop.hive.metastore.ObjectStore.getScheduledQuery(ObjectStore.java:14573) > at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:580) > at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:97) > at jdk.proxy2/jdk.proxy2.$Proxy26.getScheduledQuery(Unknown Source) > at org.apache.hadoop.hive.metastore.HMSHandler.get_scheduled_query(HMSHandler.java:10968) > at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:580) > at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:91) > at org.apache.hadoop.hive.metastore.AbstractHMSHandlerProxy.invoke(AbstractHMSHandlerProxy.java:82) > at jdk.proxy2/jdk.proxy2.$Proxy27.get_scheduled_query(Unknown Source) > at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_scheduled_query.getResult(ThriftHiveMetastore.java:27334) > at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_scheduled_query.getResult(ThriftHiveMetastore.java:27313) > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:38) > at org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:111) > at org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:107) > at java.base/java.security.AccessController.doPrivileged(AccessController.java:714) > at java.base/javax.security.auth.Subject.doAs(Subject.java:525) > at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1953) > at org.apache.hadoop.hive.metastore.TUGIBasedProcessor.process(TUGIBasedProcessor.java:119) > at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:250) > at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) > at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) > at java.base/java.lang.Thread.run(Thread.java:1583) > ``` @Aggarwal-Raghav After pulling the changes, do a mvn clean install and then re run the query because changes might not have been packed for your machine. I switched to a new branch where these changes were not present, tried the query ```drop scheduled query if exists drop4``` and it failed as there was no support initially. Then I pulled the changes from master and then did a mvn clean install for the whole project. After that when I executed, I get the expected fixed behaviour same as ```drop database if exists db1``` **Please have a look at all the behaviours that have been considered for dropping a non existent scheduled query using both with and without [IF EXISTS]** ``` ************* When hive.exec.drop.ignorenonexistent = true (default value) *********** 0: jdbc:hive2://localhost:10000> drop scheduled query q1; INFO : Compiling command(queryId=nkhatri_20250705013729_99e10528-650a-4b61-997f-66a7a515bb96): drop scheduled query q1 INFO : Semantic Analysis Completed (retrial = false) INFO : Created Hive schema: Schema(fieldSchemas:null, properties:null) INFO : Completed compiling command(queryId=nkhatri_20250705013729_99e10528-650a-4b61-997f-66a7a515bb96); Time taken: 0.003 seconds INFO : Concurrency mode is disabled, not creating a lock manager INFO : Executing command(queryId=nkhatri_20250705013729_99e10528-650a-4b61-997f-66a7a515bb96): drop scheduled query q1 INFO : PREHOOK: query: drop scheduled query q1 INFO : PREHOOK: type: DROP SCHEDULED QUERY INFO : POSTHOOK: query: drop scheduled query q1 INFO : POSTHOOK: type: DROP SCHEDULED QUERY INFO : Completed executing command(queryId=nkhatri_20250705013729_99e10528-650a-4b61-997f-66a7a515bb96); Time taken: 0.003 seconds DEBUG : Shutting down query drop scheduled query q1 No rows affected (3.904 seconds) 0: jdbc:hive2://localhost:10000> drop scheduled query if exists q1; INFO : Compiling command(queryId=nkhatri_20250705013801_34daf361-803b-4215-871d-8434ffd9710e): drop scheduled query if exists q1 INFO : Semantic Analysis Completed (retrial = false) INFO : Created Hive schema: Schema(fieldSchemas:null, properties:null) INFO : Completed compiling command(queryId=nkhatri_20250705013801_34daf361-803b-4215-871d-8434ffd9710e); Time taken: 0.004 seconds INFO : Concurrency mode is disabled, not creating a lock manager INFO : Executing command(queryId=nkhatri_20250705013801_34daf361-803b-4215-871d-8434ffd9710e): drop scheduled query if exists q1 INFO : PREHOOK: query: drop scheduled query if exists q1 INFO : PREHOOK: type: DROP SCHEDULED QUERY INFO : POSTHOOK: query: drop scheduled query if exists q1 INFO : POSTHOOK: type: DROP SCHEDULED QUERY INFO : Completed executing command(queryId=nkhatri_20250705013801_34daf361-803b-4215-871d-8434ffd9710e); Time taken: 0.003 seconds DEBUG : Shutting down query drop scheduled query if exists q1 No rows affected (5.028 seconds) ************* Setting hive.exec.drop.ignorenonexistent = false ************** 0: jdbc:hive2://localhost:10000> set hive.exec.drop.ignorenonexistent=false; No rows affected (0.018 seconds) ************* When hive.exec.drop.ignorenonexistent = false *********** 0: jdbc:hive2://localhost:10000> drop scheduled query q1; Error: Error while compiling statement: FAILED: SemanticException [Error 10446]: Scheduled query q1 does not exist; Query ID: nkhatri_20250705013923_8e78f607-a4b5-4188-bf39-28c10f5c482b (state=42000,code=10446) 0: jdbc:hive2://localhost:10000> drop scheduled query if exists q1; INFO : Compiling command(queryId=nkhatri_20250705013931_51768691-85a2-4e70-b660-ec95cd2f97e1): drop scheduled query if exists q1 INFO : Semantic Analysis Completed (retrial = false) INFO : Created Hive schema: Schema(fieldSchemas:null, properties:null) INFO : Completed compiling command(queryId=nkhatri_20250705013931_51768691-85a2-4e70-b660-ec95cd2f97e1); Time taken: 0.003 seconds INFO : Concurrency mode is disabled, not creating a lock manager INFO : Executing command(queryId=nkhatri_20250705013931_51768691-85a2-4e70-b660-ec95cd2f97e1): drop scheduled query if exists q1 INFO : PREHOOK: query: drop scheduled query if exists q1 INFO : PREHOOK: type: DROP SCHEDULED QUERY INFO : POSTHOOK: query: drop scheduled query if exists q1 INFO : POSTHOOK: type: DROP SCHEDULED QUERY INFO : Completed executing command(queryId=nkhatri_20250705013931_51768691-85a2-4e70-b660-ec95cd2f97e1); Time taken: 0.001 seconds DEBUG : Shutting down query drop scheduled query if exists q1 No rows affected (0.017 seconds) ``` -- 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-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org