| 1370 | auto fnName = codeGenerator.GetCmpFuncName(); |
| 1371 | auto moduleSP = codeGenerator.codegen(); |
| 1372 | return {std::move(moduleSP), std::move(fnName)}; |
| 1373 | } |
| 1374 | |
| 1375 | std::tuple<bytedance::bolt::jit::CompiledModuleSP, std::string> |
| 1376 | RowContainer::codegenRowEqVectors( |
| 1377 | const std::vector<TypePtr>& keyTypes, |
| 1378 | bool haveNulls) { |
| 1379 | // Setup the CodeGenerator |
| 1380 | bytedance::bolt::jit::RowEqVectorsCodeGenerator codeGenerator; |
| 1381 | { |
| 1382 | std::vector<TypePtr> keyTypeKinds; |
| 1383 | std::vector<int32_t> nullByteOffsets; |
| 1384 | std::vector<int8_t> nullByteMasks; |
| 1385 | std::vector<int32_t> keyOffsets; |
| 1386 | |
| 1387 | for (auto i = 0; i < keyTypes.size(); ++i) { |
| 1388 | keyTypeKinds.emplace_back(keyTypes[i]); |
| 1389 | auto col = this->columnAt(i); |
| 1390 | keyOffsets.emplace_back(col.offset()); |
| 1391 | nullByteOffsets.emplace_back(col.nullByte()); |
| 1392 | nullByteMasks.emplace_back(col.nullMask()); |
| 1393 | } |
| 1394 | codeGenerator.setKeyTypes(std::move(keyTypeKinds)) |
| 1395 | .setKeyOffsets(std::move(keyOffsets)) |
| 1396 | .setNullByteOffsets(std::move(nullByteOffsets)) |
| 1397 | .setNullMasks(std::move(nullByteMasks)) |
| 1398 | .setHasNullKeys(haveNulls); |
| 1399 | } |
| 1400 | |
| 1401 | auto fnName = codeGenerator.GetCmpFuncName(); |
| 1402 | auto moduleSP = codeGenerator.codegen(); |
| 1403 | |
| 1404 | return {std::move(moduleSP), std::move(fnName)}; |
| 1405 | } |