How do I make an ATTRIBUTE column a UUID with Splice Machine as my source?

SPLICE MACHINE SOURCE: In my data flow I want to make an attribute column a UUID (For example: 87c312f0-4a49-45d9-aa65-bb6921cb1833). How can I accomplish this?

Beginner Asked on August 14, 2019 in Diyotta Studio.
Add Comment
3 Answer(s)

Hi Kaley

In MSSQL[ sql server] we have a function newid()  which will generate unique values .

1.Create a dataflow and drag the MSSQL source instance into the dataflow

2. Then add a derived attribute in the source instance and include the function as shown below make sure we place it in the diyotta custom function to overcome the validation issues as shown below.

RE: How do I make an ATTRIBUTE column a UUID?

3. Then map the source instance derived attribute to the target instance column it will populate with the unique values as shown below.

RE: How do I make an ATTRIBUTE column a UUID?

Expert Answered on August 14, 2019.

Hi Naveen,

Thank you, however, I am using Splice Machine as my SOURCE. It doesn’t appear to be working with the method you mentioned above. Any suggestions?

 

Thanks,

Kaley

on August 14, 2019.
Add Comment

Hi Kaley,

Splice machine does not provide a UUID SQL function. However it should be possible to create a UDF and use that in Diyotta. Add the UDF in Diyotta and use it source attributes.  Sample to use UDF in Diyotta is below.

RE: How do I make an ATTRIBUTE column a UUID with Splice Machine as my source?

RE: How do I make an ATTRIBUTE column a UUID with Splice Machine as my source?

Reference for UDF to generate UUID – https://www.splicemachine.com/subdomains/apidocs/JavaDocs/2.5/com/splicemachine/uuid/Type1UUID.Generator.html

Expert Answered on August 15, 2019.

Hi Anand,

I tried and followed the exact same steps you provided and I got the following error:

RE: How do I make an ATTRIBUTE column a UUID with Splice Machine as my source?

 

Here is my source:

RE: How do I make an ATTRIBUTE column a UUID with Splice Machine as my source?

 

Any thoughts?

 

-Kaley

on August 15, 2019.

Kaley,

As mentioned in my response, the example provided was only a sample. You would have to create the UDF first and place it in the hdfs in your environment. This UDF should then be registered in Diyotta and used in the splice machine source.

on August 16, 2019.
Add Comment

Hi Kaley,

We have addressed this issue as part of the latest version of Diyotta [4.1.0.3117]

Sample data snapshot, for generating the UUID using a UDF in splice machine

RE: How do I make an ATTRIBUTE column a UUID with Splice Machine as my source?

 

 

Expert Answered on August 16, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.