AZure Data Factory中的映射日期 [英] mapping Date in AZure Data Factory

查看:156
本文介绍了AZure Data Factory中的映射日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这次我正在与Data actory合作,这就是为什么我要问很多问题的原因

Im working with Data actory this time this why i ask lot of question about that

我的新问题是我的SOURCE(CSV文件包含一列充满了日期dd/MM/YYYY的DeleveryDate)和我的表SQl,其中我在数据预览源中映射btw源和接收器时将DElevry日期指定为DateTime

My new problem is that my SOURCE(CSV file contains a column DeleveryDate full of Date dd/MM/YYYY) and my table SQl where i specify DElevry date as DateTime but when I map btw source and sink in Data preview source

重复的列,如下图所示,但在数据预览中,列始终为NULL,与我的表NULL相同.

duplicate columns like in the picture below but in data preview sink the columns always NULL the same in my table NULL.

谢谢

推荐答案

您说DeleveryDate列的日期为dd/MM/YYYY,所以您能告诉我为什么DeleveryDate列具有"3","1"之类的值吗在您的屏幕截图中?字符串'3'或'1'不是格式为dd/MM/YYYY的日期字符串.

You said column DeleveryDate full of Date dd/MM/YYYY), can you tell me why the column DeleveryDate has the values like '3', '1' in your screenshot? String '3' or '1' are not the date string with format dd/MM/YYYY.

如果您想在Data Factory中进行一些数据转换,我仍然建议您进一步了解数据流.

If you want to do some data convert in Data Factory, I still suggest your to learn more about Data Flow.

目前,我们不能将日期格式直接从dd/MM/YYYY转换为日期时间yyyy-MM-dd HH:mm:ss.SSS,我们必须进行一些其他转换.

For now, we can not convert date format from dd/MM/YYYY to datetime yyyy-MM-dd HH:mm:ss.SSS directly, we must do some other converts.

下面看,我有一个csv文件,其中包含一列具有日期格式dd/MM/YYYY字符串的列,我仍在使用

Look at bellow, I have a csv file contained a column with date format dd/MM/YYYY string, I still using DerivedColumn this time:

添加派生列:

首先,使用此波纹管表达式对字符串进行子字符串转换并将dd/MM/YYYY转换为YYYY-MM-dd:

Firstly, using this bellow expression to substring and convert dd/MM/YYYY to YYYY-MM-dd:

substring(Column_2, 7, 4)+'-'+substring(Column_2, 4, 2)+'-'+substring(Column_2, 1,2)

然后使用toTimestamp()进行转换:

toTimestamp(substring(Column_2, 7, 4)+'-'+substring(Column_2, 4, 2)+'-'+substring(Column_2, 1,2), 'yyyy-MM-dd')

接收器设置和预览:

我的接收器表列tt数据类型为datetime:

My Sink table column tt data type is datetime:

执行管道:

检查接收器表中的数据:

希望这会有所帮助.

这篇关于AZure Data Factory中的映射日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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