Write code extension scripts that read a data lake object (DLO) backed by a zero-copy connector or a data model object (DMO) mapped from that DLO. Because the connector accesses data directly on its external platform, Data 360 never copies the data into local storage. Your code extension scripts perform the same custom Python transformations on zero copy data as on any other DLO or DMO in Data 360.
A zero-copy source is an external data platform that Data 360 accesses through a zero-copy connector. The connector accesses the data in place by using query federation or file federation. The available methods depend on the connector. If a connector offers both methods, select the preferred option when you set up the connection and the data stream.
To access zero-copy data in code extension scripts:
Permission set: Data Cloud Architect
Supported Zero-Copy Sources
Code extension supports reading data from these zero-copy sources.
Data Platform
Query Federation
File Federation
Snowflake
Supported
Supported
Amazon Redshift
Supported
Not supported by code extension
Databricks
Supported
Supported
Google BigQuery
Supported
Not offered by the connector
Prerequisites
Set up a supported zero-copy connector and create the federated data stream that generates the DLO. The connector documentation covers query federation and file federation setup for each platform.
Assign the zero-copy DLO to a data space that your code extension script can access. Select the data space when you create the federated data stream, or add the DLO to a data space later from the Data Spaces tab. See Add Data to a Data Space Using Data Lake Objects.
If your script reads DMOs, map the zero-copy DLO to a DMO in that data space. See Data Mapping.
Your code extension script reads a zero-copy DLO with the same read_dlo() method that it uses for any other DLO. Similarly, it reads a DMO mapped from a zero-copy DLO with the same method that it uses for other DMOs. Whether the connector federates the data from the zero-copy source or a data stream ingests it into Data 360, your Python code requires no special configuration.
Your script can read and join multiple DLOs. For example, join a zero-copy DLO with a DLO ingested from Salesforce CRM via a data stream. You can perform the same action with multiple DMOs. A single script works with either DLOs or DMOs, but not both. Your script writes results to a target DLO or DMO in Data 360, not back to the external platform.
Performance: Query performance depends on the external platform’s processing power and network latency between Data 360 and the external platform. To optimize performance, apply filters early, don’t read entire large tables when you need only a subset, and review execution logs for bottlenecks. See also Considerations When Writing Code Extension.
Platform Constraints: Connector-specific limits and behaviors apply. Check the connector documentation for your platform.
Sandbox Validation: Validate scripts that read zero-copy data in a sandbox before you migrate them to production. See Use Custom Scripts in Data 360.
Troubleshooting
If your code extension script can’t read from a zero-copy DLO, check these items.
Confirm that the zero-copy data stream is active and that authentication for the connector is valid.
Confirm that the zero-copy DLO, or the DMO mapped from it, is added to the specific data space that your script accesses.
Confirm that the source table still exists on your external platform and that your connector credentials have read access to it. For example, a Snowflake query federation connection requires USAGE privileges on the warehouse, database, and schema, and SELECT privileges on the tables in that schema. See Set Up a Snowflake Data Federation Connection.
Confirm that the source object for a file federation DLO is a table and not a view. File federation doesn’t support querying Apache Iceberg views. Check the file federation connection documentation for your platform.