tdfs4ds.utils.storage¶
tdfs4ds.utils.storage
¶
Backing-table storage selection for TimeManager / FilterManager.
On Vantage Cloud Lake (VCL), a tdstone2 model run via the Apply backend scores on
the Analytical Compute Cluster (ACC), which reads its dataset from the Object File System
(OFS). Passing storage='OFS' to a manager constructor makes that manager's hidden
table be created on OFS (MAP = TD_MAP2, STORAGE = TD_OFSSTORAGE) instead of the default
block storage. The choice is per manager (a constructor argument, never a global) so
block-storage (full primary cluster) processes and OFS/Apply processes can coexist in the
same session.
Making an Apply-scored view that references a manager work on the ACC needs TWO things (confirmed live on VCL):
- The manager table on OFS —
storage='OFS'here, so the ACC can read it. A block-storage manager table read by an ACC query raises Error 6881 ("Query is not eligible to run on Analytical Compute Cluster"). - The filter referenced as a JOIN, not a correlated scalar subquery. The ACC
rejects
... WHERE d <= (SELECT BUSINESS_DATE FROM <tm_view>)with 6881, but accepts a JOIN to the manager view. Authoring the filter as a JOIN is the user's responsibility — it is a property of the scoring/feature view's SQL, not of the manager. (A hard-coded literal also passes, but a JOIN keeps the reference dynamic so time-travel viaupdate()still works.)
So storage='OFS' is necessary but not sufficient on its own: OFS + JOIN scores;
OFS + scalar subquery still 6881s. For a view that reads an OFS table directly (no
subquery), storage='OFS' is all that's needed.
Backward compatibility: the default (storage=None) emits no storage clause at all —
byte-identical DDL to previous versions.
_DEFAULT_ALIASES
module-attribute
¶
ACC_6881_HINT
module-attribute
¶
ACC_6881_HINT = "Error 6881 (not eligible for the Analytical Compute Cluster): for a tdstone2-Apply view that references a TimeManager/FilterManager, TWO things are needed — (a) the manager table on OFS (storage='OFS'), so the ACC can read it, AND (b) the filter written as a JOIN to the manager view, NOT a correlated scalar subquery '(SELECT BUSINESS_DATE FROM <view>)', which the ACC rejects. OFS + JOIN scores; OFS + scalar subquery still 6881s. The filter shape is the user's responsibility. Also: run the model's score() BEFORE upload_features — roll_out/run() cannot drive an Apply model (its ingestion CTAS also hits 6881)."
resolve_storage
¶
Normalize a storage selector to 'OFS' or None (system default).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage
|
|
required |
Returns:
| Type | Description |
|---|---|
|
|
|
|
Unknown values fall back to |
storage_clause
¶
Return the CREATE TABLE options fragment for the requested storage.
The fragment is inserted immediately after the table name, e.g.::
CREATE TABLE db.tbl{storage_clause(...)} ( ... ) PRIMARY INDEX (...)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage
|
storage selector (see :func: |
required | |
ofs_map
|
the map paired with |
DEFAULT_OFS_MAP
|
Returns:
| Type | Description |
|---|---|
|
|
|
|
|
is_acc_ineligible_error
¶
True if exc looks like a Teradata ACC-ineligibility error (6881).