| 177 | } |
| 178 | |
| 179 | func NewFieldFromRLE(sctx *super.Context, vec Any, length uint32, runlens []uint32) Any { |
| 180 | if len(runlens) == 0 { |
| 181 | return vec |
| 182 | } |
| 183 | tags, noneLen := buildTags(runlens, length) |
| 184 | if noneLen == 0 { |
| 185 | // This field is optional but everything is here in this instance. |
| 186 | return vec |
| 187 | } |
| 188 | return &Optional{NewDynamic(tags, []Any{vec, NewNone(sctx, vec.Type(), noneLen)})} |
| 189 | } |
| 190 | |
| 191 | // An Optional value is a special Dynamic that has two tags comprising the |
| 192 | // values present and the Nones. |