Is writing custom function possible in transform(array,func) in databricks sql?

Jerry01
New Contributor III

This is the query I am trying to implement

Create function data_hide(data string)

Return if(is_member('groupName'),data,'****')

Table : my_table

Id Subject

​1. ['Eng','Bio']

2. ['Phy','Mat']

Select id, transform(Subject, x -> data_hide(x)) as new_data from my_table

The above select statement throwing me error​