Skip to content

Commit 0e13573

Browse files
rebstasticadchia
authored andcommitted
fix: Handle complex Spark data types in SparkSource (#3154)
* Make sure data types are strings Signed-off-by: Petra Rebernjak <[email protected]> * Lint Signed-off-by: Petra Rebernjak <[email protected]> Signed-off-by: Petra Rebernjak <[email protected]>
1 parent 1ee39fe commit 0e13573

File tree

1 file changed

+1
-4
lines changed
  • sdk/python/feast/infra/offline_stores/contrib/spark_offline_store

1 file changed

+1
-4
lines changed

sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark_source.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ def get_table_column_names_and_types(
159159
store_config=config.offline_store
160160
)
161161
df = spark_session.sql(f"SELECT * FROM {self.get_table_query_string()}")
162-
return (
163-
(fields["name"], fields["type"])
164-
for fields in df.schema.jsonValue()["fields"]
165-
)
162+
return ((field.name, field.dataType.simpleString()) for field in df.schema)
166163

167164
def get_table_query_string(self) -> str:
168165
"""Returns a string that can directly be used to reference this table in SQL"""

0 commit comments

Comments
 (0)