|
18 | 18 | #include "velox/experimental/cudf/exec/ExpressionEvaluator.h" |
19 | 19 | #include "velox/experimental/cudf/exec/ToCudf.h" |
20 | 20 | #include "velox/experimental/cudf/exec/Utilities.h" |
| 21 | +#include "velox/experimental/cudf/exec/VeloxCudfInterop.h" |
21 | 22 |
|
22 | 23 | #include "velox/exec/Task.h" |
23 | 24 |
|
@@ -407,6 +408,25 @@ RowVectorPtr CudfHashJoinProbe::getOutput() { |
407 | 408 | auto leftTableView = leftTable->view(); |
408 | 409 | auto rightTableView = rightTable->view(); |
409 | 410 |
|
| 411 | + // add env variable to print the table |
| 412 | + if (std::getenv("PRINT_TABLE") != nullptr && std::string(std::getenv("PRINT_TABLE")) == "1") { |
| 413 | + // debug print leftTable |
| 414 | + auto leftTableVelox = facebook::velox::cudf_velox::with_arrow::toVeloxColumn(leftTableView, pool(), "", stream); |
| 415 | + std::cout << "Left table: " << std::endl << leftTableVelox->toString(); |
| 416 | + for (int i = 0; i < leftTableVelox->size(); i++) { |
| 417 | + std::cout << leftTableVelox->toString(i) << std::endl; |
| 418 | + } |
| 419 | + std::cout << std::endl << "--------------------------------" << std::endl; |
| 420 | + // debug print rightTable |
| 421 | + auto rightTableVelox = facebook::velox::cudf_velox::with_arrow::toVeloxColumn(rightTableView, pool(), "", stream); |
| 422 | + std::cout << "Right table: " << std::endl << rightTableVelox->toString(); |
| 423 | + for (int i = 0; i < rightTableVelox->size(); i++) { |
| 424 | + std::cout << rightTableVelox->toString(i) << std::endl; |
| 425 | + } |
| 426 | + } |
| 427 | + |
| 428 | + std::cout << std::endl << "--------------------------------" << std::endl; |
| 429 | + |
410 | 430 | if (joinNode_->isInnerJoin()) { |
411 | 431 | // left = probe, right = build |
412 | 432 | if (joinNode_->filter()) { |
@@ -519,6 +539,9 @@ RowVectorPtr CudfHashJoinProbe::getOutput() { |
519 | 539 | } else { |
520 | 540 | VELOX_FAIL("Unsupported join type: ", joinNode_->joinType()); |
521 | 541 | } |
| 542 | + // print info about leftJoinIndices and rightJoinIndices |
| 543 | + std::cout << "Left join indices: " << leftJoinIndices->size() << std::endl; |
| 544 | + std::cout << "Right join indices: " << rightJoinIndices->size() << std::endl; |
522 | 545 | auto leftIndicesSpan = leftJoinIndices |
523 | 546 | ? cudf::device_span<cudf::size_type const>{*leftJoinIndices} |
524 | 547 | : cudf::device_span<cudf::size_type const>{}; |
|
0 commit comments