concatenate function support for HIVE database masking
search cancel

concatenate function support for HIVE database masking

book

Article ID: 281317

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

Tested and found that default.tdm_concatenate() not working for varchar datatype when used, gives error saying function expects String values but found varchar.

Could you please check if this is by design and if it can be enhanced to support varchar datatypes inside concatenate function.

Environment

TDM 4.10.x , 4.11.x

Cause

varchar datatype is not directly supported for HIVE DB masking but is under consideration to check the feasibility to implement and support it.

Resolution

Workaround is to use cast function while passing value as input to string.

Suppose column firstname is varchar type and has to pass to say concatenate function, it should be passed as cast(firstname as string) 

 An example is below: 

 tdm_concatenate( cast(firstname as string), '.', cast(lastname as string), '@' ,cast(companyname as string), '.com')

 We return a generic type Object from the function tdm_concatenate, which the Hive environment should be able to convert to relevant type, incase it doesn't work then cast needs to be used accordingly there as well.