Skip to content

Commit f6edcef

Browse files
author
Ghislain Fourny
committed
Improve error messages.
1 parent da067d7 commit f6edcef

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/jsoniq/session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ def getOrCreate(self):
8888
sys.stderr.write("[Error] Could not determine Spark version. The SPARK_HOME environment variable may not be set properly. Please check that it points to a valid path to a Spark 4.0 directory, or maybe the easiest would be to delete the environment variable SPARK_HOME completely to fall back to the installation of Spark 4.0 packaged with pyspark.\n")
8989
sys.stderr.write(f"Current value of SPARK_HOME: {os.environ.get('SPARK_HOME')}\n")
9090
sys.exit(43)
91-
elif not spark_version.startswith("4.0"):
91+
elif not os.environ.get('SPARK_HOME') is None and not spark_version.startswith("4.0"):
9292
sys.stderr.write(f"[Error] RumbleDB requires Spark 4.0, but found version {spark_version}. Please either set SPARK_HOME to a Spark 4.0 directory, or maybe the easiest would be to delete the environment variable SPARK_HOME completely to fall back to the installation of Spark 4.0 packaged with pyspark.\n")
9393
sys.exit(43)
9494
else:
95+
sys.stderr.write(f"[Error] SPARK_HOME is not set, but somehow pyspark is not falling back to the packaged Spark 4.0.0 version.\n")
96+
sys.stderr.write(f"We would appreciate a bug report with some information about your OS, setup, etc.\n")
97+
sys.stderr.write(f"In the meantime, what you could do as a workaround is download the Spark 4.0.0 zip file from spark.apache.org, unzip it to some local directory, and point SPARK_HOME to this directory.\n")
9598
raise e
9699
return RumbleSession._rumbleSession
97100

0 commit comments

Comments
 (0)