Skip to content

UDFs must not modify arguments passed by reference #9

Open

Description

@nobu-k

UDFs can receive references such as arrays or maps. However, they must not change those arguments. Add notes about this in the Server Programming part.

Activity

  1. tgpfeiffer commented on Feb 8, 2016

    @tgpfeiffer
    Contributor

    Is it safe, by the way, to return one of the input parameters as is? I imagine that if we have something like

    SELECT RSTREAM oneItem, identity(oneItem) AS anotherItem FROM ...
    

    and the identity function just returns the input parameter, is it possible that we run into trouble later when oneItem and anotherItem point to the same object?

  2. nobu-k commented on Feb 8, 2016

    @nobu-k
    MemberAuthor

    I think it should be safe.

  3. tgpfeiffer commented on Mar 11, 2016

    @tgpfeiffer
    Contributor

    Code-wise, this has been addressed by the introduction of the TFSharedData flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions