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

chore: Fix NPE when running CometTPCHQueriesList directly #285

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

advancedxy
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

When running org.apache.spark.sql.CometTPCHQueriesList directly from console/IDEA, I notice it failed with NPE. The exception track is showed as below:

Exception in thread "main" java.lang.NullPointerException
	at org.apache.spark.sql.catalyst.util.package$.resourceToBytes(package.scala:67)
	at org.apache.spark.sql.catalyst.util.package$.resourceToString(package.scala:75)
	at org.apache.spark.sql.CometTPCQueryListBase.$anonfun$runQueries$1(CometTPCQueryListBase.scala:82)
	at org.apache.spark.sql.CometTPCQueryListBase.$anonfun$runQueries$1$adapted(CometTPCQueryListBase.scala:79)
	at scala.collection.immutable.List.foreach(List.scala:431)
	at org.apache.spark.sql.CometTPCQueryListBase.runQueries(CometTPCQueryListBase.scala:79)
	at org.apache.spark.sql.CometTPCQueryListBase.runQueries$(CometTPCQueryListBase.scala:68)
	at org.apache.spark.sql.CometTPCHQueriesList$.runQueries(CometTPCHQueriesList.scala:43)
	at org.apache.spark.sql.CometTPCHQueriesList$.runSuite(CometTPCHQueriesList.scala:69)
	at org.apache.spark.sql.CometTPCQueryListBase.main(CometTPCQueryListBase.scala:59)
	at org.apache.spark.sql.CometTPCQueryListBase.main$(CometTPCQueryListBase.scala:42)
	at org.apache.spark.sql.CometTPCHQueriesList$.main(CometTPCHQueriesList.scala:43)
	at org.apache.spark.sql.CometTPCHQueriesList.main(CometTPCHQueriesList.scala)

The reason is that there's only a q1 query in the spark/src/test/resources/tpch-extended dir, loading other queries such as q2, q3 will result an NPE.

What changes are included in this PR?

Make sure only "q1" is in the tpch extended queries list.

How are these changes tested?

Manul test

@viirya viirya merged commit 5946cbc into apache:main Apr 19, 2024
28 checks passed
@viirya
Copy link
Member

viirya commented Apr 19, 2024

Merged. Thanks.

himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
* chore: Fix NPE when running CometTPCHQueriesList directly

* fix match error.
himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
* chore: Fix NPE when running CometTPCHQueriesList directly

* fix match error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants