Quantcast
Channel: How to covert dataframe datatypes to String? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How to covert dataframe datatypes to String?

$
0
0

I have a hive Table having Date and Timestamp datatypes. I am creating DataFrame using below java code:

SparkConf conf = new SparkConf(true).setMaster("yarn-cluster").setAppName("SAMPLE_APP");SparkContext sc = new SparkContext(conf);HiveContext hc = new HiveContext(sc);DataFrame df = hc.table("testdb.tbl1");

Dataframe schema:

 df.printSchemaroot |-- c_date: date (nullable = true) |-- c_timestamp: timestamp (nullable = true)

I want to covert these columns to String. How can I achieve this?

I need this because of issue : Spark csv data validation failed for date and timestamp data types of Hive


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images