[ 
https://issues.apache.org/jira/browse/SPARK-25843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reynold Xin updated SPARK-25843:
--------------------------------
    Description: 
See parent ticket for more information. Two proposals with sketches:

 
Proposal 1. create a version of rangeBetween that accepts Strings, i.e. 
rangeBetween(String, String). This is obviously very flexible, but less type 
safe.
 
Proposal 2. creates a new type called WindowFrameBoundary:
 
 
{code:java}
trait WindowFrameBoundary
 
object WindowFrameBoundary {
  def unboundedPreceding: WindowFrameBoundary
  def unboundedFollowing: WindowFrameBoundary
  def currentRow: WindowFrameBoundary
  def at(value: Long)
  def interval(interval: String)
}{code}
 
And create a new rangeBetween that accepts WindowFrameBoundary's, i.e.
 
 
{code:java}
def rangeBetween(start: WindowFrameBoundary, end: WindowFrameBoundary)  {code}
 
This is also very flexible and type safe at the same time.
 
 
Note the two are not mutually exclusive, and we can also deprecate the existing 
confusing APIs.
 
 

  was:
See parent ticket for more information. I have a rough design that I will post 
later.

 


> Redesign rangeBetween API
> -------------------------
>
>                 Key: SPARK-25843
>                 URL: https://issues.apache.org/jira/browse/SPARK-25843
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Reynold Xin
>            Assignee: Reynold Xin
>            Priority: Major
>
> See parent ticket for more information. Two proposals with sketches:
>  
> Proposal 1. create a version of rangeBetween that accepts Strings, i.e. 
> rangeBetween(String, String). This is obviously very flexible, but less type 
> safe.
>  
> Proposal 2. creates a new type called WindowFrameBoundary:
>  
>  
> {code:java}
> trait WindowFrameBoundary
>  
> object WindowFrameBoundary {
>   def unboundedPreceding: WindowFrameBoundary
>   def unboundedFollowing: WindowFrameBoundary
>   def currentRow: WindowFrameBoundary
>   def at(value: Long)
>   def interval(interval: String)
> }{code}
>  
> And create a new rangeBetween that accepts WindowFrameBoundary's, i.e.
>  
>  
> {code:java}
> def rangeBetween(start: WindowFrameBoundary, end: WindowFrameBoundary)  {code}
>  
> This is also very flexible and type safe at the same time.
>  
>  
> Note the two are not mutually exclusive, and we can also deprecate the 
> existing confusing APIs.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to