Reputation: 15
How to write this sql code in Foundry's python code workbook
SELECT DISTINCT excl_rsn_id FROM exclusion_current_1;
Upvotes: 1
Views: 421
Reputation: 16856
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_1
dataset.
Click the blue New transform
button and select Python Code
to 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 Preview
button to preview the resulting dataset.
Here is a screenshot of the final Code Workbook setup:
Upvotes: 0