[ https://issues.apache.org/jira/browse/HIVE-29055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
László Bodor updated HIVE-29055: -------------------------------- Description: TestHplSqlViaBeeLine#testHplSqlExitConditionHandler runs and checks stderr for the string "Exit CONDITION Handler invoked.", which is present, but only because stderr contains the query itself: [^hive_29055_stderr.log] , this output was captured from [here|https://github.com/apache/hive/blob/925df927248c1be11b84df3e8a0c3e43955e133e/itests/hive-unit/src/test/java/org/apache/hive/beeline/TestHplSqlViaBeeLine.java#L1433] tried the same with MiniHS2, exit condition handler was never invoked: {code} mvn install -Dtest=StartMiniHS2Cluster -DminiHS2.clusterType=llap -DminiHS2.conf="target/testconf/llap/hive-site.xml" -DminiHS2.run=true -DminiHS2.usePortsFromConf=true -pl itests/hive-unit -Pitests -nsu beeline -u "jdbc:hive2://localhost:10000/default;retries=30;mode=hplsql" -n $USER {code} results in: {code} 0: jdbc:hive2://localhost:10000/default> CREATE PROCEDURE p1() . . . . . . . . . . . . . . . . . . . .> BEGIN . . . . . . . . . . . . . . . . . . . .> PRINT('Exit CONDITION Handler invoked.'); . . . . . . . . . . . . . . . . . . . .> END; . . . . . . . . . . . . . . . . . . . .> DECLARE cnt_condition CONDITION; . . . . . . . . . . . . . . . . . . . .> DECLARE EXIT HANDLER FOR cnt_condition . . . . . . . . . . . . . . . . . . . .> p1(); . . . . . . . . . . . . . . . . . . . .> IF 1 <> 2 THEN . . . . . . . . . . . . . . . . . . . .> SIGNAL cnt_condition; . . . . . . . . . . . . . . . . . . . .> END IF; . . . . . . . . . . . . . . . . . . . .> / No rows affected (0.579 seconds) 0: jdbc:hive2://localhost:10000/default> {code} whereas the continue handler seems to work: {code} 0: jdbc:hive2://localhost:10000/default> DROP TABLE IF EXISTS result; . . . . . . . . . . . . . . . . . . . .> CREATE TABLE result (s string); . . . . . . . . . . . . . . . . . . . .> CREATE PROCEDURE p1() . . . . . . . . . . . . . . . . . . . .> BEGIN . . . . . . . . . . . . . . . . . . . .> INSERT INTO result VALUES('Continue CONDITION Handler invoked.'); . . . . . . . . . . . . . . . . . . . .> END; . . . . . . . . . . . . . . . . . . . .> DECLARE cnt_condition CONDITION; . . . . . . . . . . . . . . . . . . . .> DECLARE CONTINUE HANDLER FOR cnt_condition . . . . . . . . . . . . . . . . . . . .> p1(); . . . . . . . . . . . . . . . . . . . .> IF 1 <> 2 THEN . . . . . . . . . . . . . . . . . . . .> SIGNAL cnt_condition; . . . . . . . . . . . . . . . . . . . .> END IF; . . . . . . . . . . . . . . . . . . . .> SELECT * FROM result; . . . . . . . . . . . . . . . . . . . .> / ... actual work ... INFO : Continue CONDITION Handler invoked. INFO : +--------------------------------------+ | result.s | +--------------------------------------+ | Continue CONDITION Handler invoked. | +--------------------------------------+ {code} was: TestHplSqlViaBeeLine#testHplSqlExitConditionHandler runs and checks stderr for the string "Exit CONDITION Handler invoked.", which is present, but only because stderr contains the query itself: [^hive_29055_stderr.log] tried the same with MiniHS2, exit condition handler was never invoked: {code} mvn install -Dtest=StartMiniHS2Cluster -DminiHS2.clusterType=llap -DminiHS2.conf="target/testconf/llap/hive-site.xml" -DminiHS2.run=true -DminiHS2.usePortsFromConf=true -pl itests/hive-unit -Pitests -nsu beeline -u "jdbc:hive2://localhost:10000/default;retries=30;mode=hplsql" -n $USER {code} results in: {code} 0: jdbc:hive2://localhost:10000/default> CREATE PROCEDURE p1() . . . . . . . . . . . . . . . . . . . .> BEGIN . . . . . . . . . . . . . . . . . . . .> PRINT('Exit CONDITION Handler invoked.'); . . . . . . . . . . . . . . . . . . . .> END; . . . . . . . . . . . . . . . . . . . .> DECLARE cnt_condition CONDITION; . . . . . . . . . . . . . . . . . . . .> DECLARE EXIT HANDLER FOR cnt_condition . . . . . . . . . . . . . . . . . . . .> p1(); . . . . . . . . . . . . . . . . . . . .> IF 1 <> 2 THEN . . . . . . . . . . . . . . . . . . . .> SIGNAL cnt_condition; . . . . . . . . . . . . . . . . . . . .> END IF; . . . . . . . . . . . . . . . . . . . .> / No rows affected (0.579 seconds) 0: jdbc:hive2://localhost:10000/default> {code} whereas the continue handler seems to work: {code} 0: jdbc:hive2://localhost:10000/default> DROP TABLE IF EXISTS result; . . . . . . . . . . . . . . . . . . . .> CREATE TABLE result (s string); . . . . . . . . . . . . . . . . . . . .> CREATE PROCEDURE p1() . . . . . . . . . . . . . . . . . . . .> BEGIN . . . . . . . . . . . . . . . . . . . .> INSERT INTO result VALUES('Continue CONDITION Handler invoked.'); . . . . . . . . . . . . . . . . . . . .> END; . . . . . . . . . . . . . . . . . . . .> DECLARE cnt_condition CONDITION; . . . . . . . . . . . . . . . . . . . .> DECLARE CONTINUE HANDLER FOR cnt_condition . . . . . . . . . . . . . . . . . . . .> p1(); . . . . . . . . . . . . . . . . . . . .> IF 1 <> 2 THEN . . . . . . . . . . . . . . . . . . . .> SIGNAL cnt_condition; . . . . . . . . . . . . . . . . . . . .> END IF; . . . . . . . . . . . . . . . . . . . .> SELECT * FROM result; . . . . . . . . . . . . . . . . . . . .> / ... actual work ... INFO : Continue CONDITION Handler invoked. INFO : +--------------------------------------+ | result.s | +--------------------------------------+ | Continue CONDITION Handler invoked. | +--------------------------------------+ {code} > TestHplSqlViaBeeLine#testHplSqlExitConditionHandler is broken and passes > silently > --------------------------------------------------------------------------------- > > Key: HIVE-29055 > URL: https://issues.apache.org/jira/browse/HIVE-29055 > Project: Hive > Issue Type: Bug > Reporter: László Bodor > Priority: Major > Attachments: hive_29055_stderr.log > > > TestHplSqlViaBeeLine#testHplSqlExitConditionHandler runs and checks stderr > for the string "Exit CONDITION Handler invoked.", which is present, but only > because stderr contains the query itself: [^hive_29055_stderr.log] , this > output was captured from > [here|https://github.com/apache/hive/blob/925df927248c1be11b84df3e8a0c3e43955e133e/itests/hive-unit/src/test/java/org/apache/hive/beeline/TestHplSqlViaBeeLine.java#L1433] > tried the same with MiniHS2, exit condition handler was never invoked: > {code} > mvn install -Dtest=StartMiniHS2Cluster -DminiHS2.clusterType=llap > -DminiHS2.conf="target/testconf/llap/hive-site.xml" -DminiHS2.run=true > -DminiHS2.usePortsFromConf=true -pl itests/hive-unit -Pitests -nsu > beeline -u "jdbc:hive2://localhost:10000/default;retries=30;mode=hplsql" -n > $USER > {code} > results in: > {code} > 0: jdbc:hive2://localhost:10000/default> CREATE PROCEDURE p1() > . . . . . . . . . . . . . . . . . . . .> BEGIN > . . . . . . . . . . . . . . . . . . . .> PRINT('Exit CONDITION Handler > invoked.'); > . . . . . . . . . . . . . . . . . . . .> END; > . . . . . . . . . . . . . . . . . . . .> DECLARE cnt_condition CONDITION; > . . . . . . . . . . . . . . . . . . . .> DECLARE EXIT HANDLER FOR > cnt_condition > . . . . . . . . . . . . . . . . . . . .> p1(); > . . . . . . . . . . . . . . . . . . . .> IF 1 <> 2 THEN > . . . . . . . . . . . . . . . . . . . .> SIGNAL cnt_condition; > . . . . . . . . . . . . . . . . . . . .> END IF; > . . . . . . . . . . . . . . . . . . . .> / > No rows affected (0.579 seconds) > 0: jdbc:hive2://localhost:10000/default> > {code} > whereas the continue handler seems to work: > {code} > 0: jdbc:hive2://localhost:10000/default> DROP TABLE IF EXISTS result; > . . . . . . . . . . . . . . . . . . . .> CREATE TABLE result (s string); > . . . . . . . . . . . . . . . . . . . .> CREATE PROCEDURE p1() > . . . . . . . . . . . . . . . . . . . .> BEGIN > . . . . . . . . . . . . . . . . . . . .> INSERT INTO result VALUES('Continue > CONDITION Handler invoked.'); > . . . . . . . . . . . . . . . . . . . .> END; > . . . . . . . . . . . . . . . . . . . .> DECLARE cnt_condition CONDITION; > . . . . . . . . . . . . . . . . . . . .> DECLARE CONTINUE HANDLER FOR > cnt_condition > . . . . . . . . . . . . . . . . . . . .> p1(); > . . . . . . . . . . . . . . . . . . . .> IF 1 <> 2 THEN > . . . . . . . . . . . . . . . . . . . .> SIGNAL cnt_condition; > . . . . . . . . . . . . . . . . . . . .> END IF; > . . . . . . . . . . . . . . . . . . . .> SELECT * FROM result; > . . . . . . . . . . . . . . . . . . . .> / > ... > actual work > ... > INFO : Continue CONDITION Handler invoked. > INFO : > +--------------------------------------+ > | result.s | > +--------------------------------------+ > | Continue CONDITION Handler invoked. | > +--------------------------------------+ > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)