@@ -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 , s .Id , querySourceStr )+ ".json" ,
293
+ filepath .Join (s .States .OutputPath , s .ParentStageId , s . Id , 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 , s .Id , querySourceStr )+ ".error.json" ,
305
+ filepath .Join (s .States .OutputPath , s .ParentStageId , s . Id , 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 , s .Id , querySourceStr )+ ".cols.json" ,
335
+ filepath .Join (s .States .OutputPath , s .ParentStageId , s . Id , querySourceStr )+ ".cols.json" ,
336
336
utils .OpenNewFileFlags , 0644 )
337
337
if ioErr != nil {
338
338
return ioErr
@@ -374,11 +374,10 @@ func (s *Stage) querySourceString(result *QueryResult) (sourceStr string) {
374
374
}
375
375
376
376
func (s * Stage ) createNextStagesOutputDirectories () {
377
- parentOutputPath := s .States .OutputPath
378
- utils .PrepareOutputDirectory (filepath .Join (parentOutputPath , s .Id ))
377
+ parentStageId := s .Id
379
378
for _ , nextStage := range s .NextStages {
380
- nextStage .States .OutputPath = filepath .Join (parentOutputPath , nextStage .Id )
381
- utils .PrepareOutputDirectory (nextStage .States .OutputPath )
379
+ nextStage .ParentStageId = parentStageId
380
+ stageOutputPath := filepath .Join (s .States .OutputPath , s .Id , nextStage .Id )
381
+ utils .PrepareOutputDirectory (stageOutputPath )
382
382
}
383
- s .States .OutputPath = parentOutputPath
384
383
}
0 commit comments