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

Delta delta streamer should handle cases where there is no feature gr… #1412

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
8 changes: 5 additions & 3 deletions utils/python/hsfs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def offline_fg_materialization(
print(f"startingOffsets: {offset_string}")

# read kafka topic
df = (
kafka_df = (
spark.read.format("kafka")
.options(**read_options)
.option("subscribe", entity._online_topic_name)
Expand All @@ -302,7 +302,7 @@ def offline_fg_materialization(
)

# filter only the necassary entries
df = df.filter(
df = kafka_df.filter(
expr(
"CAST(filter(headers, header -> header.key = 'featureGroupId')[0].value AS STRING)"
)
Expand All @@ -323,7 +323,9 @@ def offline_fg_materialization(
entity.insert(deserialized_df, storage="offline")

# update offsets
df_offsets = df.groupBy("partition").agg(max("offset").alias("offset")).collect()
df_offsets = (
kafka_df.groupBy("partition").agg(max("offset").alias("offset")).collect()
)
if offset_string == "earliest":
offset_dict = {entity._online_topic_name: {}}
else:
Expand Down
Loading