Commit 7af45f9
committed
feat: support pyarrow float16 by widening to float on read/write
PyArrow's float16 (halffloat) raised UnsupportedPyArrowTypeException
during schema conversion because _ConvertToIceberg.primitive only
handled float32/float64. Iceberg has no half-precision float, but
float16 -> float32 is lossless, mirroring how int8/int16 already widen
to IntegerType. Map float16 to FloatType, and widen smaller float arrays
to the target type in ArrowProjectionVisitor._cast_if_needed (parallel
to the integer-widening branch) so float16 columns write as float32.1 parent 9d36e23 commit 7af45f9
3 files changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
1441 | 1444 | | |
1442 | 1445 | | |
1443 | 1446 | | |
| |||
1978 | 1981 | | |
1979 | 1982 | | |
1980 | 1983 | | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
1981 | 1993 | | |
1982 | 1994 | | |
1983 | 1995 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3109 | 3109 | | |
3110 | 3110 | | |
3111 | 3111 | | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
3112 | 3141 | | |
3113 | 3142 | | |
3114 | 3143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
| |||
0 commit comments