02_data.txt

02_data.txt
// extract, transform and load the raw bug reports data
Bugzilla:
LOAD
    1 as Counter,
    'Apache' as Source,
    id,
    id as i,
    link,
    year(date#(subfield(ts, 'T', 1), 'YYYY-MM-DD')) as ts_year,
    month(date#(subfield(ts, 'T', 1), 'YYYY-MM-DD')) as ts_month,
    time#(subfield(ts, 'T', 2), 'hh:mm:ss') as ts_time,
    ts,
    title,
    status,
    Dual(ApplyMap('Map_Status', status), ApplyMap('Map_Dual_Status', ApplyMap('Map_Status', status))) as GeneralStatus,
    classification,
    resolution,
    priority,
    Dual(ApplyMap('Map_Severity', severity), ApplyMap('Map_Dual_Severity', ApplyMap('Map_Severity', severity))) as GeneralSeverity,
    severity,
    summary,
    body
FROM $(vInTickets) (txt, utf8, embedded labels, delimiter is ',', msq);
// store transformed bug reports data on disk
STORE
    id,
    i,
    link,
    title,
    ts,
    status,
    GeneralStatus,
    classification,
    resolution,
    priority,
    severity,
    GeneralSeverity,
    summary,
    body
FROM Bugzilla into $(vOutTickets) (txt);
// Drop unstructured bug report fields to free up memory as those where only necessary for exporting into the Squirro data import file
DROP FIELDS ts, summary, body;
// call the command-line tool to bulk load the pre-processed data
// use the bulk loader executable from the export file into Squirro (once)
//EXECUTE cmd.exe /C timeout 60;
//EXECUTE cmd.exe /C $(vSquirroBulkLoader);