diff --git a/pkg/ccl/importccl/import_processor.go b/pkg/ccl/importccl/import_processor.go index 4ebe56aa50e3..b8136b20d947 100644 --- a/pkg/ccl/importccl/import_processor.go +++ b/pkg/ccl/importccl/import_processor.go @@ -134,16 +134,15 @@ func (idp *readImportDataProcessor) Next() (rowenc.EncDatumRow, *execinfrapb.Pro // Once the import is done, send back to the controller the serialized // summary of the import operation. For more info see roachpb.BulkOpSummary. countsBytes, err := protoutil.Marshal(idp.summary) + idp.MoveToDraining(err) if err != nil { - idp.MoveToDraining(err) return nil, idp.DrainHelper() } - idp.MoveToDraining(nil /* err */) return rowenc.EncDatumRow{ rowenc.DatumToEncDatum(types.Bytes, tree.NewDBytes(tree.DBytes(countsBytes))), rowenc.DatumToEncDatum(types.Bytes, tree.NewDBytes(tree.DBytes([]byte{}))), - }, idp.DrainHelper() + }, nil } // ConsumerDone is part of the RowSource interface.