To get Number of rows inserted after performing an Insert operation into a table

HariharaSam
Databricks Partner

Consider we have two tables A & B.

qry = """

INSERT INTO Table A

Select * from Table B where Id is null

"""

spark.sql(qry)

I need to get the number of records inserted after running this in databricks.