process.skip
Use this function in the data
method of a process to exit execution. The message will be recorded and displayed in the process log upon process completion.
js
process.skip(group, message)
process.skip(message)
Parameters
group
(string): An optional name for the group to which the message belongs. This can be used to categorize logs when the process completes. If not provided, the message will be logged without grouping.(optional)
message
(string): The message to be logged when the process completes.
Examples
js
function data(record) {
// This function is called once for each line of data on the second cycle
// Use this to build dimensions and push data into cubes
if(!record.name) {
process.skip("Validation", "Missing required fields. Skipping this entry.");
}
// Continue rest of data function
}
In this example, when process.skip() is called, the process exits the data method. Upon process completion, the message is logged under the group "Validation".
The log output at the end of the process aggregates and displays each message with a counter indicating how many times each event occurred. For instance, if three records were skipped due to missing names:
plaintext
Skipped Log:
Group: Validation
Missing required fields. Skipping this entry. [3]