Repository navigation
[SPARK-46913][SS] Add support for processing/event time based timers with transformWithState operator #45051
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
Closed
Closed
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
0683d51
[SPARK-46913] Timer related implementation for transformWithState ope…
anishshri-db 5494f23
Misc updates
anishshri-db 709013a
Merge branch 'master' into task/SPARK-46913
anishshri-db 6a81f49
Test changes
anishshri-db 04896ca
Merge branch 'master' into task/SPARK-46913
anishshri-db 427cdba
Merge branch 'master' into task/SPARK-46913
anishshri-db a72a64d
Misc updates
anishshri-db 7799319
[SPARK-46979] Add support for specifying key and value encoder separa…
anishshri-db 5b356fd
Misc fix
anishshri-db 89e1e15
Change to address Bhuwan's comments
anishshri-db e2833ed
Misc fixes
anishshri-db eae2dc2
Misc updates
anishshri-db f2b7d17
Added tests
anishshri-db 2f06795
Merge branch 'master' into task/SPARK-46913
anishshri-db ade22ae
Merge branch 'master' into task/SPARK-46913
anishshri-db d55d40c
Misc changes
anishshri-db 9f3e809
Misc updates
anishshri-db ede1db1
Misc updates
anishshri-db fd0db3a
Misc updates
anishshri-db 29e4427
Misc fix
anishshri-db 6b83aaf
Fix nerf error
anishshri-db fcc7a33
Misc test addition
anishshri-db e3da877
Change to address Bhuwan's comments
anishshri-db d18d2b8
Change to address Bhuwan's comments
anishshri-db 6018c73
Fix test case
anishshri-db 7c6d6d5
Merge branch 'master' into task/SPARK-46913
anishshri-db 7b26daf
Change to address Jungtaeks' comments
anishshri-db 145e041
Address Jungtaek's comments
anishshri-db 88e20f4
Misc updates
anishshri-db ea356a0
Fix misc issues
anishshri-db 5efa1f7
Merge branch 'master' into task/SPARK-46913
anishshri-db 65e58f5
Misc updates
anishshri-db 436181f
Add unit test
anishshri-db b2032fd
Add unit test
anishshri-db d83fdb0
Merge branch 'master' into task/SPARK-46913
anishshri-db f46063a
Remove redundant error class
anishshri-db a139c5f
Fix misc issues
anishshri-db b311787
Misc fix
anishshri-db 4649b8d
Add note around usage of listTimers
anishshri-db 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 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
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
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
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
40 changes: 40 additions & 0 deletions
40
sql/api/src/main/scala/org/apache/spark/sql/streaming/ExpiredTimerInfo.scala
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.sql.streaming | ||
|
|
||
| import java.io.Serializable | ||
|
|
||
| import org.apache.spark.annotation.{Evolving, Experimental} | ||
|
|
||
| /** | ||
| * Class used to provide access to expired timer's expiry time. These values | ||
| * are only relevant if the ExpiredTimerInfo is valid. | ||
| */ | ||
| @Experimental | ||
| @Evolving | ||
| private[sql] trait ExpiredTimerInfo extends Serializable { | ||
| /** | ||
| * Check if provided ExpiredTimerInfo is valid. | ||
| */ | ||
| def isValid(): Boolean | ||
|
|
||
| /** | ||
| * Get the expired timer's expiry time as milliseconds in epoch time. | ||
| */ | ||
| def getExpiryTimeInMs(): Long | ||
| } |
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
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
36 changes: 36 additions & 0 deletions
36
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ExpiredTimerInfoImpl.scala
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.spark.sql.execution.streaming | ||
|
|
||
| import org.apache.spark.sql.streaming.{ExpiredTimerInfo, TimeoutMode} | ||
|
|
||
| /** | ||
| * Class that provides a concrete implementation that can be used to provide access to expired | ||
| * timer's expiry time. These values are only relevant if the ExpiredTimerInfo | ||
| * is valid. | ||
| * @param isValid - boolean to check if the provided ExpiredTimerInfo is valid | ||
| * @param expiryTimeInMsOpt - option to expired timer's expiry time as milliseconds in epoch time | ||
| */ | ||
| class ExpiredTimerInfoImpl( | ||
| isValid: Boolean, | ||
| expiryTimeInMsOpt: Option[Long] = None, | ||
| timeoutMode: TimeoutMode = TimeoutMode.NoTimeouts()) extends ExpiredTimerInfo { | ||
|
|
||
| override def isValid(): Boolean = isValid | ||
|
|
||
| override def getExpiryTimeInMs(): Long = expiryTimeInMsOpt.getOrElse(-1L) | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.