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

Commit

Permalink
[NSE-384] "Select count(*)" without group by results in error: java.l…
Browse files Browse the repository at this point in the history
…ang.IllegalArgumentException: not all nodes and buffers were consumed (#385)

Closes #384
  • Loading branch information
zhztheplayer authored Jul 2, 2021
1 parent 9d78656 commit 31af7a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
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

0 comments on commit 31af7a5

Please sign in to comment.