| 262 | } |
| 263 | |
| 264 | bool HdfsScanner::WriteCompleteTuple(MemPool* pool, FieldLocation* fields, |
| 265 | Tuple* tuple, TupleRow* tuple_row, Tuple* template_tuple, |
| 266 | uint8_t* error_fields, uint8_t* error_in_row) { |
| 267 | *error_in_row = false; |
| 268 | // Initialize tuple before materializing slots |
| 269 | InitTuple(template_tuple, tuple); |
| 270 | |
| 271 | for (int i = 0; i < scan_node_->materialized_slots().size(); ++i) { |
| 272 | int need_escape = false; |
| 273 | int len = fields[i].len; |
| 274 | if (UNLIKELY(len < 0)) { |
| 275 | len = -len; |
| 276 | need_escape = true; |
| 277 | } |
| 278 | |
| 279 | const SlotDescriptor* slot_desc = scan_node_->materialized_slots()[i]; |
| 280 | bool error = !text_converter_->WriteSlot(slot_desc, tuple, fields[i].start, len, |
| 281 | false, need_escape, pool); |
| 282 | error_fields[i] = error; |
| 283 | *error_in_row |= error; |
| 284 | } |
| 285 | |
| 286 | tuple_row->SetTuple(0, tuple); |
| 287 | return EvalConjuncts(tuple_row); |
| 288 | } |
| 289 | |
| 290 | // Codegen for WriteTuple(above) for writing out single nullable string slot and |
| 291 | // evaluating a <slot> = <constantexpr> conjunct. The signature matches WriteTuple() |