#pragma once #include "binder/ddl/bound_create_sequence_info.h" #include "processor/operator/sink.h" namespace lbug { namespace processor { struct CreateSequencePrintInfo final : OPPrintInfo { std::string seqName; explicit CreateSequencePrintInfo(std::string seqName) : seqName{std::move(seqName)} {} std::string toString() const override; std::unique_ptr copy() const override { return std::unique_ptr(new CreateSequencePrintInfo(*this)); } private: CreateSequencePrintInfo(const CreateSequencePrintInfo& other) : OPPrintInfo{other}, seqName{other.seqName} {} }; class CreateSequence final : public SimpleSink { static constexpr PhysicalOperatorType type_ = PhysicalOperatorType::CREATE_SEQUENCE; public: CreateSequence(binder::BoundCreateSequenceInfo info, std::shared_ptr messageTable, physical_op_id id, std::unique_ptr printInfo) : SimpleSink{type_, std::move(messageTable), id, std::move(printInfo)}, info{std::move(info)} {} void executeInternal(ExecutionContext* context) override; std::unique_ptr copy() override { return std::make_unique(info.copy(), messageTable, id, printInfo->copy()); } private: binder::BoundCreateSequenceInfo info; }; } // namespace processor } // namespace lbug