Returns the number of floating-point columns and a list of columns indices with floating-point columns placed at the end.
| 1084 | EXPECT_EQ(*expectedType, *result->type()); |
| 1085 | actualNumRows += result->size(); |
| 1086 | } |
| 1087 | EXPECT_EQ(expectedNumRows, actualNumRows); |
| 1088 | } |
| 1089 | |
| 1090 | /// Returns the number of floating-point columns and a list of columns indices |
| 1091 | /// with floating-point columns placed at the end. |
| 1092 | std::tuple<uint32_t, std::vector<bolt::column_index_t>> |
| 1093 | findFloatingPointColumns(const MaterializedRow& row) { |
| 1094 | auto isFloatingPointColumn = [&](size_t i) { |
| 1095 | return row[i].kind() == TypeKind::REAL || row[i].kind() == TypeKind::DOUBLE; |
| 1096 | }; |
| 1097 | |
| 1098 | uint32_t numFloatingPointColumns = 0; |
| 1099 | std::vector<bolt::column_index_t> indices; |
| 1100 | for (auto i = 0; i < row.size(); ++i) { |
| 1101 | if (isFloatingPointColumn(i)) { |
| 1102 | ++numFloatingPointColumns; |
| 1103 | } else { |
| 1104 | indices.push_back(i); |
| 1105 | } |
| 1106 | } |
| 1107 | |
| 1108 | for (auto i = 0; i < row.size(); ++i) { |
| 1109 | if (isFloatingPointColumn(i)) { |
| 1110 | indices.push_back(i); |
| 1111 | } |
no test coverage detected