gsql/ Running Loading Jobs
Last Updated: October 20, 2018How to execute, monitor, and manage data loading sessions in TigerGraph.
Running Loading Jobs
Once a job is created, you execute it using the RUN LOADING JOB command.
1. Execution Command
Basic syntax to run a job:
bashterminalRUN LOADING JOB my_job
Overriding File Paths
You can change the data source at runtime using the USING clause:
bashterminalRUN LOADING JOB my_job USING f="/new/path/data.csv"
2. Runtime Options
Enhance your loading process with these flags:
-dryrun: Processes data but does not write to the graph. Useful for validation.-noprint: Suppresses the progress output; only shows the Job ID and log path.-n [i,j]: Limits loading to a specific range of lines (e.g.,-n 1,100).-max_error me: Aborts the job if the number of failed lines exceedsme.
3. Maintenance Commands
Clearing Data
CLEAR GRAPH STORE: Flushes all data from the database but preserves the schema.- Use
-HARDto bypass confirmation:CLEAR GRAPH STORE -HARD.
- Use
DROP ALL: Wipes both data and schema definitions.
Deleting Specific Data
Use DELETE statements inside a loading job to remove specific vertices or edges based on input files:
gsqlterminalCREATE LOADING JOB purge_job FOR GRAPH MyGraph { DEFINE FILENAME f; DELETE VERTEX Person (PRIMARY_ID $0) FROM f; }
4. REST API Integration
For high-performance or automated environments, run jobs via the REST++ endpoint:
POST /ddl/{graph_name}
This bypasses the GSQL shell overhead and is ideal for production pipelines.
5. Troubleshooting
- Check Status: Use
gadmin statusto ensure GPE and GSE services are online. - Logs: Every job generates a log file (path provided at the start of the run). Check these for specific "Rejected Line" errors.