@@ -290,7 +290,7 @@ func (s *Stage) saveQueryJsonFile(result *QueryResult) {
290
290
querySourceStr := s .querySourceString (result )
291
291
{
292
292
queryJsonFile , err := os .OpenFile (
293
- filepath .Join (s .States . OutputPath , querySourceStr )+ ".json" ,
293
+ filepath .Join (s .OutputPath , querySourceStr )+ ".json" ,
294
294
utils .OpenNewFileFlags , 0644 )
295
295
checkErr (err )
296
296
if err == nil {
@@ -302,7 +302,7 @@ func (s *Stage) saveQueryJsonFile(result *QueryResult) {
302
302
}
303
303
if result .QueryError != nil {
304
304
queryErrorFile , err := os .OpenFile (
305
- filepath .Join (s .States . OutputPath , querySourceStr )+ ".error.json" ,
305
+ filepath .Join (s .OutputPath , querySourceStr )+ ".error.json" ,
306
306
utils .OpenNewFileFlags , 0644 )
307
307
checkErr (err )
308
308
if err == nil {
@@ -332,7 +332,7 @@ func (s *Stage) saveColumnMetadataFile(qr *presto.QueryResults, result *QueryRes
332
332
}
333
333
}()
334
334
columnMetadataFile , ioErr := os .OpenFile (
335
- filepath .Join (s .States . OutputPath , querySourceStr )+ ".cols.json" ,
335
+ filepath .Join (s .OutputPath , querySourceStr )+ ".cols.json" ,
336
336
utils .OpenNewFileFlags , 0644 )
337
337
if ioErr != nil {
338
338
return ioErr
@@ -372,3 +372,17 @@ func (s *Stage) querySourceString(result *QueryResult) (sourceStr string) {
372
372
}
373
373
return
374
374
}
375
+
376
+ func (s * Stage ) createNextStagesOutputDirectories () {
377
+ for _ , nextStage := range s .NextStages {
378
+ // Construct the output directory path
379
+ stageOutputPath := filepath .Join (s .OutputPath , nextStage .Id )
380
+ nextStage .OutputPath = stageOutputPath
381
+
382
+ // Create the directory
383
+ utils .PrepareOutputDirectory (stageOutputPath )
384
+
385
+ // Recursively call the function on the child stage
386
+ nextStage .createNextStagesOutputDirectories ()
387
+ }
388
+ }
0 commit comments