azure - 如何使用Azure数据流替换列中的多个文本?

标签 azure azure-data-factory

我的数据中有一个名为“位置”的列。我有 100000 条记录。

enter image description here

我正在使用派生列表达式在数据流中使用以下代码清理位置,并将新列命名为“Location_new”

case(Location == 'Otago/Southland', "Otago",
    Location == 'Nelson - Marlborough', "Nelson",
    Location == 'National', "Other")

代码正在工作,但是,它没有替换我的整个新列并使其为空

enter image description here

请注意,上面的代码只是一个示例,由于我的数据很困惑,我将替换近 250 个名称。

谁能告诉我如何克服这个问题吗?有没有更好的方法来清理数据?

最佳答案

我已经复制了样本。您的 case 语句看起来不错,并且您在新列中获得 NULL 值可能是因为您传入的数据不满足任何 case 语句。

正如 Nick.McDermaid 在评论部分中提到的,您需要在 case 语句中提供 else 值,以便在 case 语句中的任何条件均不起作用时按原样获取传入值。

不带其他内容的情况陈述:

enter image description here

与 else 一起的案例陈述:

case(Location == 'Otago/Southland', "Otago",
Location == 'Nelson - Marlborough', "Nelson",
Location == 'National', "Other",
Location)

enter image description here

关于azure - 如何使用Azure数据流替换列中的多个文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71551587/

相关文章:

azure - 如何在 Azure 数据工厂 SFTP 中使用通配 rune 件名?

azure - 如何根据值复制Azure数据工厂中的数据?

serialization - 使用 Azure 表存储的替代方法?

azure - ADF : find pipelines by sink resource

azure - 数据工厂: how to stop pipeline execution without logic and without failure?

python - 有谁知道我可以在哪里获得适用于 azure 的 linux python SDK?

powershell - Azure SFTP 连接器,创建后无法编辑应用程序设置值

azure - "Failed to delete integration runtime."Azure 数据工厂

azure - 根据触发器将参数传递给 Azure 数据工厂-ADF 事件

azure - 我可以使用 Azure 数据工厂终结点从管道流式传输数据吗?