-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GLUTEN-4789] [VL] Wrong preceding/following convert in window functi…
…on node (#4788)
- Loading branch information
1 parent
8bb4969
commit 285e6d3
Showing
3 changed files
with
91 additions
and
28 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
backends-velox/src/test/scala/io/glutenproject/execution/VeloxWindowExpressionSuite.scala
This file contains 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,73 @@ | ||
/* | ||
* 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 io.glutenproject.execution | ||
|
||
import org.apache.spark.SparkConf | ||
|
||
class VeloxWindowExpressionSuite extends WholeStageTransformerSuite { | ||
|
||
protected val rootPath: String = getClass.getResource("/").getPath | ||
override protected val backend: String = "velox" | ||
override protected val resourcePath: String = "/tpch-data-parquet-velox" | ||
override protected val fileFormat: String = "parquet" | ||
|
||
override def beforeAll(): Unit = { | ||
super.beforeAll() | ||
createTPCHNotNullTables() | ||
} | ||
|
||
override protected def sparkConf: SparkConf = { | ||
super.sparkConf | ||
.set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager") | ||
.set("spark.sql.files.maxPartitionBytes", "1g") | ||
.set("spark.sql.shuffle.partitions", "1") | ||
.set("spark.memory.offHeap.size", "2g") | ||
.set("spark.unsafe.exceptionOnMemoryLeak", "true") | ||
.set("spark.sql.autoBroadcastJoinThreshold", "-1") | ||
.set("spark.sql.sources.useV1SourceList", "avro") | ||
} | ||
|
||
test("window row frame with mix preceding and following") { | ||
runQueryAndCompare( | ||
"select max(l_suppkey) over" + | ||
" (partition by l_suppkey order by l_orderkey " + | ||
"rows between 2 preceding and 1 preceding) from lineitem ") { | ||
checkOperatorMatch[WindowExecTransformer] | ||
} | ||
|
||
runQueryAndCompare( | ||
"select max(l_suppkey) over" + | ||
" (partition by l_suppkey order by l_orderkey " + | ||
"rows between 2 following and 3 following) from lineitem ") { | ||
checkOperatorMatch[WindowExecTransformer] | ||
} | ||
|
||
runQueryAndCompare( | ||
"select max(l_suppkey) over" + | ||
" (partition by l_suppkey order by l_orderkey " + | ||
"rows between -3 following and -2 following) from lineitem ") { | ||
checkOperatorMatch[WindowExecTransformer] | ||
} | ||
|
||
runQueryAndCompare( | ||
"select max(l_suppkey) over" + | ||
" (partition by l_suppkey order by l_orderkey " + | ||
"rows between unbounded preceding and 3 following) from lineitem ") { | ||
checkOperatorMatch[WindowExecTransformer] | ||
} | ||
} | ||
} |
This file contains 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 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