Skip to content

Commit 4491258

Browse files
authored
Write metrics for store allocated rows only (#830)
* Write metrics for store allocated rows only * Apply spotless
1 parent 197a701 commit 4491258

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ingestion/src/main/java/feast/ingestion/ImportJob.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,16 @@ public static PipelineResult runPipeline(ImportOptions options) throws IOExcepti
155155
FeatureSink featureSink = getFeatureSink(store);
156156

157157
sinkReadiness = sinkReadiness.and(featureSink.prepareWrite(featureSetSpecs));
158+
PCollection<FeatureRow> rowsForStore =
159+
storeAllocatedRows.get(storeTags.get(store)).setCoder(ProtoCoder.of(FeatureRow.class));
158160

159161
// Step 5. Write metrics of successfully validated rows
160-
validatedRows
161-
.get(FEATURE_ROW_OUT)
162-
.apply("WriteInflightMetrics", WriteInflightMetricsTransform.create(store.getName()));
162+
rowsForStore.apply(
163+
"WriteInflightMetrics", WriteInflightMetricsTransform.create(store.getName()));
163164

164165
// Step 6. Write FeatureRow to the corresponding Store.
165166
WriteResult writeFeatureRows =
166-
storeAllocatedRows
167-
.get(storeTags.get(store))
168-
.setCoder(ProtoCoder.of(FeatureRow.class))
169-
.apply("WriteFeatureRowToStore", featureSink.writer());
167+
rowsForStore.apply("WriteFeatureRowToStore", featureSink.writer());
170168

171169
// Step 7. Write FailedElements to a dead letter table in BigQuery.
172170
if (options.getDeadLetterTableSpec() != null) {

0 commit comments

Comments
 (0)