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

如果数据转换导致问题,则可能需要按照此处实施TryParse

相关内容

  • 没有找到相关文章

最新更新