Clone Git Repo -
- git clone https://github.com/dinesh028/hbase-connectors.git
As of December 2022, the hbase-connectors releases in maven central are only available for Scala 2.11 and cannot be used with Spark 3.x
The connector has to be compiled from source for Spark 3.x, see also HBASE-25326 Allow hbase-connector to be used with Apache Spark 3.0
Build as in this example (customize HBase, Spark and Hadoop versions, as needed):
- mvn -Dspark.version=3.3.1 -Dscala.version=2.12.15 -Dscala.binary.version=2.12 -Dhbase.version=2.4.15 -Dhadoop-three.version=3.3.2 -DskipTests clean package
Use Jar with Spark -
- spark-shell --jars ~/hbase-connectors/spark/hbase-spark/target/hbase-spark*.jar
References -
- https://github.com/LucaCanali/Miscellaneous/blob/master/Spark_Notes/Spark_HBase_Connector.md
- https://kontext.tech/article/628/spark-connect-to-hbase
Similarly, do build Phoenix connector or use Cloudera Repo to download Spark3 Jar @ https://repository.cloudera.com/service/rest/repository/browse/cloudera-repos/org/apache/phoenix/phoenix5-spark3-shaded/
Comments
Post a Comment