MCPcopy Create free account
hub / github.com/bytedance/bolt / findFloatingPointColumns

Function findFloatingPointColumns

bolt/exec/tests/utils/QueryAssertions.cpp:1086–1108  ·  view source on GitHub ↗

Returns the number of floating-point columns and a list of columns indices with floating-point columns placed at the end.

Source from the content-addressed store, hash-verified

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.
1092std::tuple<uint32_t, std::vector<bolt::column_index_t>>
1093findFloatingPointColumns(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 }

Callers 2

assertEqualResultsFunction · 0.85
compareOrderedPartitionsFunction · 0.85

Calls 3

kindMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected