File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/main/java/co/cask/gcp/bigquery Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -128,8 +128,10 @@ public void prepareRun(BatchSinkContext context) throws Exception {
128128 BigQueryFileFormat .NEWLINE_DELIMITED_JSON ,
129129 TextOutputFormat .class );
130130
131- setOutputFormat (context );
131+ // Both emitLineage and setOutputFormat internally try to create an external dataset if it does not already exists.
132+ // We call emitLineage before since it creates the dataset with schema which .
132133 emitLineage (context , fields );
134+ setOutputFormat (context );
133135 }
134136
135137 @ Override
Original file line number Diff line number Diff line change @@ -112,8 +112,10 @@ public void prepareRun(BatchSourceContext context) throws Exception {
112112 job .setOutputKeyClass (LongWritable .class );
113113 job .setOutputKeyClass (Text .class );
114114
115- setInputFormat (context );
115+ // Both emitLineage and setOutputFormat internally try to create an external dataset if it does not already exists.
116+ // We call emitLineage before since it creates the dataset with schema which .
116117 emitLineage (context );
118+ setInputFormat (context );
117119 }
118120
119121 @ Override
You can’t perform that action at this time.
0 commit comments