Skip to content
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

[GLUTEN-6600][VL] Disable date type in window range frame support #6637

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ object VeloxBackendSettings extends BackendSettingsApi {
orderSpec.foreach(
order =>
order.dataType match {
case ByteType | ShortType | IntegerType | LongType | DateType =>
case ByteType | ShortType | IntegerType | LongType =>
case _ =>
throw new GlutenNotSupportException(
"Only integral type & date type are" +
Copy link
Contributor

Choose a reason for hiding this comment

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

Update exception message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zml1206 Good catch. Updated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ class TestOperator extends VeloxWholeStageTransformerSuite with AdaptiveSparkPla
Seq("sort", "streaming").foreach {
windowType =>
withSQLConf("spark.gluten.sql.columnar.backend.velox.window.type" -> windowType) {
runQueryAndCompare(
"select max(l_partkey) over" +
" (partition by l_suppkey order by l_commitdate" +
" RANGE BETWEEN 1 PRECEDING AND CURRENT ROW) from lineitem ") {
checkSparkOperatorMatch[WindowExec]
}

runQueryAndCompare(
"select max(l_partkey) over" +
" (partition by l_suppkey order by l_orderkey" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.apache.gluten.exception.{GlutenException, GlutenNotSupportException}
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.expressions.aggregate.{AggregateExpression, AggregateFunction}
import org.apache.spark.sql.execution.aggregate._
import org.apache.spark.sql.types.{ByteType, DateType, IntegerType, LongType, ShortType}
import org.apache.spark.sql.types.{ByteType, IntegerType, LongType, ShortType}

import java.util.concurrent.atomic.AtomicInteger

Expand Down Expand Up @@ -178,8 +178,8 @@ trait PullOutProjectHelper {
protected def supportPreComputeRangeFrame(sortOrders: Seq[SortOrder]): Boolean = {
sortOrders.forall {
_.dataType match {
case ByteType | ShortType | IntegerType | LongType | DateType => true
// Only integral type & date type are supported for sort key with Range Frame
case ByteType | ShortType | IntegerType | LongType => true
// Only integral type are supported for sort key with Range Frame.
case _ => false
}
}
Expand Down
Loading