File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -873,13 +873,26 @@ def feast_value_type_to_pa(
873873
874874
875875def pg_type_code_to_pg_type (code : int ) -> str :
876- return {
876+ """ Map the postgres type code a Feast type string
877+
878+ Rather than raise an exception on an unknown type, we return the
879+ string representation of the type code. This way rather than raising
880+ an exception on unknown types, Feast will just skip the problem columns.
881+
882+ Note that json and jsonb are not supported but this shows up in the
883+ log as a warning. Since postgres allows custom types we return an unknown for those cases.
884+
885+ See: https://jdbc.postgresql.org/documentation/publicapi/index.html?constant-values.html
886+ """
887+ PG_TYPE_MAP = {
877888 16 : "boolean" ,
878889 17 : "bytea" ,
879890 20 : "bigint" ,
880891 21 : "smallint" ,
881892 23 : "integer" ,
882893 25 : "text" ,
894+ 114 : "json" ,
895+ 199 : "json[]" ,
883896 700 : "real" ,
884897 701 : "double precision" ,
885898 1000 : "boolean[]" ,
@@ -905,7 +918,11 @@ def pg_type_code_to_pg_type(code: int) -> str:
905918 1700 : "numeric" ,
906919 2950 : "uuid" ,
907920 2951 : "uuid[]" ,
908- }[code ]
921+ 3802 : "jsonb" ,
922+ 3807 : "jsonb[]" ,
923+ }
924+
925+ return PG_TYPE_MAP .get (code , "unknown" )
909926
910927
911928def pg_type_code_to_arrow (code : int ) -> str :
You can’t perform that action at this time.
0 commit comments