Correct Data Types - Wrangler

276 views
Skip to first unread message

Anthony Apollis

unread,
Jun 10, 2022, 6:14:04 AM6/10/22
to CDAP User
Please assist? I would like to correct my data types in the Wrangler tool, data is from Campaign manager. I tried several data types for instance in my first column, which is date. Just don't seem to get it right?


Screenshot 2022-06-10 at 11.26.09.png

Baptiste Benet

unread,
Jun 10, 2022, 4:46:53 PM6/10/22
to cdap...@googlegroups.com
Hey Anthony,

What happens if you try and follow something like what's described here? https://cdap.atlassian.net/wiki/spaces/DOCS/pages/1162641663/Converting+Timestamp+types+to+Date+in+Wrangler. Does it work?


Le ven. 10 juin 2022 à 03:14, Anthony Apollis <ant...@tmicollective.com> a écrit :
Please assist? I would like to correct my data types in the Wrangler tool, data is from Campaign manager. I tried several data types for instance in my first column, which is date. Just don't seem to get it right? -- You received this message
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd
Please assist? I would like to correct my data types in the Wrangler tool, data is from Campaign manager. I tried several data types for instance in my first column, which is date. Just don't seem to get it right?


--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/a7135cce-de7d-4328-92c2-6da97ba01b6en%40googlegroups.com.

Baptiste Benet

unread,
Jun 10, 2022, 5:02:06 PM6/10/22
to cdap...@googlegroups.com
After searching a little more, this is what I found for Wrangler: https://cdap.gitee.io/docs/zh/user-guide/data-preparation/directives/format-unix-timestamp.html, but couldn't get around to using it... I think you should consider doing a Javascript Transform to turn that column into a date.

Albert Shau

unread,
Jun 14, 2022, 12:09:11 PM6/14/22
to cdap...@googlegroups.com
There is a parse-timestamp directive that can be used to parse a string into a timestamp. 

You can also specify the time unit:

parse-timestamp [column] [seconds | milliseconds | microseconds]

Anthony Apollis

unread,
Jun 15, 2022, 9:27:44 AM6/15/22
to CDAP User

I am getting this error: Screenshot 2022-06-15 at 15.23.48.png
Screenshot 2022-06-15 at 15.23.54.png

Baptiste Benet

unread,
Jun 15, 2022, 10:54:41 AM6/15/22
to cdap...@googlegroups.com
Try and remove the "<" and ">" characters, you shouldn't need them

Le mer. 15 juin 2022 à 06:28, Anthony Apollis <anthony...@gmail.com> a écrit :
I am getting this error: On Friday, June 10, 2022 at 10:46:53 PM UTC+2 baptist...@liveramp.com wrote: Hey Anthony, What happens if you try and follow something like what's described here? https://cdap.atlassian.net/wiki/spaces/DOCS/pages/1162641663/Converting+Timestamp+types+to+Date+in+Wrangler
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd

I am getting this error: Screenshot 2022-06-15 at 15.23.48.png
Screenshot 2022-06-15 at 15.23.54.png
On Friday, June 10, 2022 at 10:46:53 PM UTC+2 baptist...@liveramp.com wrote:
Hey Anthony,

What happens if you try and follow something like what's described here? https://cdap.atlassian.net/wiki/spaces/DOCS/pages/1162641663/Converting+Timestamp+types+to+Date+in+Wrangler. Does it work?


Le ven. 10 juin 2022 à 03:14, Anthony Apollis <ant...@tmicollective.com> a écrit :
Please assist? I would like to correct my data types in the Wrangler tool, data is from Campaign manager. I tried several data types for instance in my first column, which is date. Just don't seem to get it right? -- You received this message
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd
Please assist? I would like to correct my data types in the Wrangler tool, data is from Campaign manager. I tried several data types for instance in my first column, which is date. Just don't seem to get it right?


--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/a7135cce-de7d-4328-92c2-6da97ba01b6en%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.

Anthony Apollis

unread,
Jun 16, 2022, 2:41:11 PM6/16/22
to cdap...@googlegroups.com
I did and i am getting the same error:



You received this message because you are subscribed to a topic in the Google Groups "CDAP User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cdap-user/5QXlxT_Fe04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cdap-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/CAEoRv15uhFWahn4CBrMd9SZa3UguAMwBZ8Qhi31eZTM62s%2B9ug%40mail.gmail.com.


--
Anthony Apollis

Data Lead

