Prerequisites
- Analytic compute group. See Setting Up VantageCloud Lake for Open Analytics .
- You need permission to use :
- Compute cluster.
- APPLY table operator.
- Environment (based on Python). See User Environments .
- Pretrained model and Python program.
- Third-party Python libraries and dependencies.
- Files and dependencies confirmation uploaded.
In the following example, the user runs the APPLY table operator query.
.logon youruser SELECT * FROM APPLY ( ON dataset RETURNS (prediction_y float); USING STYLE('csv') ENVIRONMENT ('myenvironment') APPLY_COMMAND('python myscript.py') ) as dt; .logoff youruser
- The user specifies the dataset table as input to the APPLY_COMMAND. The output schema of the table operator is a single float column named "prediction_y".
- Each AMP in the analytic compute group runs the APPLY_COMMAND with their partition of the "dataset" table.
- The environment clause specifies the name of the environment created previously. The "youruser" database user must have an environment called "myenvironment".