Skip to content

Commit 737ef07

Browse files
authored
Merge pull request #42 from data-integrations/bugfix_release/CDAP-14187-bigquery-cleanup
Fix lineage in BQ plugins
2 parents e100ec2 + b3e6f5d commit 737ef07

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/co/cask/gcp/bigquery/BigQuerySink.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/main/java/co/cask/gcp/bigquery/BigQuerySource.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)