021 447 3344 | tmicollective.com

3rd Floor, Central Building, Black River Park, 2 Fir Street, Observatory, Cape Town, 7925

The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.
Screenshot 2022-06-16 at 20.38.54.png

Anthony Apollis

unread,
Jun 16, 2022, 2:42:08 PM6/16/22
to cdap...@googlegroups.com
Would you please show an example as in my date column?

You received this message because you are subscribed to a topic in the Google Groups "CDAP User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cdap-user/5QXlxT_Fe04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cdap-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/CAOtBAghzNT7p%2B1W%2BSytY-Q_ukG2doGW%2BL5_OK5X%2B0SwVnrRLnw%40mail.gmail.com.

Anthony Apollis

unread,
Jun 20, 2022, 7:49:46 AM6/20/22
to CDAP User
Please explain more?

Baptiste Benet

unread,
Jun 21, 2022, 11:29:06 AM6/21/22
to cdap...@googlegroups.com
Type this: parse-timestamp :Event_Time microseconds

image.png



Le lun. 20 juin 2022 à 04:49, Anthony Apollis <ant...@tmicollective.com> a écrit :
Please explain more? On Tuesday, 14 June 2022 at 18:09:11 UTC+2 Albert Shau wrote: There is a parse-timestamp directive that can be used to parse a string into a timestamp.  You can also specify the time unit: parse-timestamp [column] [seconds

Anthony Apollis

unread,
Jul 7, 2022, 9:24:37 AM7/7/22
to CDAP User
im still waiting on this example?

On Tuesday, 14 June 2022 at 18:09:11 UTC+2 Albert Shau wrote:

Christophe DIEDHIOU

unread,
Jul 7, 2022, 9:34:36 AM7/7/22
to cdap...@googlegroups.com
Hi Anthony, hope you are fine, please try this and let me know 

parse-as-simple-date :  date_field dd/MM/yy

Best regards !

Anthony Apollis

unread,
Jul 7, 2022, 10:49:52 AM7/7/22
to cdap...@googlegroups.com
Thank you, i did solve that problem.
What i am trying to solve now is log time or time duration. Please assist? I tried the Log function in Wrangler, but nothing happens.

You received this message because you are subscribed to a topic in the Google Groups "CDAP User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cdap-user/5QXlxT_Fe04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cdap-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/CA%2BWXLUjbvDPvshncrAHAqDeNwSHH5bM2JosXXOrqWiQJL4_0jg%40mail.gmail.com.
Screenshot 2022-07-07 at 15.59.43.png
Screenshot 2022-07-07 at 15.59.43-1.png

Christophe DIEDHIOU

unread,
Jul 7, 2022, 10:57:46 AM7/7/22
to cdap...@googlegroups.com
Good to know that your problem is solved.

What is the format of your log duration?

Anthony Apollis

unread,
Jul 7, 2022, 11:18:11 AM7/7/22
to cdap...@googlegroups.com
It should be Minutes n Seconds.

Christophe DIEDHIOU

unread,
Jul 7, 2022, 11:20:48 AM7/7/22
to cdap...@googlegroups.com
Is the actual format is in milliseconds?

Anthony Apollis

unread,
Jul 7, 2022, 11:24:12 AM7/7/22
to cdap...@googlegroups.com

Christophe DIEDHIOU

unread,
Jul 7, 2022, 11:37:04 AM7/7/22
to cdap...@googlegroups.com
I'm not able to open your file. This was my response for correct interaction time.

Hi Antony, change the format of interaction_time to double or float and on the top of the field click on the arrow, choose the custom transform option to do the right calculation for conversion. You can before the custom transform , if you want use fill null or empty cells option to replace null values by 0 The second option is to use python transform before having downloaded python plugin from Hub and there do your conversion.
----
For practice, if your interaction_time is in milliseconds that what I think it is. Change the type to float,Use  fill null or empty cells option to replace null values by 0 and then use custom transform to do this computation interaction_time/60000 because 1 minute=60000 milliseconds


Anthony Apollis

unread,
Jul 8, 2022, 5:07:11 AM7/8/22
to cdap...@googlegroups.com
I have tried the data type changes for interaction_time and this is what i get, see screenshot.
Floodlight_Configuration would be something similar, I applied the same formula(see screen shot).


Screenshot 2022-07-08 at 11.02.37.png
Screenshot 2022-07-08 at 11.04.58.png
Reply all
Reply to author
Forward
0 new messages