@@ -175,13 +175,15 @@ public static class LoadStatistics extends JobStatistics {
175175 private final Long inputFiles ;
176176 private final Long outputBytes ;
177177 private final Long outputRows ;
178+ private final Long badRecords ;
178179
179180 static final class Builder extends JobStatistics .Builder <LoadStatistics , Builder > {
180181
181182 private Long inputBytes ;
182183 private Long inputFiles ;
183184 private Long outputBytes ;
184185 private Long outputRows ;
186+ private Long badRecords ;
185187
186188 private Builder () {}
187189
@@ -192,6 +194,7 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP
192194 this .inputFiles = statisticsPb .getLoad ().getInputFiles ();
193195 this .outputBytes = statisticsPb .getLoad ().getOutputBytes ();
194196 this .outputRows = statisticsPb .getLoad ().getOutputRows ();
197+ this .badRecords = statisticsPb .getLoad ().getBadRecords ();
195198 }
196199 }
197200
@@ -215,6 +218,11 @@ Builder setOutputRows(Long outputRows) {
215218 return self ();
216219 }
217220
221+ Builder setBadRecords (Long badRecords ) {
222+ this .badRecords = badRecords ;
223+ return self ();
224+ }
225+
218226 @ Override
219227 LoadStatistics build () {
220228 return new LoadStatistics (this );
@@ -227,6 +235,7 @@ private LoadStatistics(Builder builder) {
227235 this .inputFiles = builder .inputFiles ;
228236 this .outputBytes = builder .outputBytes ;
229237 this .outputRows = builder .outputRows ;
238+ this .badRecords = builder .badRecords ;
230239 }
231240
232241 /** Returns the number of bytes of source data in a load job. */
@@ -249,13 +258,19 @@ public Long getOutputRows() {
249258 return outputRows ;
250259 }
251260
261+ /** Returns the number of bad records reported in a job. */
262+ public Long getBadRecords () {
263+ return badRecords ;
264+ }
265+
252266 @ Override
253267 ToStringHelper toStringHelper () {
254268 return super .toStringHelper ()
255269 .add ("inputBytes" , inputBytes )
256270 .add ("inputFiles" , inputFiles )
257271 .add ("outputBytes" , outputBytes )
258- .add ("outputRows" , outputRows );
272+ .add ("outputRows" , outputRows )
273+ .add ("badRecords" , badRecords );
259274 }
260275
261276 @ Override
@@ -268,7 +283,8 @@ public final boolean equals(Object obj) {
268283
269284 @ Override
270285 public final int hashCode () {
271- return Objects .hash (baseHashCode (), inputBytes , inputFiles , outputBytes , outputRows );
286+ return Objects .hash (
287+ baseHashCode (), inputBytes , inputFiles , outputBytes , outputRows , badRecords );
272288 }
273289
274290 @ Override
@@ -278,6 +294,7 @@ com.google.api.services.bigquery.model.JobStatistics toPb() {
278294 loadStatisticsPb .setInputFiles (inputFiles );
279295 loadStatisticsPb .setOutputBytes (outputBytes );
280296 loadStatisticsPb .setOutputRows (outputRows );
297+ loadStatisticsPb .setBadRecords (badRecords );
281298 return super .toPb ().setLoad (loadStatisticsPb );
282299 }
283300
0 commit comments