File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
azure-cosmos-spark_3-4_2-12/src/main/scala/com/azure/cosmos/spark
azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ object SparkInternalsBridge extends BasicLoggingTrait {
80
80
}
81
81
}
82
82
83
- private def getInternalCustomTaskMetricsAsSQLMetricInternal (
83
+ private def ConsistencygetInternalCustomTaskMetricsAsSQLMetricInternal (
84
84
knownCosmosMetricNames : Set [String ],
85
85
taskMetrics : TaskMetrics ): Map [String , SQLMetric ] = {
86
86
getAccumulators(taskMetrics) match {
Original file line number Diff line number Diff line change @@ -132,8 +132,9 @@ private[cosmos] case class PartitionMetadata
132
132
}
133
133
134
134
def getAvgChangesPerLsn : Double = {
135
- val effectiveFirstLsn = if (this .firstLsn.isEmpty) 0 else this .firstLsn.get
136
- if (this .documentCount == 0 || (this .getAndValidateLatestLsn - effectiveFirstLsn) <= 0 ) {
135
+ if (this .firstLsn.isEmpty) {
136
+ math.max(1d , this .documentCount.toDouble / this .getAndValidateLatestLsn)
137
+ } else if (this .documentCount == 0 || (this .getAndValidateLatestLsn - this .firstLsn.get) <= 0 ) {
137
138
1d
138
139
} else {
139
140
this .documentCount.toDouble / (this .getAndValidateLatestLsn- this .firstLsn.get)
You can’t perform that action at this time.
0 commit comments