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

HPL/SQL function variable block is not initialized

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: hpl/sql
    • Labels:
      None

      Description

      Variable inside declaration block are not initialized:

      CREATE FUNCTION test1()
        RETURNS STRING
      AS
        ret string DEFAULT 'Initial value';
      BEGIN
        print(ret);
        ret := 'VALUE IS SET';
        print(ret);
      END;
      
      test1();
      

      Output:

      ret      
      VALUE IS SET
      

      Should be:

      Initial value     
      VALUE IS SET
      

        Attachments

        1. HIVE-17452.1.patch
          4 kB
          Dmitry Tolpeko

          Activity

            People

            • Assignee:
              dmtolpeko Dmitry Tolpeko
              Reporter:
              dmtolpeko Dmitry Tolpeko
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: