title: error in initSerDe : java.lang.ClassNotFoundException class org.apache.hive.hcatalog.data.JsonSerDe not found
body: <p>I am trying to read data from the Hive table using spark sql (scala) and it is throwing me error as  </p>
  
  <pre><code>ERROR hive.log: error in initSerDe: java.lang.ClassNotFoundException Class org.apache.hive.hcatalog.data.JsonSerDe not found
  java.lang.ClassNotFoundException: Class org.apache.hive.hcatalog.data.JsonSerDe not found
          at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2255)
          at org.apache.hadoop.hive.metastore.MetaStoreUtils.getDeserializer(MetaStoreUtils.java:392)
          at org.apache.hadoop.hive.ql.metadata.Table.getDeserializerFromMetaStore(Table.java:274)
          at org.apache.hadoop.hive.ql.metadata.Table.getDeserializer(Table.java:256)
          at org.apache.hadoop.hive.ql.metadata.Table.getCols(Table.java:607)
          at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$getTableOption$1$$anonfun$apply$7.apply(HiveClientImpl.scala:358)
          at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$getTableOption$1$$anonfun$apply$7.apply(HiveClientImpl.scala:355)
          at scala.Option.map(Option.scala:146)
  </code></pre>
  
  <p>Hive table is stored as </p>
  
  <pre><code>ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
  STORED AS INPUTFORMAT 
    'org.apache.hadoop.mapred.SequenceFileInputFormat' 
  OUTPUTFORMAT 
    'org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat'
  </code></pre>
  
  <p>I added the /opt/cloudera/parcels/CDH/lib/hive-hcatalog/share/hcatalog/hive-hcatalog-core.jar using <code>:require /opt/cloudera/parcels/CDH/lib/hive-hcatalog/share/hcatalog/hive-hcatalog-core.jar</code> and able to see Added to classpath.</p>
  
  <p>I also tried to add the JAR file in the SparkSession.config(). Both of them didn't worked. I checked some answers from stackoverflow which are not helped to resolve my issue.</p>
  
  <pre><code>CREATE EXTERNAL TABLE `test.record`(
    `test_id` string COMMENT 'from deserializer', 
    `test_name` string COMMENT 'from deserializer', 
    `processed_datetime` timestamp COMMENT 'from deserializer'
    )
  PARTITIONED BY ( 
    `filedate` date)
  ROW FORMAT SERDE 
    'org.apache.hive.hcatalog.data.JsonSerDe' 
  STORED AS INPUTFORMAT 
    'org.apache.hadoop.mapred.SequenceFileInputFormat' 
  OUTPUTFORMAT 
    'org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat'
  </code></pre>
  
  <p>I am expecting to read the data from the hive table and able to store it in Dataframe.</p>
  
  <pre><code>var tempDF =sql("SELECT * FROM test.record WHERE filedate = '2019-06-03' LIMIT 5")
  tempDF.show()
  </code></pre>
  
  <p>should work</p>