Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write numRecords in CDC files regardless of whether we are using deletion vectors [databricks] #12196

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
*
* This file was derived from UpdateCommand.scala
* in the Delta Lake project at https://github.com/delta-io/delta.
Expand All @@ -21,9 +21,8 @@

package com.databricks.sql.transaction.tahoe.rapids

import com.databricks.sql.transaction.tahoe.{DeltaLog, DeltaOperations, DeltaTableUtils, DeltaUDF, OptimisticTransaction}
import com.databricks.sql.transaction.tahoe.{DeltaLog, DeltaOperations, DeltaTableUtils, DeltaUDF, OptimisticTransaction, RowTracking}
import com.databricks.sql.transaction.tahoe.DeltaCommitTag._
import com.databricks.sql.transaction.tahoe.RowTracking
import com.databricks.sql.transaction.tahoe.actions.{AddCDCFile, AddFile, FileAction}
import com.databricks.sql.transaction.tahoe.commands.{DeltaCommand, DMLUtils, UpdateCommand, UpdateMetric}
import com.databricks.sql.transaction.tahoe.files.{TahoeBatchFileIndex, TahoeFileIndex}
Expand Down Expand Up @@ -109,7 +108,8 @@ case class GpuUpdateCommand(
val (metadataPredicates, dataPredicates) =
DeltaTableUtils.splitMetadataAndDataPredicates(
updateCondition, txn.metadata.partitionColumns, sparkSession)
val candidateFiles = txn.filterFiles(metadataPredicates ++ dataPredicates)
val candidateFiles = txn.filterFiles(metadataPredicates ++ dataPredicates,
keepNumRecords = true /* Keep numRecords regardless of the state of deletion vectors in DB */)
val nameToAddFile = generateCandidateFileMap(deltaLog.dataPath, candidateFiles)

scanTimeMs = (System.nanoTime() - startTime) / 1000 / 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def generate_dest_data(spark):
@datagen_overrides(seed=0, reason='https://github.com/NVIDIA/spark-rapids/issues/10025')
@pytest.mark.parametrize("enable_deletion_vector", deletion_vector_values_with_350DB143_xfail_reasons(
enabled_xfail_reason='https://github.com/NVIDIA/spark-rapids/issues/12042'), ids=idfn)
@pytest.mark.xfail(condition=is_databricks143_or_later(), reason="https://github.com/NVIDIA/spark-rapids/issues/12047")
def test_delta_update_dataframe_api(spark_tmp_path, use_cdf, partition_columns, enable_deletion_vector):
from delta.tables import DeltaTable
data_path = spark_tmp_path + "/DELTA_DATA"
Expand Down
Loading