-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve duckdb scanner extension (#3338)
- Loading branch information
1 parent
e171061
commit 48ae5e8
Showing
22 changed files
with
161 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include "extension/extension_action.h" | ||
#include "logical_simple.h" | ||
|
||
namespace kuzu { | ||
namespace planner { | ||
|
||
using namespace kuzu::extension; | ||
|
||
class LogicalExtension final : public LogicalSimple { | ||
public: | ||
LogicalExtension(ExtensionAction action, std::string path, | ||
std::shared_ptr<binder::Expression> outputExpression) | ||
: LogicalSimple{LogicalOperatorType::EXTENSION, std::move(outputExpression)}, | ||
action{action}, path{std::move(path)} {} | ||
|
||
std::string getExpressionsForPrinting() const override { return path; } | ||
|
||
ExtensionAction getAction() const { return action; } | ||
std::string getPath() const { return path; } | ||
|
||
std::unique_ptr<LogicalOperator> copy() override { | ||
return std::make_unique<LogicalExtension>(action, path, outputExpression); | ||
} | ||
|
||
private: | ||
ExtensionAction action; | ||
std::string path; | ||
}; | ||
|
||
} // namespace planner | ||
} // namespace kuzu |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include "processor/operator/simple/simple.h" | ||
|
||
namespace kuzu { | ||
namespace processor { | ||
|
||
class InstallExtension final : public Simple { | ||
public: | ||
InstallExtension(std::string name, const DataPos& outputPos, uint32_t id, | ||
const std::string& paramsString) | ||
: Simple{PhysicalOperatorType::INSTALL_EXTENSION, outputPos, id, paramsString}, | ||
name{std::move(name)} {} | ||
|
||
void executeInternal(ExecutionContext* context) override; | ||
std::string getOutputMsg() override; | ||
|
||
std::unique_ptr<PhysicalOperator> clone() override { | ||
return std::make_unique<InstallExtension>(name, outputPos, id, paramsString); | ||
} | ||
|
||
private: | ||
std::string tryDownloadExtension(); | ||
|
||
void saveExtensionToLocalFile(const std::string& extensionData, main::ClientContext* context); | ||
|
||
void installExtension(main::ClientContext* context); | ||
|
||
private: | ||
std::string name; | ||
}; | ||
|
||
} // namespace processor | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include "processor/operator/simple/simple.h" | ||
|
||
namespace kuzu { | ||
namespace processor { | ||
|
||
class LoadExtension final : public Simple { | ||
public: | ||
LoadExtension(std::string path, const DataPos& outputPos, uint32_t id, | ||
const std::string& paramsString) | ||
: Simple{PhysicalOperatorType::LOAD_EXTENSION, outputPos, id, paramsString}, | ||
path{std::move(path)} {} | ||
|
||
void executeInternal(ExecutionContext* context) override; | ||
std::string getOutputMsg() override; | ||
|
||
std::unique_ptr<PhysicalOperator> clone() override { | ||
return std::make_unique<LoadExtension>(path, outputPos, id, paramsString); | ||
} | ||
|
||
private: | ||
std::string path; | ||
}; | ||
|
||
} // namespace processor | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.