【发布时间】:2016-03-22 19:37:09
【问题描述】:
我有使用 BCP 从 SQL Server 提取的数据,文件是 ASCII CSV。
日期格式为 2016-03-03T23:00:00。
运行提取时我得到
补充资料:
{"diagnosticCode":195887127,"severity":"Error","component":"RUNTIME","source":"User","errorId":"E_RUNTIME_USER_EXTRACT_COLUMN_CONVERSION_INVALID_ERROR","message":"无效 尝试转换列数据时的字符。","description":"HEX: \"223022\" 转换输入记录时出现无效字符。\n位置: 第 1 行第 21 列。","resolution":"检查输入是否有错误或使用 \"silent\" 切换以忽略 输入。\n考虑忽略“无效”行可能会影响作业 结果,并且类型必须可以为空才能使转换错误 忽略。","helpLink":"","详细信息":"================================== ==================================================== ======== \ nHex中:5432333B35313B34362D323031362E30332E30335432333B30303B30302D302D352D323031362E30332E30335432333B35313B34392F3536372D302D323031362E30332E3033 \ n ^\nTEXT:T23:51:46,2016-03-03T23:00:00,0,5,2016-03-03T23:51:49.567,0,2016-03-03\n
您如何在提取时正确处理日期?我不清楚为什么它会在日期时间列的中间分裂。
示例行看起来像
50CA2FBB-95C3-4216-A729-999BE2DB491A,2016-03-03T23:51:49.567,1001464881,1001464795,1001464795,00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000000,100 ,100 , ,12643,bCAwvRnNVwrKDXKxZkVed2Z1zHY=,o2lsnhueDApmvSbm31mh3aetYnc=,2016-03-03T23:50:46,2016-03-03T23:00:00,2016-03-03T23:301:46,3:2T:6 00,0,5,2016-03-03T23:51:49.567,0,2016-03-03T00:00:00,2016-03-03T23:59:59,00000000-0000-0000-0000-000000000000
Extract Statement is
@res =
EXTRACT
LicenseId Guid,
EntryDate DateTime,
UltimateId long,
SiteId string,
VirtualId string,
ProjectId Guid,
DocumentId Guid,
MasterId string,
ProductId string,
FeatureString string,
VersionId long,
ComputerSid string,
UserSid string,
AppStartTime DateTime,
StartHour DateTime,
AppStopTime DateTime,
StopHour DateTime,
GmtDelta int,
RecordedGmtDelta int,
LastUpdated DateTime,
Processed bool,
StartDate DateTime,
EndDate DateTime,
ImsId Guid
FROM @dataFile
USING Extractors.Csv();
【问题讨论】:
-
有趣的是,如果我删除了 BCP 文件中除两个日期之外的所有日期并相应地修改了 Extract 语句......它可以工作。
标签: azure-data-lake u-sql