在 u-sql 中转换数据类型和 concat 列

Convert data type and concat column in u-sql

如何在 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;

如果数据转换导致问题,那么您可能需要根据 here.

实施 TryParse