I am trying to create a TigerGraph loading job to use column names from the header line instead of positional parameters like $1, $2 etc. In order to use files external to TigerGraph server, I believe we need to specify the HEADER and INPUT_LINE_FILTER and use them in the loading job. However, I am unable to find any examples in TigerGraph documentation. My attempt below is now working.
Any help is appreciated.
result = conn.gsql('''
USE GRAPH MyGraphCopy
BEGIN
CREATE LOADING JOB load_persons_byname FOR GRAPH MyGraphCopy {
DEFINE FILENAME MyDataSource;
DEFINE HEADER MyHeader = "id","name","email","username","created_at","v_id";
DEFINE INPUT_LINE_FILTER reject_header = ( "created_at " = "created_at");
LOAD MyDataSource TO VERTEX Person VALUES($"v_id", $"name", $"email", $"username", $"created_at") USING SEPARATOR=",", HEADER="true", USER_DEFINED_HEADER=MyHeader, REJECT_LINE_RULE=reject_header, EOL="\n", QUOTE="double";
}
END
''')
print(result)