MCPcopy Create free account
hub / github.com/ByConity/ByConity / fromProto

Method fromProto

src/QueryPlan/JoinStep.cpp:508–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508std::shared_ptr<JoinStep> JoinStep::fromProto(const Protos::JoinStep & proto, ContextPtr)
509{
510 DataStreams input_streams;
511 for (const auto & proto_element : proto.input_streams())
512 {
513 DataStream element;
514 element.fillFromProto(proto_element);
515 input_streams.emplace_back(std::move(element));
516 }
517 DataStream output_stream;
518 if (proto.has_output_stream())
519 output_stream.fillFromProto(proto.output_stream());
520 else
521 throw Exception("required to have output stream", ErrorCodes::PROTOBUF_BAD_CAST);
522 const auto & step_description = proto.step_description();
523 auto kind = ASTTableJoin::KindConverter::fromProto(proto.kind());
524 auto strictness = ASTTableJoin::StrictnessConverter::fromProto(proto.strictness());
525 auto max_streams = proto.max_streams();
526 auto keep_left_read_in_order = proto.keep_left_read_in_order();
527 std::vector<String> left_keys;
528 for (const auto & element : proto.left_keys())
529 left_keys.emplace_back(element);
530 std::vector<String> right_keys;
531 for (const auto & element : proto.right_keys())
532 right_keys.emplace_back(element);
533 std::vector<bool> key_ids_null_safe;
534 for (const auto & null_safe : proto.key_ids_null_safe())
535 key_ids_null_safe.emplace_back(null_safe);
536 auto filter = deserializeASTFromProto(proto.filter());
537 auto has_using = proto.has_using();
538 std::optional<std::vector<bool>> require_right_keys;
539 if (proto.flag_require_right_keys())
540 require_right_keys = std::vector<bool>(proto.require_right_keys().begin(), proto.require_right_keys().end());
541 auto asof_inequality = ASOF::InequalityConverter::fromProto(proto.asof_inequality());
542 auto distribution_type = DistributionTypeConverter::fromProto(proto.distribution_type());
543 auto join_algorithm = JoinAlgorithmConverter::fromProto(proto.join_algorithm());
544 auto is_magic = proto.is_magic();
545 auto is_ordered = proto.is_ordered();
546
547 LinkedHashMap<String, RuntimeFilterBuildInfos> runtime_filter_builders;
548 for (const auto & element : proto.runtime_filter_builders())
549 {
550 auto key = element.key();
551 auto value = RuntimeFilterBuildInfos::fromProto(element.value());
552 runtime_filter_builders.emplace(key, value);
553 }
554 auto step = std::make_shared<JoinStep>(
555 input_streams,
556 output_stream,
557 kind,
558 strictness,
559 max_streams,
560 keep_left_read_in_order,
561 left_keys,
562 right_keys,
563 key_ids_null_safe,
564 filter,
565 has_using,

Callers

nothing calls this directly

Calls 13

deserializeASTFromProtoFunction · 0.85
kindMethod · 0.80
strictnessMethod · 0.80
setStepDescriptionMethod · 0.80
ExceptionClass · 0.50
fillFromProtoMethod · 0.45
emplace_backMethod · 0.45
filterMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
keyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected