@@ -68,19 +68,24 @@ bool LogicalGet::operator==(const BaseOperatorNode &r) {
6868// ===--------------------------------------------------------------------===//
6969
7070Operator LogicalExternalFileGet::make (oid_t get_id, ExternalFileFormat format,
71- std::string file_name) {
71+ std::string file_name, char delimiter,
72+ char quote, char escape) {
7273 auto *get = new LogicalExternalFileGet ();
7374 get->get_id = get_id;
7475 get->format = format;
7576 get->file_name = std::move (file_name);
77+ get->delimiter = delimiter;
78+ get->quote = quote;
79+ get->escape = escape;
7680 return Operator (get);
7781}
7882
7983bool LogicalExternalFileGet::operator ==(const BaseOperatorNode &node) {
8084 if (node.GetType () != OpType::LogicalExternalFileGet) return false ;
8185 const auto &get = *static_cast <const LogicalExternalFileGet *>(&node);
8286 return (get_id == get.get_id && format == get.format &&
83- file_name == get.file_name );
87+ file_name == get.file_name && delimiter == get.delimiter &&
88+ quote == get.quote && escape == get.escape );
8489}
8590
8691hash_t LogicalExternalFileGet::Hash () const {
@@ -89,6 +94,9 @@ hash_t LogicalExternalFileGet::Hash() const {
8994 hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
9095 hash = HashUtil::CombineHashes (
9196 hash, HashUtil::HashBytes (file_name.data (), file_name.length ()));
97+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&delimiter, 1 ));
98+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes ("e, 1 ));
99+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&escape, 1 ));
92100 return hash;
93101}
94102
@@ -446,25 +454,34 @@ Operator LogicalLimit::make(int64_t offset, int64_t limit) {
446454// External file output
447455// ===--------------------------------------------------------------------===//
448456Operator LogicalExportExternalFile::make (ExternalFileFormat format,
449- std::string file_name) {
457+ std::string file_name, char delimiter,
458+ char quote, char escape) {
450459 auto *export_op = new LogicalExportExternalFile ();
451460 export_op->format = format;
452461 export_op->file_name = std::move (file_name);
462+ export_op->delimiter = delimiter;
463+ export_op->quote = quote;
464+ export_op->escape = escape;
453465 return Operator (export_op);
454466}
455467
456468bool LogicalExportExternalFile::operator ==(const BaseOperatorNode &node) {
457469 if (node.GetType () != OpType::LogicalExportExternalFile) return false ;
458470 const auto &export_op =
459471 *static_cast <const LogicalExportExternalFile *>(&node);
460- return (format == export_op.format && file_name == export_op.file_name );
472+ return (format == export_op.format && file_name == export_op.file_name &&
473+ delimiter == export_op.delimiter && quote == export_op.quote &&
474+ escape == export_op.escape );
461475}
462476
463477hash_t LogicalExportExternalFile::Hash () const {
464478 hash_t hash = BaseOperatorNode::Hash ();
465479 hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
466480 hash = HashUtil::CombineHashes (
467481 hash, HashUtil::HashBytes (file_name.data (), file_name.length ()));
482+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&delimiter, 1 ));
483+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes ("e, 1 ));
484+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&escape, 1 ));
468485 return hash;
469486}
470487
@@ -567,19 +584,24 @@ hash_t PhysicalIndexScan::Hash() const {
567584// Physical external file scan
568585// ===--------------------------------------------------------------------===//
569586Operator ExternalFileScan::make (oid_t get_id, ExternalFileFormat format,
570- std::string file_name) {
587+ std::string file_name, char delimiter,
588+ char quote, char escape) {
571589 auto *get = new ExternalFileScan ();
572590 get->get_id = get_id;
573591 get->format = format;
574592 get->file_name = file_name;
593+ get->delimiter = delimiter;
594+ get->quote = quote;
595+ get->escape = escape;
575596 return Operator (get);
576597}
577598
578599bool ExternalFileScan::operator ==(const BaseOperatorNode &node) {
579600 if (node.GetType () != OpType::QueryDerivedScan) return false ;
580601 const auto &get = *static_cast <const ExternalFileScan *>(&node);
581602 return (get_id == get.get_id && format == get.format &&
582- file_name == get.file_name );
603+ file_name == get.file_name && delimiter == get.delimiter &&
604+ quote == get.quote && escape == get.escape );
583605}
584606
585607hash_t ExternalFileScan::Hash () const {
@@ -588,6 +610,9 @@ hash_t ExternalFileScan::Hash() const {
588610 hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
589611 hash = HashUtil::CombineHashes (
590612 hash, HashUtil::HashBytes (file_name.data (), file_name.length ()));
613+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&delimiter, 1 ));
614+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes ("e, 1 ));
615+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&escape, 1 ));
591616 return hash;
592617}
593618
@@ -845,25 +870,34 @@ Operator PhysicalUpdate::make(
845870// PhysicalExportExternalFile
846871// ===--------------------------------------------------------------------===//
847872Operator PhysicalExportExternalFile::make (ExternalFileFormat format,
848- std::string file_name) {
873+ std::string file_name, char delimiter,
874+ char quote, char escape) {
849875 auto *export_op = new PhysicalExportExternalFile ();
850876 export_op->format = format;
851877 export_op->file_name = file_name;
878+ export_op->delimiter = delimiter;
879+ export_op->quote = quote;
880+ export_op->escape = escape;
852881 return Operator (export_op);
853882}
854883
855884bool PhysicalExportExternalFile::operator ==(const BaseOperatorNode &node) {
856885 if (node.GetType () != OpType::ExportExternalFile) return false ;
857886 const auto &export_op =
858887 *static_cast <const PhysicalExportExternalFile *>(&node);
859- return (format == export_op.format && file_name == export_op.file_name );
888+ return (format == export_op.format && file_name == export_op.file_name &&
889+ delimiter == export_op.delimiter && quote == export_op.quote &&
890+ escape == export_op.escape );
860891}
861892
862893hash_t PhysicalExportExternalFile::Hash () const {
863894 hash_t hash = BaseOperatorNode::Hash ();
864895 hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
865896 hash = HashUtil::CombineHashes (
866897 hash, HashUtil::HashBytes (file_name.data (), file_name.length ()));
898+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&delimiter, 1 ));
899+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes ("e, 1 ));
900+ hash = HashUtil::CombineHashes (hash, HashUtil::HashBytes (&escape, 1 ));
867901 return hash;
868902}
869903
0 commit comments