Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

partition by literal in window function #1027

Closed
jackylee-ch opened this issue Jul 18, 2022 · 0 comments
Closed

partition by literal in window function #1027

jackylee-ch opened this issue Jul 18, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@jackylee-ch
Copy link
Contributor

Describe the bug
We met this problem with literal in window function.

java.lang.ClassCastException: org.apache.spark.sql.catalyst.expressions.Literal cannot be cast to org.apache.spark.sql.catalyst.expressions.AttributeReference
	at com.intel.oap.execution.ColumnarWindowExec.$anonfun$doExecuteColumnar$4(ColumnarWindowExec.scala:270)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
	at scala.collection.TraversableLike.map(TraversableLike.scala:237)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:230)
	at scala.collection.AbstractTraversable.map(Traversable.scala:108)
	at com.intel.oap.execution.ColumnarWindowExec.$anonfun$doExecuteColumnar$1(ColumnarWindowExec.scala:270)
	at com.intel.oap.execution.ColumnarWindowExec.$anonfun$doExecuteColumnar$1$adapted(ColumnarWindowExec.scala:236)
	at org.apache.spark.rdd.RDD.$anonfun$mapPartitionsWithIndex$2(RDD.scala:915)

To Reproduce

create table test(a string, b string) using parquet;
select col_lit, b, row_number() over (partition by col_lit, a order by int(b) asc) as c
from (select "abc" as col_lit, a, b from test)

Expected behavior
None exception thrown.

Additional context
None

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants