Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
JkSelf committed Sep 29, 2024
1 parent 98e4c5c commit 4cbdc28
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include <folly/Singleton.h>
#include <iostream>
#include "gtest/gtest.h"
#include "velox/connectors/hive/storage_adapters/hdfs/HdfsFileSystem.h"
#include "velox/connectors/hive/storage_adapters/hdfs/tests/HdfsMiniCluster.h"
Expand All @@ -39,9 +40,11 @@ class InsertIntoHdfsTest : public HiveConnectorTestBase {
HiveConnectorTestBase::SetUp();
if (miniCluster == nullptr) {
auto httpPort = getFreePort();
auto nameNodePort = getFreePort();
nameNodePort = std::to_string(getFreePort());
std::cout << "the httpPort is " << httpPort << " the nameNode port is "
<< nameNodePort << "\n";
miniCluster = std::make_shared<filesystems::test::HdfsMiniCluster>(
std::to_string(httpPort), std::to_string(nameNodePort));
std::to_string(httpPort), nameNodePort);
miniCluster->start();
}
}
Expand All @@ -57,6 +60,7 @@ class InsertIntoHdfsTest : public HiveConnectorTestBase {

static std::shared_ptr<filesystems::test::HdfsMiniCluster> miniCluster;
RowTypePtr rowType_;
std::string nameNodePort;
};

std::shared_ptr<filesystems::test::HdfsMiniCluster>
Expand All @@ -74,7 +78,7 @@ TEST_F(InsertIntoHdfsTest, insertIntoHdfsTest) {
makeFlatVector<int16_t>(expectedRows, [](auto row) { return row; }),
makeFlatVector<double>(expectedRows, [](auto row) { return row; })});

auto outputDirectory = "hdfs://localhost:7878/";
auto outputDirectory = "hdfs://localhost:" + nameNodePort;
// INSERT INTO hdfs with one writer
auto plan = PlanBuilder()
.values({input})
Expand Down

0 comments on commit 4cbdc28

Please sign in to comment.