Skip to content

Commit 3d6ab40

Browse files
CudfFromVelox supports cudf table
1 parent 19ec959 commit 3d6ab40

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

velox/experimental/cudf/exec/CudfConversion.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ void CudfFromVelox::addInput(RowVectorPtr input) {
8686
VELOX_NVTX_OPERATOR_FUNC_RANGE();
8787
if (input->size() > 0) {
8888
// Materialize lazy vectors
89-
for (auto& child : input->children()) {
90-
child->loadedVector();
89+
if (!std::dynamic_pointer_cast<CudfVector>(input)) {
90+
for (auto& child : input->children()) {
91+
child->loadedVector();
92+
}
93+
input->loadedVector();
94+
} else {
95+
isCudfVector_ = true;
9196
}
92-
input->loadedVector();
9397

9498
// Accumulate inputs
9599
inputs_.push_back(input);
@@ -110,6 +114,13 @@ RowVectorPtr CudfFromVelox::getOutput() {
110114
return nullptr;
111115
}
112116

117+
if (isCudfVector_) {
118+
auto first = inputs_.front();
119+
inputs_.erase(inputs_.begin());
120+
currentOutputSize_ -= first->size();
121+
return first;
122+
}
123+
113124
// Select inputs that don't exceed the max vector size limit
114125
std::vector<RowVectorPtr> selectedInputs;
115126
vector_size_t totalSize = 0;

velox/experimental/cudf/exec/CudfConversion.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class CudfFromVelox : public exec::Operator, public NvtxHelper {
6262
std::vector<RowVectorPtr> inputs_;
6363
std::size_t currentOutputSize_ = 0;
6464
bool finished_ = false;
65+
bool isCudfVector_ = false;
6566
};
6667

6768
class CudfToVelox : public exec::Operator, public NvtxHelper {

0 commit comments

Comments
 (0)