Skip to content

Commit 53eb9b8

Browse files
committed
fix style
1 parent d2afd5f commit 53eb9b8

File tree

5 files changed

+127
-112
lines changed

5 files changed

+127
-112
lines changed

velox/experimental/cudf/exec/CudfConversion.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ RowVectorPtr CudfFromVelox::getOutput() {
121121
auto input = mergeRowVectors(selectedInputs, inputs_[0]->pool());
122122
// print physical type of each column in output
123123
for (auto i = 0; i < input->type()->size(); i++) {
124-
std::cout << "input column " << i << " type: " << input->childAt(i)->type()->toString() << " " << input->childAt(i)->type()->kindName() << std::endl;
124+
std::cout << "input column " << i
125+
<< " type: " << input->childAt(i)->type()->toString() << " "
126+
<< input->childAt(i)->type()->kindName() << std::endl;
125127
}
126128
// Remove processed inputs
127129
inputs_.erase(inputs_.begin(), inputs_.begin() + selectedInputs.size());
@@ -137,9 +139,11 @@ RowVectorPtr CudfFromVelox::getOutput() {
137139

138140
// Convert RowVector to cudf table
139141
auto tbl = with_arrow::toCudfTable(input, input->pool(), stream);
140-
// print types of tbl->view()
142+
// print types of tbl->view()
141143
for (auto i = 0; i < tbl->num_columns(); i++) {
142-
std::cout << "input cudf column " << i << " type: " << static_cast<int>(tbl->get_column(i).type().id()) << std::endl;
144+
std::cout << "input cudf column " << i
145+
<< " type: " << static_cast<int>(tbl->get_column(i).type().id())
146+
<< std::endl;
143147
}
144148

145149
stream.synchronize();
@@ -216,19 +220,25 @@ RowVectorPtr CudfToVelox::getOutput() {
216220

217221
// print types of tbl->view()
218222
for (auto i = 0; i < tbl->num_columns(); i++) {
219-
std::cout << "cudf column " << i << " type: " << static_cast<int>(tbl->get_column(i).type().id()) << std::endl;
223+
std::cout << "cudf column " << i
224+
<< " type: " << static_cast<int>(tbl->get_column(i).type().id())
225+
<< std::endl;
220226
}
221227
stream.synchronize();
222228
finished_ = noMoreInput_ && inputs_.empty();
223229
std::cout << "output.type: " << output->type()->toString() << std::endl;
224230
std::cout << "outputType_: " << outputType_->toString() << std::endl;
225231
// print physical type of each column in output
226232
for (auto i = 0; i < output->type()->size(); i++) {
227-
std::cout << "column " << i << " type: " << output->childAt(i)->type()->toString() << " " << output->childAt(i)->type()->kindName() << std::endl;
233+
std::cout << "column " << i
234+
<< " type: " << output->childAt(i)->type()->toString() << " "
235+
<< output->childAt(i)->type()->kindName() << std::endl;
228236
}
229237
// print physical type of each column in outputType_
230238
for (auto i = 0; i < outputType_->size(); i++) {
231-
std::cout << "column " << i << " type: " << outputType_->childAt(i)->toString() << " " << outputType_->childAt(i)->kindName() << std::endl;
239+
std::cout << "column " << i
240+
<< " type: " << outputType_->childAt(i)->toString() << " "
241+
<< outputType_->childAt(i)->kindName() << std::endl;
232242
}
233243
output->setType(outputType_);
234244
return output;

velox/experimental/cudf/exec/VeloxCudfInterop.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,34 +84,34 @@ cudf::type_id velox_to_cudf_type_id(const TypePtr& type) {
8484
}
8585
namespace with_arrow {
8686

87+
// Print ArrowSchema format strings recursively
88+
void printArrowSchemaFormat(const ArrowSchema& arrowSchema, int depth = 0) {
89+
std::string indent(depth * 2, ' ');
90+
if (depth == 0) {
91+
std::cout << "arrowSchema.format: " << arrowSchema.format << std::endl;
92+
}
8793

88-
// Print ArrowSchema format strings recursively
89-
void printArrowSchemaFormat(const ArrowSchema& arrowSchema, int depth = 0) {
90-
std::string indent(depth * 2, ' ');
91-
if (depth == 0) {
92-
std::cout << "arrowSchema.format: " << arrowSchema.format << std::endl;
93-
}
94-
95-
for (int64_t i = 0; i < arrowSchema.n_children; ++i) {
96-
const ArrowSchema* child = arrowSchema.children[i];
97-
if (child != nullptr) {
98-
std::cout << indent << " child[" << i << "].format: "
99-
<< child->format << std::endl;
100-
if (child->n_children > 0) {
101-
printArrowSchemaFormat(*child, depth + 1);
102-
}
94+
for (int64_t i = 0; i < arrowSchema.n_children; ++i) {
95+
const ArrowSchema* child = arrowSchema.children[i];
96+
if (child != nullptr) {
97+
std::cout << indent << " child[" << i << "].format: " << child->format
98+
<< std::endl;
99+
if (child->n_children > 0) {
100+
printArrowSchemaFormat(*child, depth + 1);
103101
}
104102
}
105-
106-
if (arrowSchema.dictionary != nullptr) {
107-
std::cout << indent << " dictionary.format: "
108-
<< arrowSchema.dictionary->format << std::endl;
109-
if (arrowSchema.dictionary->n_children > 0) {
110-
printArrowSchemaFormat(*arrowSchema.dictionary, depth + 1);
111-
}
103+
}
104+
105+
if (arrowSchema.dictionary != nullptr) {
106+
std::cout << indent
107+
<< " dictionary.format: " << arrowSchema.dictionary->format
108+
<< std::endl;
109+
if (arrowSchema.dictionary->n_children > 0) {
110+
printArrowSchemaFormat(*arrowSchema.dictionary, depth + 1);
112111
}
113112
}
114-
113+
}
114+
115115
std::unique_ptr<cudf::table> toCudfTable(
116116
const facebook::velox::RowVectorPtr& veloxTable,
117117
facebook::velox::memory::MemoryPool* pool,

0 commit comments

Comments
 (0)