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

[FSTORE-1327] Activity UI doesn't correctly report Delta commit activities #1386

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 10 additions & 2 deletions python/hsfs/core/delta_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ def _generate_merge_query(self, source_alias, updates_alias):
@staticmethod
def _get_last_commit_metadata(spark_context, base_path):
fg_source_table = DeltaTable.forPath(spark_context, base_path)

# Get info about the latest commit
last_commit = fg_source_table.history(1).first().asDict()
version = last_commit["version"]
commit_timestamp = util.convert_event_time_to_timestamp(
Expand All @@ -180,6 +182,12 @@ def _get_last_commit_metadata(spark_context, base_path):
commit_date_string = util.get_hudi_datestr_from_timestamp(commit_timestamp)
operation_metrics = last_commit["operationMetrics"]

# Get info about the oldest remaining commit
oldest_commit = fg_source_table.history().orderBy("version").first().asDict()
oldest_commit_timestamp = util.convert_event_time_to_timestamp(
oldest_commit["timestamp"]
)

if version == 0:
fg_commit = feature_group_commit.FeatureGroupCommit(
commitid=None,
Expand All @@ -188,7 +196,7 @@ def _get_last_commit_metadata(spark_context, base_path):
rows_inserted=operation_metrics["numOutputRows"],
rows_updated=0,
rows_deleted=0,
last_active_commit_time=commit_timestamp,
last_active_commit_time=oldest_commit_timestamp,
)
else:
fg_commit = feature_group_commit.FeatureGroupCommit(
Expand All @@ -198,7 +206,7 @@ def _get_last_commit_metadata(spark_context, base_path):
rows_inserted=operation_metrics["numTargetRowsInserted"],
rows_updated=operation_metrics["numTargetRowsUpdated"],
rows_deleted=operation_metrics["numTargetRowsDeleted"],
last_active_commit_time=commit_timestamp,
last_active_commit_time=oldest_commit_timestamp,
)

return fg_commit
Loading