Skip to content

Commit

Permalink
Working code
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Abraham committed Oct 29, 2024
1 parent 76ff5fe commit a8afff9
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 17,916 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ void to_json(json& j, const std::shared_ptr<FunctionHandle>& p) {
j = *std::static_pointer_cast<SqlFunctionHandle>(p);
return;
}
if (type == "rest") {
j = *std::static_pointer_cast<RestFunctionHandle>(p);
return;
}

throw TypeError(type + " no abstract type FunctionHandle ");
}
Expand All @@ -138,6 +142,13 @@ void from_json(const json& j, std::shared_ptr<FunctionHandle>& p) {
p = std::static_pointer_cast<FunctionHandle>(k);
return;
}
if (type == "rest") {
std::shared_ptr<RestFunctionHandle> k =
std::make_shared<RestFunctionHandle>();
j.get_to(*k);
p = std::static_pointer_cast<FunctionHandle>(k);
return;
}

throw TypeError(type + " no abstract type FunctionHandle ");
}
Expand Down Expand Up @@ -8117,6 +8128,52 @@ void from_json(const json& j, RemoteTransactionHandle& p) {
}
} // namespace facebook::presto::protocol
namespace facebook::presto::protocol {
RestFunctionHandle::RestFunctionHandle() noexcept {
_type = "rest";
}

void to_json(json& j, const RestFunctionHandle& p) {
j = json::object();
j["@type"] = "rest";
to_json_key(
j,
"functionId",
p.functionId,
"RestFunctionHandle",
"SqlFunctionId",
"functionId");
to_json_key(
j, "version", p.version, "RestFunctionHandle", "String", "version");
to_json_key(
j,
"signature",
p.signature,
"RestFunctionHandle",
"Signature",
"signature");
}

void from_json(const json& j, RestFunctionHandle& p) {
p._type = j["@type"];
from_json_key(
j,
"functionId",
p.functionId,
"RestFunctionHandle",
"SqlFunctionId",
"functionId");
from_json_key(
j, "version", p.version, "RestFunctionHandle", "String", "version");
from_json_key(
j,
"signature",
p.signature,
"RestFunctionHandle",
"Signature",
"signature");
}
} // namespace facebook::presto::protocol
namespace facebook::presto::protocol {
RowNumberNode::RowNumberNode() noexcept {
_type = "com.facebook.presto.sql.planner.plan.RowNumberNode";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1917,6 +1917,17 @@ void to_json(json& j, const RemoteTransactionHandle& p);
void from_json(const json& j, RemoteTransactionHandle& p);
} // namespace facebook::presto::protocol
namespace facebook::presto::protocol {
struct RestFunctionHandle : public FunctionHandle {
SqlFunctionId functionId = {};
String version = {};
Signature signature = {};

RestFunctionHandle() noexcept;
};
void to_json(json& j, const RestFunctionHandle& p);
void from_json(const json& j, RestFunctionHandle& p);
} // namespace facebook::presto::protocol
namespace facebook::presto::protocol {
struct RowNumberNode : public PlanNode {
std::shared_ptr<PlanNode> source = {};
List<VariableReferenceExpression> partitionBy = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ AbstractClasses:
subclasses:
- { name: BuiltInFunctionHandle, key: $static }
- { name: SqlFunctionHandle, key: json_file }

- { name: RestFunctionHandle, key: rest }

JavaClasses:
- presto-spi/src/main/java/com/facebook/presto/spi/ErrorCause.java
Expand All @@ -190,6 +190,7 @@ JavaClasses:
- presto-main/src/main/java/com/facebook/presto/execution/buffer/BufferState.java
- presto-main/src/main/java/com/facebook/presto/metadata/BuiltInFunctionHandle.java
- presto-spi/src/main/java/com/facebook/presto/spi/function/SqlFunctionHandle.java
- presto-spi/src/main/java/com/facebook/presto/spi/function/RestFunctionHandle.java
- presto-hdfs-core/src/main/java/com/facebook/presto/hive/CacheQuotaRequirement.java
- presto-hdfs-core/src/main/java/com/facebook/presto/hive/CacheQuotaScope.java
- presto-spi/src/main/java/com/facebook/presto/spi/relation/CallExpression.java
Expand Down
Loading

0 comments on commit a8afff9

Please sign in to comment.