如何在Azure数据工厂中将具有一个时间戳的列转换为另一个时间戳 [英] How to Convert a column having one timestamp to another timestamp in Azure Data Factory

查看:99
本文介绍了如何在Azure数据工厂中将具有一个时间戳的列转换为另一个时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列 ABC ,其中时间戳的格式为dd/MM/yyyy HH:mm:SS(11/04/2020 1:17:40).我想创建另一个列 ABC_NEW ,其数据与旧列相同,但时间戳记为'yyyy-MM-dd HH:mm:SS'.我尝试使用azure数据工厂派生列进行操作

I have column ABC where timestamp is of format dd/MM/yyyy HH:mm:SS (11/04/2020 1:17:40).I want to create another column ABC_NEW with same data as old column but with different timestamp 'yyyy-MM-dd HH:mm:SS'.I tried doing in azure data factory derived column using

toTimestamp(column_name,'yyyy-MM-dd HH:mm:SS')但没有用,它将作为NULL出现.有人可以帮忙吗?

toTimestamp(column_name,'yyyy-MM-dd HH:mm:SS') but it did not work it is coming as NULL. Can anyone help?

推荐答案

这是一个两步过程.首先,您需要告诉ADF时间戳列中的每个字段代表什么,然后可以使用字符串转换将时间戳转换为所需的输出字符串:

It's a 2-step process. You first need to tell ADF what each field in your timestamp column represents, then you can use string conversions to manipulate that timestamp into the output string as you like:

toString(toTimestamp('11/04/2020 1:17:40','MM/dd/yyyy HH:mm:ss'),'yyyy-MM-dd HH:mm:SS')

toString(toTimestamp('11/04/2020 1:17:40','MM/dd/yyyy HH:mm:ss'),'yyyy-MM-dd HH:mm:SS')

这篇关于如何在Azure数据工厂中将具有一个时间戳的列转换为另一个时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