如何在U-SQL中转换数据类型和连接列?
@output =
SELECT DISTINCT (kco.ToString + "-" + hta_ref.ToString + "-" + his_ref.ToString) AS hs_isstaskID,
(kco.ToString + "-" + his_ref.ToString) AS HS_IssueID,
(kco.ToString + "-" + hta_ref.ToString) AS hs_task_ID,
*
FROM @input;
ToString
是一种方法,因此通常采用括号,例如
@output =
SELECT DISTINCT (kco.ToString() + "-" + hta_ref.ToString() + "-" + his_ref.ToString()) AS hs_isstaskID,
(kco.ToString() + "-" + his_ref.ToString()) AS HS_IssueID,
(kco.ToString() + "-" + hta_ref.ToString()) AS hs_task_ID,
*
FROM @input;
如果数据转换导致问题,则可能需要按照此处实施TryParse
。