Uploaded image for project: 'Apache MADlib'
  1. Apache MADlib
  2. MADLIB-831

passing of composite types to UDF

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Request
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Here is a bug that the correct value is not received when passing a composite type parameter to a UDF. The symptom can be duplicated in the following steps.

      1. define an "echo" UDF: it simply returns the first parameter it receives.

      AnyType echo::run(AnyType& args)

      { return args[0]; }

      2. define sql functions:

      echo(intvec)
      echo(array of intvec)

      where intvec is defined as (x int, y int).

      3. pass intvec and array_of_intvec to echo function:

      set search_path to public,madlib;
      select * from echo('(2,1)'::intvec); – it fails
      select * from unnest(echo(array['(2,1)'::intvec, '(3,4)'::intvec]));

      The echo(intvec) failed to received the intvec parameter: what it saw is a type of intvec with null x and y fields. On the other hand, the array_of_intvec is correct: the UDF function correctly received the parameter.

      Thanks!

        Attachments

          Activity

            People

            • Assignee:
              riyer Rahul Iyer
              Reporter:
              opensrc krish

              Dates

              • Created:
                Updated:

                Issue deployment