as titled, how do I know which version of spark has been installed in the CentOS?
The current system has installed cdh5.1.0.
Most of the answers here requires initializing a sparksession. This answer provide a way to statically infer the version from library.
ammonites@ org.apache.spark.SPARK_VERSION res4: String = "2.4.5"