| 1346 | } |
| 1347 | |
| 1348 | func hostToDeviceColumn(hostColumn memCom.HostVectorPartySlice, device int) deviceVectorPartySlice { |
| 1349 | deviceColumn := deviceVectorPartySlice{ |
| 1350 | length: hostColumn.Length, |
| 1351 | valueType: hostColumn.ValueType, |
| 1352 | defaultValue: hostColumn.DefaultValue, |
| 1353 | valueStartIndex: hostColumn.ValueStartIndex, |
| 1354 | nullStartIndex: hostColumn.NullStartIndex, |
| 1355 | countStartIndex: hostColumn.CountStartIndex, |
| 1356 | } |
| 1357 | totalColumnBytes := hostColumn.ValueBytes + hostColumn.NullBytes + hostColumn.CountBytes |
| 1358 | |
| 1359 | if totalColumnBytes > 0 { |
| 1360 | deviceColumn.basePtr = deviceAllocate(totalColumnBytes, device) |
| 1361 | if hostColumn.Counts != nil { |
| 1362 | deviceColumn.counts = deviceColumn.basePtr.offset(0) |
| 1363 | } |
| 1364 | |
| 1365 | if hostColumn.Nulls != nil { |
| 1366 | deviceColumn.nulls = deviceColumn.basePtr.offset(hostColumn.CountBytes) |
| 1367 | } |
| 1368 | |
| 1369 | deviceColumn.values = deviceColumn.basePtr.offset( |
| 1370 | hostColumn.NullBytes + hostColumn.CountBytes) |
| 1371 | } |
| 1372 | return deviceColumn |
| 1373 | } |
| 1374 | |
| 1375 | // shouldSkipLiveBatch will determine whether we can skip processing a live batch by checking time filter and |
| 1376 | // eligible main table common filters. The batch must be non nil. |