'How to write python foundry's code workbook
How to write this sql code in Foundry's python code workbook
SELECT DISTINCT excl_rsn_id FROM exclusion_current_1;
Solution 1:[1]
Here's how you can write that SQL statement in PySpark, using a dataset named exclusion_current_1 in Code Workbooks:
Create a Code Workbook, and choose to import the
exclusion_current_1dataset.Click the blue
New transformbutton and selectPython Codeto create a Python Transform.In the Python Transform code viewer, enter this code:
return exclusion_current_1.select("excl_rsn_id").distinct()Click the blue
Previewbutton to preview the resulting dataset.
Here is a screenshot of the final Code Workbook setup:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Adil B |

