- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Get Time from a String ''yyyy-MM-dd hh:ss:mm' field
- Labels:
-
Apache Pig
Created ‎07-26-2016 01:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi experts,
I've the following field :
ToString( ToDate((long) Time_Interval), 'yyyy-MM-dd hh:ss:mm') as Time
How can I obtain only the time (hh:ss:mm)? I already try: ToString( ToDate(Time), 'HH:mm:ss.SSS')
Created ‎07-26-2016 03:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Pedro Rodgers I would use the GetMinute, GetSecond, Get MilliSecond functions.
Created ‎07-26-2016 03:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Pedro Rodgers I would use the GetMinute, GetSecond, Get MilliSecond functions.
Created ‎07-26-2016 03:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunile Manjee many thanks! One more question: is possible to create a variable and use to IF statement. Example: A = Foreach X Generate A1,A2,A3; --Create a variable var = Concat(A1,A2); Split A into B IF (var == "teste"); Is possible to do this?
Created ‎07-26-2016 04:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to use arithmetic operation like
X = FOREACH A GENERATE f2, (f2==1?1:COUNT(B));
Or embed pig in wrapper
