AngersZhuuuu commented on a change in pull request #34715:
URL: https://github.com/apache/spark/pull/34715#discussion_r762498266
##########
File path: python/pyspark/install.py
##########
@@ -83,7 +86,23 @@ def checked_versions(spark_version, hadoop_version,
hive_version):
"one of [%s]" % (hive_version, ",
".join(SUPPORTED_HADOOP_VERSIONS))
)
- return spark_version, hadoop_version, hive_version
+ return spark_version, convert_old_hadoop_version(spark_version,
hadoop_version), hive_version
+
+
+def convert_old_hadoop_version(spark_version, hadoop_version):
+ # check if Spark version < 3.2, if so, convert hadoop3 to hadoop3.2 and
hadoop2 to hadoop2.7
+ version_dict = {
+ "hadoop3": "hadoop3.2",
+ "hadoop2": "hadoop2.7",
+ "without": "without",
+ "without-hadoop": "without-hadoop",
+ }
+ spark_version_parts = re.search("^spark-([0-9]+)\\.([0-9]+)\\.[0-9]+$",
spark_version)
+ spark_major_version = int(spark_version_parts.group(1))
+ spark_minor_version = int(spark_version_parts.group(2))
+ if spark_major_version < 3 or (spark_major_version >= 3 and
spark_minor_version <= 2):
Review comment:
Yea, `==` is better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]