Code Node
Most of the process nodes found in the Nodes tabbed page of the Palette include a Code tab that you can use to modify any setting applied during manual configuration.
The stand-alone Code node is used to perform activities such as importing/exporting files in SmartWorks Analytics, performing column changes, and the like without the use of other nodes in the Palette. When this node is saved and run, an object node that can be used for further work is generated. Note that knowledge of Python or PySpark, depending on the engine used (Jupyter Pandas and Jupyter Spark, respectively), is necessary to produce code with the desired output.
Prerequisites
-
An Execution Profile with an active session linked to the workflow
Steps
-
Open the Nodes tab in the Palette and then expand the Code group.
-
Drag and drop the Code node from the Palette to the Workflow Canvas.
-
Configure the node by opening the Node Viewer. You can double-click on the node or use the Open option provided in the node menu.
-
Provide the following details:
-
Type the code to be executed into the Code Editor.
-
Save the code and then click Run to execute it.
Input Property |
Description |
Input name |
The name of the input socket for the Code node |
Object name |
The name of the node connected to the socket |
Coding name |
The name of the code associated with the input operation |
Type |
The type of node connected to the socket (Apache Spark or Pandas) |
Output Property |
Description |
Output name |
The name of the output socket for the Code node |
Object name |
The name of the object node produced when the code is run |
Coding name |
The name of the code associated with the output operation |
Type |
The engine type used to execute the code (Apache Spark or Pandas) |
The code is run and the output is produced.