|
185 | 185 |
|
186 | 186 | namespace nebula {
|
187 | 187 |
|
188 |
| -#define X(EnumName, EnumNumber) EnumName = EnumNumber, |
| 188 | +#define X(EnumName, EnumNumber) EnumName = (EnumNumber), |
189 | 189 |
|
190 | 190 | enum class ErrorCode { ErrorCodeEnums };
|
191 | 191 |
|
@@ -295,7 +295,9 @@ struct ProfilingStats {
|
295 | 295 | ProfilingStatsObj.insert("rows", rows);
|
296 | 296 | ProfilingStatsObj.insert("execDurationInUs", execDurationInUs);
|
297 | 297 | ProfilingStatsObj.insert("totalDurationInUs", totalDurationInUs);
|
298 |
| - ProfilingStatsObj.insert("otherStats", folly::toDynamic(*otherStats)); |
| 298 | + if (otherStats) { |
| 299 | + ProfilingStatsObj.insert("otherStats", folly::toDynamic(*otherStats)); |
| 300 | + } |
299 | 301 |
|
300 | 302 | return ProfilingStatsObj;
|
301 | 303 | }
|
@@ -323,7 +325,7 @@ struct PlanNodeBranchInfo {
|
323 | 325 | }
|
324 | 326 |
|
325 | 327 | // True if loop body or then branch of select
|
326 |
| - bool isDoBranch{0}; |
| 328 | + bool isDoBranch{false}; |
327 | 329 | // select/loop node id
|
328 | 330 | int64_t conditionNodeId{-1};
|
329 | 331 |
|
@@ -407,22 +409,29 @@ struct PlanNodeDescription {
|
407 | 409 | planNodeDescObj.insert("id", id);
|
408 | 410 | planNodeDescObj.insert("outputVar", outputVar);
|
409 | 411 |
|
410 |
| - auto descriptionObj = folly::dynamic::array(); |
411 |
| - descriptionObj.resize(description->size()); |
412 |
| - std::transform( |
413 |
| - description->begin(), description->end(), descriptionObj.begin(), [](const auto &ele) { |
414 |
| - return ele.toJson(); |
415 |
| - }); |
416 |
| - planNodeDescObj.insert("description", descriptionObj); |
417 |
| - |
418 |
| - auto profilesObj = folly::dynamic::array(); |
419 |
| - profilesObj.resize(profiles->size()); |
420 |
| - std::transform(profiles->begin(), profiles->end(), profilesObj.begin(), [](const auto &ele) { |
421 |
| - return ele.toJson(); |
422 |
| - }); |
423 |
| - planNodeDescObj.insert("profiles", profilesObj); |
424 |
| - planNodeDescObj.insert("branchInfo", branchInfo->toJson()); |
425 |
| - planNodeDescObj.insert("dependencies", folly::toDynamic(*dependencies)); |
| 412 | + if (description) { |
| 413 | + auto descriptionObj = folly::dynamic::array(); |
| 414 | + descriptionObj.resize(description->size()); |
| 415 | + std::transform( |
| 416 | + description->begin(), description->end(), descriptionObj.begin(), [](const auto &ele) { |
| 417 | + return ele.toJson(); |
| 418 | + }); |
| 419 | + planNodeDescObj.insert("description", descriptionObj); |
| 420 | + } |
| 421 | + if (profiles) { |
| 422 | + auto profilesObj = folly::dynamic::array(); |
| 423 | + profilesObj.resize(profiles->size()); |
| 424 | + std::transform(profiles->begin(), profiles->end(), profilesObj.begin(), [](const auto &ele) { |
| 425 | + return ele.toJson(); |
| 426 | + }); |
| 427 | + planNodeDescObj.insert("profiles", profilesObj); |
| 428 | + } |
| 429 | + if (branchInfo) { |
| 430 | + planNodeDescObj.insert("branchInfo", branchInfo->toJson()); |
| 431 | + } |
| 432 | + if (dependencies) { |
| 433 | + planNodeDescObj.insert("dependencies", folly::toDynamic(*dependencies)); |
| 434 | + } |
426 | 435 |
|
427 | 436 | return planNodeDescObj;
|
428 | 437 | }
|
@@ -536,7 +545,7 @@ struct ExecutionResponse {
|
536 | 545 | std::unique_ptr<PlanDescription> planDesc{nullptr};
|
537 | 546 | std::unique_ptr<std::string> comment{nullptr};
|
538 | 547 |
|
539 |
| - // Return the response as a JSON string |
| 548 | + // Returns the response as a JSON string |
540 | 549 | // only errorCode and latencyInUs are required fields, the rest are optional
|
541 | 550 | // if the dataset contains a value of TIME or DATETIME, it will be returned in UTC.
|
542 | 551 | //
|
|
0 commit comments