简体   繁体   English

数据融合中的MD5/SHA字段数据集

[英]MD5/SHA Field Dataset in Data Fusion

I need to concatanate a few string values in order to obtain the SHA256 encrypted string.我需要连接一些字符串值才能获得 SHA256 加密字符串。 I've seen Data Fusion has a plugin to do the job:我已经看到 Data Fusion 有一个插件来完成这项工作:

在此处输入图像描述

The documentation however is very poor and nothing I've tried seems to work.然而,文档非常糟糕,我尝试过的任何东西似乎都不起作用。 I created a table in BQ with the string fields I need to concatanate but the output is same as input.我在 BQ 中创建了一个表,其中包含我需要连接的字符串字段,但 output 与输入相同。 Can anyone provide with an example on how to use this plugin?任何人都可以提供有关如何使用此插件的示例吗?

EDIT编辑

Below I present the example,下面我举个例子,

This is how the workflow looks like:这是工作流程的样子:

在此处输入图像描述

For the testing purposes, I added one column with the following string:出于测试目的,我添加了一列,其中包含以下字符串:

2022-01-01T00:00:00+01:00

在此处输入图像描述

And here's the output:这是 output:

在此处输入图像描述

You can use Wrangler to concatenate the string values.您可以使用Wrangler连接字符串值。

I tried your scenario adding Wrangler to the Pipeline:我尝试了将牧马人添加到管道的场景:

在此处输入图像描述

Joining 2 Columns:加入 2 列: 在此处输入图像描述

I named the column new_col , using , as delimiter:我将列命名为new_col ,使用,作为分隔符: 在此处输入图像描述

Output: Output: 在此处输入图像描述

What you described can be achieved by 2 Wranglers:您所描述的可以通过 2 个 Wranglers 实现:

  1. The first Wrangler will be what @angela-b described.第一个牧马人将是@angela-b 所描述的。 Use the merge directive to create a new column with the concatenation of two columns.使用merge 指令创建一个包含两列串联的新列。 Example directive that joins column a and b using , as the delimiter and stores the result in column a_b :使用,作为分隔符连接列ab并将结果存储在列a_b中的示例指令:
merge a b a_b ,
  1. The second Wrangler will use the hash directive which will hash the column in place using a specified algorithm.第二个 Wrangler 将使用hash 指令,该指令将 hash 列使用指定的算法就位。 Example of a directive that hashes column a_b using MD5:使用 MD5 散列a_b列的指令示例:
hash :a_b 'MD5' true

Remember to set the last parameter encode to true so that you get a string output instead of a byte array.请记住将最后一个参数encode设置为 true,以便您获得字符串 output 而不是字节数组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM