Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-16625

Add options to control lifetime of global variables in embedded Python

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Not specified
    • Resolution: Fixed
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.2.0
    • Component/s: Plugins
    • Labels:
      None

      Description

      It is sometimes useful to be able to set up global variables in embedded Python code that persist from one call to the next, or which are set in one embedded function and read in another.

      Proposed syntax is:

      EMBED(Python: globalscope('load.ecl'),persist('query'))

      The parameter to globalscope names a scope that allows separate embed functions to control that they will share with only certain other embed functions

      The parameter to persist indicates the lifetime and scope of the shared globals, and can be 'query', 'global' or 'workunit'
      'query' means until the query finishes - other instances of the same query running at the same time will have independent versions of the globals.
      'workunit' means until the workunit is unloaded (the same as 'query' except on Roxie)
      'global' means indefinitely, shared by all workunits, until the engine next restarts (for eclagent this is the same as 'workunit').

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              richardkchapman Richard Chapman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: