Skip to content

Comments

[SPARK-48272][SQL][PYTHON][CONNECT] Add function timestamp_diff#46576

Closed
zhengruifeng wants to merge 2 commits intoapache:masterfrom
zhengruifeng:df_ts_diff
Closed

[SPARK-48272][SQL][PYTHON][CONNECT] Add function timestamp_diff#46576
zhengruifeng wants to merge 2 commits intoapache:masterfrom
zhengruifeng:df_ts_diff

Conversation

@zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Add function timestamp_diff, by reusing existing proto

case "timestampdiff" if fun.getArgumentsCount == 3 =>
val children = fun.getArgumentsList.asScala.map(transformExpression)
val unit = extractString(children(0), "unit")
Some(TimestampDiff(unit, children(1), children(2)))

Why are the changes needed?

this method is missing in dataframe API due to it is not in FunctionRegistry

Does this PR introduce any user-facing change?

yes, new method

How was this patch tested?

added tests

Was this patch authored or co-authored using generative AI tooling?

no

fix

hifi test
new BloomFilterAggregate(children(0), children(1), children(2))
.toAggregateExpression())

case "timestampdiff" if fun.getArgumentsCount == 3 =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move it out of PS(Pandas API on Spark)-specific functions

@xinrong-meng
Copy link
Member

LGTM, thank you!

@zhengruifeng zhengruifeng requested a review from HyukjinKwon May 15, 2024 01:29
@zhengruifeng
Copy link
Contributor Author

thanks, merged to master

@zhengruifeng zhengruifeng deleted the df_ts_diff branch May 15, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants