-
-
Save khuyentran1401/091f7439eadbbecdb9b3ad875b30f17a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# schema: * | |
def get_median(df: pd.DataFrame) -> List[Dict[str, Any]]: | |
return [{"col1": df["col1"].median(), "col2": df["col2"].iloc[0]}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%fsql spark | |
SELECT * | |
FROM df | |
TRANSFORM PREPARTITION BY col2 USING get_median | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment