- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Hive output write on HDFS csv file Milisecond missing from Timestamp column
- Labels:
-
Apache Hive
-
HDFS
Created ‎04-07-2021 09:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to write hive o/p into HDFS csv file then there is change is date timestamp column
millisecond is missing in csv file
Hive : (1750-01-01 00:00:00.0)
csv : (1750-01-01 00:00:00)
script :
hive -e "INSERT OVERWRITE DIRECTORY '/path/date/tab1/'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '|'
STORED AS TEXTFILE
select * from table1 limit 5;"
Hive o/p
123|1750-01-01 00:00:00.0||2029-09-09 14:29:44.0
csv file
123|1750-01-01 00:00:00||2029-00-04 14:29:44
Can someone let me know how to write same o/p in CSV as we get using Hive?
Created on ‎04-09-2021 10:05 PM - edited ‎04-09-2021 10:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
Hive timestamp does support up to 9 digits decimal places (nano seconds)
For your case, maybe you can check whether for those timestamp with none-zero nano seconds, e.g. 1750-01-01 00:00:00.123456789, whether such data can be exported correctly
And for your example, 00:00:00.0 equals to 00:00:00, you didn't lose any precision, as it is zero nanosecond
