[ 
https://issues.apache.org/jira/browse/SPARK-51360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ramakrishna updated SPARK-51360:
--------------------------------
    Description: 
It looks like Spark's 

*numInputRows* is wrongly calculated , it is double the number of records. This 
can be very misleading in production scenarios.

 

Please find the screenshots attached .

 

I have also zipped the project which reproduces the problem

You need Java 8 and SBT to run this locally.

 

 

  was:
It looks like Spark's 

*numInputRows* is wrongly calculated , it is double the number of records. This 
can be very misleading in production scenarios.

 

Please find the screenshots attached .

 

I have also zipped the project which reproduces the problem

 

def insertToDeltaTable(batchDF: Dataset[NewEmployee], batchId: Long): Unit = {

println("batch ID :: "+ batchId)

println("No of records ::: "+ batchDF.count())

batchDF.write.partitionBy("systemId").format("delta").mode("append").save(deltaTablePath)

}


> Spark counts the total no of records twice in forEachBatch
> ----------------------------------------------------------
>
>                 Key: SPARK-51360
>                 URL: https://issues.apache.org/jira/browse/SPARK-51360
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark, SQL
>    Affects Versions: 3.5.1
>            Reporter: Ramakrishna
>            Priority: Critical
>              Labels: pull-request-available
>
> It looks like Spark's 
> *numInputRows* is wrongly calculated , it is double the number of records. 
> This can be very misleading in production scenarios.
>  
> Please find the screenshots attached .
>  
> I have also zipped the project which reproduces the problem
> You need Java 8 and SBT to run this locally.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to