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

[NSE-384] "Select count(*)" without group by results in error: java.lang.IllegalArgumentException: not all nodes and buffers were consumed #385

Merged
merged 2 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -190,7 +190,7 @@ class ArrowDataSourceTest extends QueryTest with SharedSparkSession {
frame2.createOrReplaceTempView("ptab2")
val sqlFrame2 = spark.sql("select * from ptab2")

verifyFrame(sqlFrame2, 3, 1)
verifyFrame(sqlFrame2, 3, 2)
}

test("simple SQL query on parquet file with pushed filters") {
Expand Down Expand Up @@ -243,6 +243,17 @@ class ArrowDataSourceTest extends QueryTest with SharedSparkSession {
}
}

test("count(*) without group by v2") {
val path = ArrowDataSourceTest.locateResourcePath(parquetFile1)
val frame = spark.read
.option(ArrowOptions.KEY_ORIGINAL_FORMAT, "parquet")
.arrow(path)
frame.createOrReplaceTempView("ptab")
val df = sql("SELECT COUNT(*) FROM ptab")
checkAnswer(df, Row(5) :: Nil)

}

test("file descriptor leak") {
val path = ArrowDataSourceTest.locateResourcePath(parquetFile1)
val frame = spark.read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ class TPCDSSuite extends QueryTest with SharedSparkSession {
df.explain()
df.show()
}

test("count() without group by") {
val df = spark.sql("SELECT count(*) as cnt FROM " +
"item LIMIT 100")
df.explain()
df.show()
}
}

object TPCDSSuite {
Expand Down