Databricks sql not able to evaluate expression current_user

Himanshu_90
New Contributor III

Hi,

I have a table as below:

create table default.test_user(

ID bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1),

usr1 varchar(255) NOT NULL,

ts1 timestamp NOT NULL,

usr2 varchar(255) NOT NULL,

ts2 timestamp NOT NULL) USING Delta;

I tried to insert data as below:

insert into table default.test_user

(usr1,ts1,usr2,ts2)

values

(current_user,current_timestamp,current_user,current_Timestamp)

I am getting error as below:

cannot evaluate expression current_user() AS `current_user()` in inline table definition; line 4 pos 1

Please suggest.