Support Questions
Find answers, ask questions, and share your expertise

Caused by: java.lang.IllegalArgumentException: Unrecognized Hadoop major version number: 3.0.0-cdh6.2.0

Caused by: java.lang.IllegalArgumentException: Unrecognized Hadoop major version number: 3.0.0-cdh6.2.0

I am getting this error while running the below code in CDH 6.2

 

import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.Row
import org.apache.spark.sql.Column
import org.apache.spark.sql.streaming.StreamingQueryException
import org.apache.spark.sql.types._
import java.io.PrintStream
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

import java.io.File

import org.apache.spark.sql.{Row, SaveMode, SparkSession}

object test3 {
def main(args: Array[String]){
val warehouseLocation = new File("spark-warehouse").getAbsolutePath

val spark = SparkSession
.builder()
.appName("Spark Hive Example")
.config("spark.sql.warehouse.dir", warehouseLocation)
.enableHiveSupport()
.getOrCreate()

import spark.implicits._
import spark.sql

sql("SELECT * FROM default.test").show()
}}