@@ -68,19 +68,24 @@ bool LogicalGet::operator==(const BaseOperatorNode &r) {
68
68
// ===--------------------------------------------------------------------===//
69
69
70
70
Operator 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) {
72
73
auto *get = new LogicalExternalFileGet ();
73
74
get->get_id = get_id;
74
75
get->format = format;
75
76
get->file_name = std::move (file_name);
77
+ get->delimiter = delimiter;
78
+ get->quote = quote;
79
+ get->escape = escape;
76
80
return Operator (get);
77
81
}
78
82
79
83
bool LogicalExternalFileGet::operator ==(const BaseOperatorNode &node) {
80
84
if (node.GetType () != OpType::LogicalExternalFileGet) return false ;
81
85
const auto &get = *static_cast <const LogicalExternalFileGet *>(&node);
82
86
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 );
84
89
}
85
90
86
91
hash_t LogicalExternalFileGet::Hash () const {
@@ -89,6 +94,9 @@ hash_t LogicalExternalFileGet::Hash() const {
89
94
hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
90
95
hash = HashUtil::CombineHashes (
91
96
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 ));
92
100
return hash;
93
101
}
94
102
@@ -446,25 +454,34 @@ Operator LogicalLimit::make(int64_t offset, int64_t limit) {
446
454
// External file output
447
455
// ===--------------------------------------------------------------------===//
448
456
Operator LogicalExportExternalFile::make (ExternalFileFormat format,
449
- std::string file_name) {
457
+ std::string file_name, char delimiter,
458
+ char quote, char escape) {
450
459
auto *export_op = new LogicalExportExternalFile ();
451
460
export_op->format = format;
452
461
export_op->file_name = std::move (file_name);
462
+ export_op->delimiter = delimiter;
463
+ export_op->quote = quote;
464
+ export_op->escape = escape;
453
465
return Operator (export_op);
454
466
}
455
467
456
468
bool LogicalExportExternalFile::operator ==(const BaseOperatorNode &node) {
457
469
if (node.GetType () != OpType::LogicalExportExternalFile) return false ;
458
470
const auto &export_op =
459
471
*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 );
461
475
}
462
476
463
477
hash_t LogicalExportExternalFile::Hash () const {
464
478
hash_t hash = BaseOperatorNode::Hash ();
465
479
hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
466
480
hash = HashUtil::CombineHashes (
467
481
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 ));
468
485
return hash;
469
486
}
470
487
@@ -567,19 +584,24 @@ hash_t PhysicalIndexScan::Hash() const {
567
584
// Physical external file scan
568
585
// ===--------------------------------------------------------------------===//
569
586
Operator 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) {
571
589
auto *get = new ExternalFileScan ();
572
590
get->get_id = get_id;
573
591
get->format = format;
574
592
get->file_name = file_name;
593
+ get->delimiter = delimiter;
594
+ get->quote = quote;
595
+ get->escape = escape;
575
596
return Operator (get);
576
597
}
577
598
578
599
bool ExternalFileScan::operator ==(const BaseOperatorNode &node) {
579
600
if (node.GetType () != OpType::QueryDerivedScan) return false ;
580
601
const auto &get = *static_cast <const ExternalFileScan *>(&node);
581
602
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 );
583
605
}
584
606
585
607
hash_t ExternalFileScan::Hash () const {
@@ -588,6 +610,9 @@ hash_t ExternalFileScan::Hash() const {
588
610
hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
589
611
hash = HashUtil::CombineHashes (
590
612
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 ));
591
616
return hash;
592
617
}
593
618
@@ -845,25 +870,34 @@ Operator PhysicalUpdate::make(
845
870
// PhysicalExportExternalFile
846
871
// ===--------------------------------------------------------------------===//
847
872
Operator PhysicalExportExternalFile::make (ExternalFileFormat format,
848
- std::string file_name) {
873
+ std::string file_name, char delimiter,
874
+ char quote, char escape) {
849
875
auto *export_op = new PhysicalExportExternalFile ();
850
876
export_op->format = format;
851
877
export_op->file_name = file_name;
878
+ export_op->delimiter = delimiter;
879
+ export_op->quote = quote;
880
+ export_op->escape = escape;
852
881
return Operator (export_op);
853
882
}
854
883
855
884
bool PhysicalExportExternalFile::operator ==(const BaseOperatorNode &node) {
856
885
if (node.GetType () != OpType::ExportExternalFile) return false ;
857
886
const auto &export_op =
858
887
*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 );
860
891
}
861
892
862
893
hash_t PhysicalExportExternalFile::Hash () const {
863
894
hash_t hash = BaseOperatorNode::Hash ();
864
895
hash = HashUtil::CombineHashes (hash, HashUtil::Hash (&format));
865
896
hash = HashUtil::CombineHashes (
866
897
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 ));
867
901
return hash;
868
902
}
869
903
0 commit comments