Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohahaha committed Jan 2, 2024
1 parent a463f24 commit d7339d2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp/core/jni/JniCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ static inline jmethodID getStaticMethodIdOrError(JNIEnv* env, jclass thisClass,
static inline void attachCurrentThreadAsDaemonOrThrow(JavaVM* vm, JNIEnv** out) {
int getEnvStat = vm->GetEnv(reinterpret_cast<void**>(out), jniVersion);
if (getEnvStat == JNI_EDETACHED) {
DLOG(INFO) << "JNIEnv was not attached to current thread.";
// Reattach current thread to JVM
getEnvStat = vm->AttachCurrentThreadAsDaemon(reinterpret_cast<void**>(out), NULL);
if (getEnvStat != JNI_OK) {
throw gluten::GlutenException("Failed to reattach current thread to JVM.");
}
DLOG(INFO) << "Succeeded attaching current thread.";
return;
}
if (getEnvStat != JNI_OK) {
Expand Down
1 change: 1 addition & 0 deletions cpp/core/shuffle/LocalPartitionWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class FlushOnSpillEvictHandle final : public LocalPartitionWriter::LocalEvictHan
ARROW_ASSIGN_OR_RAISE(auto start, os_->Tell());
RETURN_NOT_OK(arrow::ipc::WriteIpcPayload(*payload, options_, os_.get(), &metadataLength));
ARROW_ASSIGN_OR_RAISE(auto end, os_->Tell());
DLOG(INFO) << "Spilled partition " << partitionId << " file start: " << start << ", file end: " << end;
spillInfo_->partitionSpillInfos.push_back({partitionId, end - start});
return arrow::Status::OK();
}
Expand Down
7 changes: 7 additions & 0 deletions cpp/velox/benchmarks/common/OrcReaderIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class OrcStreamReaderIterator final : public OrcReaderIterator {
std::shared_ptr<gluten::ColumnarBatch> next() override {
auto startTime = std::chrono::steady_clock::now();
GLUTEN_ASSIGN_OR_THROW(auto batch, recordBatchReader_->Next());
DLOG(INFO) << "OrcStreamReaderIterator get a batch, num rows: " << (batch ? batch->num_rows() : 0);
collectBatchTime_ +=
std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now() - startTime).count();
if (batch == nullptr) {
Expand All @@ -76,6 +77,12 @@ class OrcBufferedReaderIterator final : public OrcReaderIterator {
createReader();
collectBatches();
iter_ = batches_.begin();
DLOG(INFO) << "OrcBufferedReaderIterator open file: " << path;
DLOG(INFO) << "Number of input batches: " << std::to_string(batches_.size());
if (iter_ != batches_.cend()) {
DLOG(INFO) << "columns: " << (*iter_)->num_columns();
DLOG(INFO) << "rows: " << (*iter_)->num_rows();
}
}

std::shared_ptr<gluten::ColumnarBatch> next() override {
Expand Down
8 changes: 8 additions & 0 deletions cpp/velox/benchmarks/common/ParquetReaderIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ class ParquetStreamReaderIterator final : public ParquetReaderIterator {
public:
explicit ParquetStreamReaderIterator(const std::string& path) : ParquetReaderIterator(path) {
createReader();
DLOG(INFO) << "ParquetStreamReaderIterator open file: " << path;
}

std::shared_ptr<gluten::ColumnarBatch> next() override {
auto startTime = std::chrono::steady_clock::now();
GLUTEN_ASSIGN_OR_THROW(auto batch, recordBatchReader_->Next());
DLOG(INFO) << "ParquetStreamReaderIterator get a batch, num rows: " << (batch ? batch->num_rows() : 0);
collectBatchTime_ +=
std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now() - startTime).count();
if (batch == nullptr) {
Expand All @@ -70,6 +72,12 @@ class ParquetBufferedReaderIterator final : public ParquetReaderIterator {
createReader();
collectBatches();
iter_ = batches_.begin();
DLOG(INFO) << "ParquetBufferedReaderIterator open file: " << path;
DLOG(INFO) << "Number of input batches: " << std::to_string(batches_.size());
if (iter_ != batches_.cend()) {
DLOG(INFO) << "columns: " << (*iter_)->num_columns();
DLOG(INFO) << "rows: " << (*iter_)->num_rows();
}
}

std::shared_ptr<gluten::ColumnarBatch> next() override {
Expand Down
1 change: 1 addition & 0 deletions cpp/velox/compute/VeloxPlanConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ std::shared_ptr<const facebook::velox::core::PlanNode> VeloxPlanConverter::toVel
}
}
auto veloxPlan = substraitVeloxPlanConverter_.toVeloxPlan(substraitPlan);
DLOG(INFO) << "Plan Node: " << std::endl << veloxPlan->toString(true, true);
return veloxPlan;
}

Expand Down

0 comments on commit d7339d2

Please sign in to comment.