Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-28215

Signalling CONDITION HANDLER is not working in HPLSQL.

    XMLWordPrintableJSON

Details

    Description

      Signalling CONDITION HANDLER is not working in HPLSQL.

      Refer http://www.hplsql.org/declare-condition and http://www.hplsql.org/declare-handler for more details about this feature.

       

      Steps to Reproduce:

      jdbc:hive2://ccycloud-1.nightly-71x-oq.roo> DECLARE cnt INT DEFAULT 0; 
      . . . . . . . . . . . . . . . . . . . . . . .> DECLARE wrong_cnt_condition CONDITION;
      . . . . . . . . . . . . . . . . . . . . . . .> 
      . . . . . . . . . . . . . . . . . . . . . . .> DECLARE EXIT HANDLER FOR wrong_cnt_condition
      . . . . . . . . . . . . . . . . . . . . . . .>   PRINT 'Wrong number of rows'; 
      . . . . . . . . . . . . . . . . . . . . . . .> 
      . . . . . . . . . . . . . . . . . . . . . . .> EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM sys.tbls' INTO cnt;
      . . . . . . . . . . . . . . . . . . . . . . .> 
      . . . . . . . . . . . . . . . . . . . . . . .> IF cnt <> 0 THEN
      . . . . . . . . . . . . . . . . . . . . . . .>   SIGNAL wrong_cnt_condition;
      . . . . . . . . . . . . . . . . . . . . . . .> END IF;
      . . . . . . . . . . . . . . . . . . . . . . .> /
      INFO  : Compiling command(queryId=hive_20240424171747_7f22fef6-70d5-483a-af67-7a6b9f17ac8b): SELECT COUNT(*) FROM sys.tbls
      INFO  : Semantic Analysis Completed (retrial = false)
      INFO  : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:bigint, comment:null)], properties:null)
      INFO  : Completed compiling command(queryId=hive_20240424171747_7f22fef6-70d5-483a-af67-7a6b9f17ac8b); Time taken: 0.995 seconds 
      
      INFO  : Completed executing command(queryId=hive_20240424171747_7f22fef6-70d5-483a-af67-7a6b9f17ac8b); Time taken: 8.479 seconds
      INFO  : OK
      ERROR : wrong_cnt_condition
      No rows affected (9.559 seconds)
      0: jdbc:hive2://localhost>

       

      Here when SIGNAL wrong_cnt_condition; statement is executed, it has to invoke corresponding continue/exit handlers and should execute the statements present in the handler block. But currently its not happening.

      Attachments

        Issue Links

          Activity

            People

              Dayakar Dayakar M
              Dayakar Dayakar M
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: