Skip to content

Commit 775efc3

Browse files
Change name (#221)
1 parent 9bcea72 commit 775efc3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fink_utils/spark/schema_converter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@ def _parse_struct(
146146
else:
147147
avroRecord["name"] = "topLevelRecord." + name
148148
else:
149-
avroRecord["name"] = "topLevelRecord"
149+
if from_map:
150+
avroRecord["name"] = "topLevelRecord"
151+
else:
152+
# FIXME: this might be unsafe if there are
153+
# more than 1 map with no name...
154+
avroRecord["name"] = "topLevelRecord.value"
150155
if data["type"] not in ["struct"]:
151156
raise ValueError("Expected ['struct'] type, is ", data["type"])
152157
avroRecord["fields"] = []

0 commit comments

Comments
 (0)