I want to change the string datatype to timestamp, can anyone help me??

0 votes
Aug 21 in Big Data Hadoop by anonymous
31 views

1 answer to this question.

0 votes

I am not sure if you want the code for Java, Hive or Pig. I am sharing the code for Java:

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

//class and the remaining code

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
Date parsedDate = dateFormat.parse(yourString);
Timestamp timestamp = new java.sql.Timestamp(parsedDate.getTime());
answered Aug 22 by Karan

Related Questions In Big Data Hadoop

+1 vote
3 answers

when i tried to run the hdfs namenode -format command...its failed to run..can anyone help me with this???

Hi Suriyaprakash, I guess the path for hadoop ...READ MORE

answered Jul 23, 2018 in Big Data Hadoop by avi_man_utd
668 views
0 votes
1 answer
0 votes
1 answer

I need to copy data from one HDFS to another HDFS. Can you help me do so?

I understood your issue. Let me help you ...READ MORE

answered May 16 in Big Data Hadoop by ravikiran
• 4,560 points
51 views
0 votes
1 answer
0 votes
1 answer

How can I use my host machine’s web browser to check my HDFS services running in the VM?

The sole purpose of the virtual machine ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,300 points
140 views
0 votes
1 answer
0 votes
3 answers

How to change the delimiter in Sqoop?

--fields-terminated-by <char> READ MORE

answered Jun 25 in Big Data Hadoop by anonymous
1,554 views
0 votes
2 answers

Hey for all, how to get on large data i want use in hadoop?

Hi, To work with Hadoop you can also ...READ MORE

answered Jul 30 in Big Data Hadoop by Sunny
48 views