-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-49552][PYTHON] Add DataFrame API support for new 'randstr' and 'uniform' SQL functions #48143
Closed
Closed
[SPARK-49552][PYTHON] Add DataFrame API support for new 'randstr' and 'uniform' SQL functions #48143
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d9223e5
commit
dtenedor c0a2551
respond to code review comments
dtenedor f6ffde0
respond to code review comments
dtenedor c22fef2
respond to code review comments
dtenedor c78d8f0
fix test
dtenedor 5b6194e
fix test
dtenedor da390f9
fix test
dtenedor 836ec8e
commit
dtenedor 4b41b34
commit
dtenedor 54a1a2e
respond to code review comments
dtenedor c372075
fix function description
dtenedor 515b046
fix test
dtenedor 3504124
fix test
dtenedor 0683318
respond to code review comments
dtenedor 7ec25a8
respond to code review comments
dtenedor 1f5e866
fix RandomSuite
dtenedor 8b64f33
respond to code review comments
dtenedor 0313fbe
commit
dtenedor d54eec7
sync
dtenedor 48f1dde
sync
dtenedor f496e86
commit
dtenedor 160a5f4
respond to code review comments
dtenedor 795f5a6
fix test
dtenedor 6bb123f
fix
dtenedor 05a674c
commit
dtenedor fd3262f
fix test
dtenedor 4929fbd
fix
dtenedor ef7f9e7
fix
dtenedor d95a391
respond to code review comments
dtenedor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1008,6 +1008,18 @@ def unhex(col: "ColumnOrName") -> Column: | |||||
unhex.__doc__ = pysparkfuncs.unhex.__doc__ | ||||||
|
||||||
|
||||||
def uniform( | ||||||
min: "ColumnOrName", max: "ColumnOrName", seed: Optional["ColumnOrName"] = None | ||||||
) -> Column: | ||||||
if seed is None: | ||||||
return _invoke_function_over_columns("uniform", min, max) | ||||||
else: | ||||||
return _invoke_function_over_columns("uniform", min, max, seed) | ||||||
|
||||||
|
||||||
uniform.__doc__ = pysparkfuncs.uniform.__doc__ | ||||||
|
||||||
|
||||||
def approxCountDistinct(col: "ColumnOrName", rsd: Optional[float] = None) -> Column: | ||||||
warnings.warn("Deprecated in 3.4, use approx_count_distinct instead.", FutureWarning) | ||||||
return approx_count_distinct(col, rsd) | ||||||
|
@@ -2578,6 +2590,16 @@ def regexp_like(str: "ColumnOrName", regexp: "ColumnOrName") -> Column: | |||||
regexp_like.__doc__ = pysparkfuncs.regexp_like.__doc__ | ||||||
|
||||||
|
||||||
def randstr(length: "ColumnOrName", seed: Optional["ColumnOrName"] = None) -> Column: | ||||||
dtenedor marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
if seed is None: | ||||||
return _invoke_function_over_columns("randstr", length) | ||||||
dtenedor marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
else: | ||||||
return _invoke_function_over_columns("randstr", length, seed) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, this is done. |
||||||
|
||||||
|
||||||
randstr.__doc__ = pysparkfuncs.randstr.__doc__ | ||||||
|
||||||
|
||||||
def regexp_count(str: "ColumnOrName", regexp: "ColumnOrName") -> Column: | ||||||
return _invoke_function_over_columns("regexp_count", str, regexp) | ||||||
|
||||||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is done.