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

HPL/SQL function variable block is not initialized

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 3.0.0
    • hpl/sql
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dmtolpeko Dmitry Tolpeko Assign to me
            dmtolpeko Dmitry Tolpeko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment