Skip to content

Commit

Permalink
fix: Snowflake infer snowflake OBJECT return type for number inference
Browse files Browse the repository at this point in the history
Signed-off-by: miles.adkins <miles.adkins@snowflake.com>
  • Loading branch information
sfc-gh-madkins committed Oct 26, 2022
1 parent 1935294 commit 3b3fbac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sdk/python/feast/infra/offline_stores/snowflake_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,13 @@ def get_table_column_names_and_types(
else:
if len(result) > 0:
max_value = result.iloc[0][0]
if max_value is not None and len(str(max_value)) <= 18:
row["snowflake_type"] = "NUMBER"
if max_value is not None and len(str(max_value)) <= 9:
row["snowflake_type"] = "NUMBER32"
continue
elif (
max_value is not None and len(str(max_value)) <= 18
):
row["snowflake_type"] = "NUMBER64"
continue
raise NotImplementedError(
"NaNs or Numbers larger than INT64 are not supported"
Expand Down

0 comments on commit 3b3fbac

Please sign in to comment.