Understanding Data Loading and Data Function Execution Order in Spotfire Analysis.

book

Article ID: KB0138616

calendar_today

Updated On:

Products Versions
Spotfire All

Description

When opening a Spotfire analysis (DXP) containing different types of data sources and data functions, their execution order is determined by their type and any defined dependencies.

Scenario 1: Non-Embedded Data Tables and Independent Auto-Updating Data Functions

  • Symptoms: An analysis contains multiple non-embedded data tables and an independent Python data function (configured for automatic updates and not dependent on any of the data tables). When the analysis opens, the data function executes only after all primary data tables have fully loaded.
  • Cause: This behavior is by design. Spotfire prioritizes the full loading of primary data tables before executing independent data functions set to update automatically upon opening the analysis.
  • Parallel Loading Option: The "Parallel Data Loading" option in Spotfire affects whether the primary data tables load simultaneously. However, it does not alter the relative execution order between the data tables and an independent data function. In both parallel and sequential loading modes for data tables, the independent data function will run after all data tables have completed loading.

Scenario 2: Independent On-Demand Data Tables and Independent Auto-Updating Data Functions

  • Symptoms: An analysis contains an on-demand data table (set to automatic loading) and an independent data function (set to automatic execution). Neither component depends on the other. It is unclear which component initiates or completes first when opening the DXP.
  • Cause: In this scenario, both the on-demand data loading and the data function execution are initiated in parallel and run asynchronously in the background. There is no guaranteed order for which operation starts or finishes first.

Scenario 3: Dependent On-Demand Data Tables and Auto-Updating Data Functions

  • Symptoms: An analysis includes an auto-executing data function, and an on-demand data table is configured to auto-load using the output of that data function as its input. The question arises whether the data function is guaranteed to run first, and if the on-demand table always receives the latest output from the data function.
  • Cause: While the on-demand table depends on the data function's output, both the data function and the on-demand loading are initiated independently and in parallel when the analysis opens.
    • If the data function finishes first, the on-demand data table might start loading, recognize the data function's completion, and then cancel its current load and restart to use the new output.
    • If the on-demand data table finishes loading first (potentially with stale data or no data from the data function if it hadn't completed), it will then load a second time once the data function completes to ensure it receives the correct, latest output.
  • Outcome: The system ensures that the on-demand data table will ultimately retrieve the correct and latest result from the data function, even if this requires loading the data multiple times.

Key Takeaways

Understanding these behaviors helps manage expectations and design Spotfire analyses effectively:

  1. Non-Embedded Data Tables & Independent Data Functions: Always expect data functions to execute after all primary non-embedded data tables have fully loaded, irrespective of parallel loading settings.
  2. Independent On-Demand Data & Independent Data Functions: Both operations start simultaneously and run in parallel. No guaranteed start or finish order exists.
  3. Dependent On-Demand Data & Data Functions: These operations also start in parallel. Spotfire's engine ensures that on-demand data tables dependent on a data function's output will eventually receive the correct, latest data, potentially by reloading if the data function completes after the initial on-demand load.

Environment

All

Issue/Introduction

This article clarifies the execution order of various data sources, including non-embedded data tables, on-demand data tables, and data functions, when opening a Spotfire analysis. It addresses how dependencies and parallel loading options affect this behavior.

Additional Information

DOC: Configuring data functions:

DOC: Choosing how to load the data: