From 9d02a507ebd9853e1c935413b5506ed87b3bf6eb Mon Sep 17 00:00:00 2001 From: DuckDB Labs GitHub Bot Date: Thu, 16 Jan 2025 00:33:07 +0000 Subject: [PATCH] Update vendored DuckDB sources to 4d88718b --- .../icu/common/bytestriebuilder.cpp | 2 +- .../icu/third_party/icu/common/dtintrv.cpp | 2 +- .../third_party/icu/common/filteredbrk.cpp | 2 +- .../icu/third_party/icu/common/locid.cpp | 2 +- .../icu/third_party/icu/common/lsr.cpp | 2 +- .../icu/third_party/icu/common/lsr.h | 4 +- .../third_party/icu/common/messagepattern.cpp | 4 +- .../icu/third_party/icu/common/normlzr.cpp | 2 +- .../icu/third_party/icu/common/rbbinode.h | 2 +- .../icu/third_party/icu/common/schriter.cpp | 2 +- .../icu/common/stringtriebuilder.cpp | 16 +- .../icu/common/ucharstriebuilder.cpp | 2 +- .../icu/third_party/icu/common/uchriter.cpp | 2 +- .../third_party/icu/common/unicode/brkiter.h | 4 +- .../icu/common/unicode/bytestriebuilder.h | 2 +- .../third_party/icu/common/unicode/chariter.h | 6 +- .../third_party/icu/common/unicode/dtintrv.h | 6 +- .../third_party/icu/common/unicode/locid.h | 6 +- .../icu/common/unicode/messagepattern.h | 8 +- .../third_party/icu/common/unicode/normlzr.h | 6 +- .../third_party/icu/common/unicode/parsepos.h | 8 +- .../icu/third_party/icu/common/unicode/rbbi.h | 4 +- .../third_party/icu/common/unicode/schriter.h | 2 +- .../third_party/icu/common/unicode/strenum.h | 4 +- .../icu/common/unicode/stringpiece.h | 2 +- .../icu/common/unicode/stringtriebuilder.h | 18 +- .../icu/common/unicode/ucharstriebuilder.h | 2 +- .../third_party/icu/common/unicode/uchriter.h | 2 +- .../third_party/icu/common/unicode/uniset.h | 6 +- .../third_party/icu/common/unicode/unistr.h | 24 +- .../third_party/icu/common/unicode/uobject.h | 4 +- .../icu/third_party/icu/common/unifiedcache.h | 8 +- .../icu/third_party/icu/common/uniset.cpp | 2 +- .../icu/common/ustr_titlecase_brkiter.cpp | 2 +- .../icu/third_party/icu/common/ustrenum.cpp | 4 +- .../icu/third_party/icu/common/uvector.cpp | 2 +- .../icu/third_party/icu/common/uvector.h | 6 +- .../icu/third_party/icu/common/uvectr32.cpp | 2 +- .../icu/third_party/icu/common/uvectr32.h | 6 +- .../icu/third_party/icu/common/uvectr64.cpp | 2 +- .../icu/third_party/icu/common/uvectr64.h | 6 +- .../icu/third_party/icu/i18n/alphaindex.cpp | 4 +- .../icu/third_party/icu/i18n/calendar.cpp | 2 +- .../icu/third_party/icu/i18n/choicfmt.cpp | 2 +- .../icu/third_party/icu/i18n/coleitr.cpp | 4 +- .../icu/third_party/icu/i18n/coll.cpp | 4 +- .../icu/i18n/collationiterator.cpp | 2 +- .../third_party/icu/i18n/collationiterator.h | 4 +- .../icu/i18n/collationsettings.cpp | 2 +- .../third_party/icu/i18n/collationsettings.h | 4 +- .../icu/third_party/icu/i18n/currpinf.cpp | 2 +- .../icu/third_party/icu/i18n/datefmt.cpp | 4 +- .../icu/third_party/icu/i18n/dcfmtsym.cpp | 2 +- .../icu/third_party/icu/i18n/decimfmt.cpp | 2 +- .../icu/third_party/icu/i18n/dtfmtsym.cpp | 2 +- .../icu/third_party/icu/i18n/dtitvfmt.cpp | 2 +- .../icu/third_party/icu/i18n/dtitvinf.cpp | 2 +- .../icu/third_party/icu/i18n/dtptngen.cpp | 4 +- .../icu/third_party/icu/i18n/dtptngen_impl.h | 8 +- .../icu/third_party/icu/i18n/dtrule.cpp | 4 +- .../icu/third_party/icu/i18n/fmtable.cpp | 2 +- .../icu/third_party/icu/i18n/format.cpp | 2 +- .../icu/third_party/icu/i18n/fpositer.cpp | 2 +- .../icu/third_party/icu/i18n/measfmt.cpp | 2 +- .../icu/third_party/icu/i18n/measunit.cpp | 2 +- .../icu/third_party/icu/i18n/measure.cpp | 2 +- .../icu/third_party/icu/i18n/msgfmt.cpp | 4 +- .../icu/third_party/icu/i18n/nfrs.cpp | 2 +- .../extension/icu/third_party/icu/i18n/nfrs.h | 4 +- .../icu/third_party/icu/i18n/nfrule.cpp | 2 +- .../icu/third_party/icu/i18n/nfrule.h | 4 +- .../icu/third_party/icu/i18n/nfsubs.cpp | 18 +- .../icu/third_party/icu/i18n/nfsubs.h | 4 +- .../third_party/icu/i18n/number_asformat.cpp | 2 +- .../third_party/icu/i18n/number_asformat.h | 2 +- .../icu/third_party/icu/i18n/numfmt.cpp | 2 +- .../icu/third_party/icu/i18n/olsontz.cpp | 2 +- .../icu/third_party/icu/i18n/olsontz.h | 2 +- .../icu/third_party/icu/i18n/plurfmt.cpp | 4 +- .../icu/third_party/icu/i18n/plurrule.cpp | 2 +- .../icu/third_party/icu/i18n/rbnf.cpp | 8 +- .../icu/third_party/icu/i18n/rbtz.cpp | 4 +- .../icu/third_party/icu/i18n/region.cpp | 4 +- .../icu/third_party/icu/i18n/reldtfmt.cpp | 2 +- .../icu/third_party/icu/i18n/reldtfmt.h | 2 +- .../icu/i18n/rulebasedcollator.cpp | 2 +- .../icu/third_party/icu/i18n/selfmt.cpp | 4 +- .../icu/third_party/icu/i18n/simpletz.cpp | 2 +- .../icu/third_party/icu/i18n/smpdtfmt.cpp | 2 +- .../icu/third_party/icu/i18n/sortkey.cpp | 2 +- .../icu/third_party/icu/i18n/timezone.cpp | 2 +- .../icu/third_party/icu/i18n/tmutamt.cpp | 2 +- .../icu/third_party/icu/i18n/tzfmt.cpp | 2 +- .../icu/third_party/icu/i18n/tzgnames.cpp | 2 +- .../icu/third_party/icu/i18n/tzgnames.h | 4 +- .../icu/third_party/icu/i18n/tznames.cpp | 6 +- .../icu/third_party/icu/i18n/tznames_impl.cpp | 4 +- .../icu/third_party/icu/i18n/tznames_impl.h | 4 +- .../icu/third_party/icu/i18n/tzrule.cpp | 16 +- .../icu/third_party/icu/i18n/tztrans.cpp | 4 +- .../third_party/icu/i18n/unicode/alphaindex.h | 4 +- .../third_party/icu/i18n/unicode/calendar.h | 4 +- .../third_party/icu/i18n/unicode/choicfmt.h | 2 +- .../third_party/icu/i18n/unicode/coleitr.h | 4 +- .../icu/third_party/icu/i18n/unicode/coll.h | 4 +- .../third_party/icu/i18n/unicode/currpinf.h | 6 +- .../third_party/icu/i18n/unicode/datefmt.h | 2 +- .../third_party/icu/i18n/unicode/dcfmtsym.h | 4 +- .../third_party/icu/i18n/unicode/decimfmt.h | 2 +- .../third_party/icu/i18n/unicode/dtfmtsym.h | 4 +- .../third_party/icu/i18n/unicode/dtitvfmt.h | 6 +- .../third_party/icu/i18n/unicode/dtitvinf.h | 6 +- .../third_party/icu/i18n/unicode/dtptngen.h | 4 +- .../icu/third_party/icu/i18n/unicode/dtrule.h | 4 +- .../third_party/icu/i18n/unicode/fieldpos.h | 8 +- .../third_party/icu/i18n/unicode/fmtable.h | 4 +- .../icu/third_party/icu/i18n/unicode/format.h | 4 +- .../third_party/icu/i18n/unicode/fpositer.h | 4 +- .../third_party/icu/i18n/unicode/measfmt.h | 2 +- .../third_party/icu/i18n/unicode/measunit.h | 4 +- .../third_party/icu/i18n/unicode/measure.h | 2 +- .../icu/third_party/icu/i18n/unicode/msgfmt.h | 4 +- .../icu/third_party/icu/i18n/unicode/numfmt.h | 2 +- .../third_party/icu/i18n/unicode/plurfmt.h | 4 +- .../third_party/icu/i18n/unicode/plurrule.h | 4 +- .../icu/third_party/icu/i18n/unicode/rbnf.h | 2 +- .../icu/third_party/icu/i18n/unicode/rbtz.h | 4 +- .../icu/third_party/icu/i18n/unicode/region.h | 4 +- .../icu/third_party/icu/i18n/unicode/search.h | 4 +- .../icu/third_party/icu/i18n/unicode/selfmt.h | 4 +- .../third_party/icu/i18n/unicode/simpletz.h | 2 +- .../third_party/icu/i18n/unicode/smpdtfmt.h | 2 +- .../third_party/icu/i18n/unicode/sortkey.h | 6 +- .../third_party/icu/i18n/unicode/stsearch.h | 2 +- .../third_party/icu/i18n/unicode/tblcoll.h | 2 +- .../third_party/icu/i18n/unicode/timezone.h | 4 +- .../third_party/icu/i18n/unicode/tmutamt.h | 6 +- .../third_party/icu/i18n/unicode/tmutfmt.h | 4 +- .../icu/third_party/icu/i18n/unicode/tzfmt.h | 2 +- .../third_party/icu/i18n/unicode/tznames.h | 4 +- .../icu/third_party/icu/i18n/unicode/tzrule.h | 16 +- .../third_party/icu/i18n/unicode/tztrans.h | 4 +- .../icu/third_party/icu/i18n/unicode/vtzone.h | 4 +- .../icu/i18n/utf16collationiterator.cpp | 4 +- .../icu/i18n/utf16collationiterator.h | 4 +- .../icu/third_party/icu/i18n/vtzone.cpp | 4 +- src/duckdb/extension/json/json_scan.cpp | 10 +- .../extension/parquet/column_writer.cpp | 33 ++- .../parquet/include/parquet_reader.hpp | 29 +- .../parquet/include/parquet_writer.hpp | 12 +- .../extension/parquet/parquet_extension.cpp | 268 +++++++++++------- .../extension/parquet/parquet_metadata.cpp | 6 +- .../extension/parquet/parquet_reader.cpp | 46 ++- .../extension/parquet/parquet_writer.cpp | 4 +- .../extension/parquet/serialize_parquet.cpp | 2 + .../src/common/arrow/arrow_type_extension.cpp | 24 +- src/duckdb/src/common/enum_util.cpp | 19 ++ src/duckdb/src/common/exception.cpp | 7 +- src/duckdb/src/common/multi_file_reader.cpp | 224 +++++++++++---- .../scanner/string_value_scanner.cpp | 17 +- .../table_function/csv_file_scanner.cpp | 66 +++-- .../table_function/global_csv_state.cpp | 10 +- .../operator/csv_scanner/util/csv_error.cpp | 4 +- .../function/table/version/pragma_version.cpp | 6 +- .../src/include/duckdb/common/enum_util.hpp | 8 + .../duckdb/common/multi_file_reader.hpp | 149 ++++++++-- .../common/multi_file_reader_options.hpp | 4 + .../operator/csv_scanner/csv_error.hpp | 2 +- .../operator/csv_scanner/csv_file_scanner.hpp | 12 +- .../expression/bound_parameter_data.hpp | 10 +- .../expression/bind_comparison_expression.cpp | 1 + .../planner/binder/statement/bind_execute.cpp | 3 +- src/duckdb/third_party/httplib/httplib.hpp | 1 - 173 files changed, 990 insertions(+), 575 deletions(-) diff --git a/src/duckdb/extension/icu/third_party/icu/common/bytestriebuilder.cpp b/src/duckdb/extension/icu/third_party/icu/common/bytestriebuilder.cpp index a1caf8310..038f2221a 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/bytestriebuilder.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/bytestriebuilder.cpp @@ -343,7 +343,7 @@ BytesTrieBuilder::BTLinearMatchNode::BTLinearMatchNode(const char *bytes, int32_ static_cast(hash)*37u + static_cast(ustr_hashCharsN(bytes, len))); } -UBool +bool BytesTrieBuilder::BTLinearMatchNode::operator==(const Node &other) const { if(this==&other) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/dtintrv.cpp b/src/duckdb/extension/icu/third_party/icu/common/dtintrv.cpp index 80bb5d6db..011ad8136 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/dtintrv.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/dtintrv.cpp @@ -53,7 +53,7 @@ DateInterval::clone() const { } -UBool +bool DateInterval::operator==(const DateInterval& other) const { return ( fromDate == other.fromDate && toDate == other.toDate ); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/filteredbrk.cpp b/src/duckdb/extension/icu/third_party/icu/common/filteredbrk.cpp index 1a003345b..59b914fbb 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/filteredbrk.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/filteredbrk.cpp @@ -175,7 +175,7 @@ // } // virtual SimpleFilteredSentenceBreakIterator* clone() const { return new SimpleFilteredSentenceBreakIterator(*this); } // virtual UClassID getDynamicClassID(void) const { return NULL; } -// virtual UBool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; } +// virtual bool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; } // /* -- text modifying -- */ // virtual void setText(UText *text, UErrorCode &status) { fDelegate->setText(text,status); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/locid.cpp b/src/duckdb/extension/icu/third_party/icu/common/locid.cpp index 78292a87d..179d5b3b4 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/locid.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/locid.cpp @@ -482,7 +482,7 @@ Locale::clone() const { return new Locale(*this); } -UBool +bool Locale::operator==( const Locale& other) const { return (uprv_strcmp(other.fullName, fullName) == 0); diff --git a/src/duckdb/extension/icu/third_party/icu/common/lsr.cpp b/src/duckdb/extension/icu/third_party/icu/common/lsr.cpp index 0c28eeda1..8dca9dbbe 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/lsr.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/lsr.cpp @@ -60,7 +60,7 @@ LSR &LSR::operator=(LSR &&other) U_NOEXCEPT { return *this; } -UBool LSR::operator==(const LSR &other) const { +bool LSR::operator==(const LSR &other) const { return uprv_strcmp(language, other.language) == 0 && uprv_strcmp(script, other.script) == 0 && diff --git a/src/duckdb/extension/icu/third_party/icu/common/lsr.h b/src/duckdb/extension/icu/third_party/icu/common/lsr.h index db6cf938f..84769cf74 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/lsr.h +++ b/src/duckdb/extension/icu/third_party/icu/common/lsr.h @@ -55,9 +55,9 @@ struct LSR final : public UMemory { */ static int32_t indexForRegion(const char *region); - UBool operator==(const LSR &other) const; + bool operator==(const LSR &other) const; - inline UBool operator!=(const LSR &other) const { + inline bool operator!=(const LSR &other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/messagepattern.cpp b/src/duckdb/extension/icu/third_party/icu/common/messagepattern.cpp index f223d0671..b2956cb66 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/messagepattern.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/messagepattern.cpp @@ -309,7 +309,7 @@ MessagePattern::clear() { numericValuesLength=0; } -UBool +bool MessagePattern::operator==(const MessagePattern &other) const { if(this==&other) { return TRUE; @@ -387,7 +387,7 @@ MessagePattern::getPluralOffset(int32_t pluralStart) const { // MessagePattern::Part ---------------------------------------------------- *** -UBool +bool MessagePattern::Part::operator==(const Part &other) const { if(this==&other) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/normlzr.cpp b/src/duckdb/extension/icu/third_party/icu/common/normlzr.cpp index 2dea0ffc3..1f4fa1517 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/normlzr.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/normlzr.cpp @@ -108,7 +108,7 @@ int32_t Normalizer::hashCode() const return text->hashCode() + fUMode + fOptions + buffer.hashCode() + bufferPos + currentIndex + nextIndex; } -UBool Normalizer::operator==(const Normalizer& that) const +bool Normalizer::operator==(const Normalizer& that) const { return this==&that || diff --git a/src/duckdb/extension/icu/third_party/icu/common/rbbinode.h b/src/duckdb/extension/icu/third_party/icu/common/rbbinode.h index f35259602..a30cccc0b 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/rbbinode.h +++ b/src/duckdb/extension/icu/third_party/icu/common/rbbinode.h @@ -108,7 +108,7 @@ class RBBINode : public UMemory { private: RBBINode &operator = (const RBBINode &other); // No defs. - UBool operator == (const RBBINode &other); // Private, so these functions won't accidently be used. + bool operator == (const RBBINode &other); // Private, so these functions won't accidently be used. #ifdef RBBI_DEBUG public: diff --git a/src/duckdb/extension/icu/third_party/icu/common/schriter.cpp b/src/duckdb/extension/icu/third_party/icu/common/schriter.cpp index 17b68aee9..f781bd43f 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/schriter.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/schriter.cpp @@ -79,7 +79,7 @@ StringCharacterIterator::operator=(const StringCharacterIterator& that) { return *this; } -UBool +bool StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const { if (this == &that) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/stringtriebuilder.cpp b/src/duckdb/extension/icu/third_party/icu/common/stringtriebuilder.cpp index 6f9cc2e5c..978ef9dbc 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/stringtriebuilder.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/stringtriebuilder.cpp @@ -383,7 +383,7 @@ StringTrieBuilder::equalNodes(const void *left, const void *right) { return *(const Node *)left==*(const Node *)right; } -UBool +bool StringTrieBuilder::Node::operator==(const Node &other) const { return this==&other || (typeid(*this)==typeid(other) && hash==other.hash); } @@ -396,7 +396,7 @@ StringTrieBuilder::Node::markRightEdgesFirst(int32_t edgeNumber) { return edgeNumber; } -UBool +bool StringTrieBuilder::FinalValueNode::operator==(const Node &other) const { if(this==&other) { return TRUE; @@ -413,7 +413,7 @@ StringTrieBuilder::FinalValueNode::write(StringTrieBuilder &builder) { offset=builder.writeValueAndFinal(value, TRUE); } -UBool +bool StringTrieBuilder::ValueNode::operator==(const Node &other) const { if(this==&other) { return TRUE; @@ -425,7 +425,7 @@ StringTrieBuilder::ValueNode::operator==(const Node &other) const { return hasValue==o.hasValue && (!hasValue || value==o.value); } -UBool +bool StringTrieBuilder::IntermediateValueNode::operator==(const Node &other) const { if(this==&other) { return TRUE; @@ -451,7 +451,7 @@ StringTrieBuilder::IntermediateValueNode::write(StringTrieBuilder &builder) { offset=builder.writeValueAndFinal(value, FALSE); } -UBool +bool StringTrieBuilder::LinearMatchNode::operator==(const Node &other) const { if(this==&other) { return TRUE; @@ -471,7 +471,7 @@ StringTrieBuilder::LinearMatchNode::markRightEdgesFirst(int32_t edgeNumber) { return edgeNumber; } -UBool +bool StringTrieBuilder::ListBranchNode::operator==(const Node &other) const { if(this==&other) { return TRUE; @@ -550,7 +550,7 @@ StringTrieBuilder::ListBranchNode::write(StringTrieBuilder &builder) { } } -UBool +bool StringTrieBuilder::SplitBranchNode::operator==(const Node &other) const { if(this==&other) { return TRUE; @@ -584,7 +584,7 @@ StringTrieBuilder::SplitBranchNode::write(StringTrieBuilder &builder) { offset=builder.write(unit); } -UBool +bool StringTrieBuilder::BranchHeadNode::operator==(const Node &other) const { if(this==&other) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/ucharstriebuilder.cpp b/src/duckdb/extension/icu/third_party/icu/common/ucharstriebuilder.cpp index e7e7aed14..be4e386bb 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/ucharstriebuilder.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/ucharstriebuilder.cpp @@ -290,7 +290,7 @@ UCharsTrieBuilder::UCTLinearMatchNode::UCTLinearMatchNode(const UChar *units, in hash=hash*37u+ustr_hashUCharsN(units, len); } -UBool +bool UCharsTrieBuilder::UCTLinearMatchNode::operator==(const Node &other) const { if(this==&other) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/uchriter.cpp b/src/duckdb/extension/icu/third_party/icu/common/uchriter.cpp index bedbabc74..ce248fbca 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/uchriter.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/uchriter.cpp @@ -66,7 +66,7 @@ UCharCharacterIterator::operator=(const UCharCharacterIterator& that) { UCharCharacterIterator::~UCharCharacterIterator() { } -UBool +bool UCharCharacterIterator::operator==(const ForwardCharacterIterator& that) const { if (this == &that) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/brkiter.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/brkiter.h index f7efdba77..321d47b55 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/brkiter.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/brkiter.h @@ -123,7 +123,7 @@ // * object, and styles are not considered. // * @stable ICU 2.0 // */ -// virtual UBool operator==(const BreakIterator&) const = 0; +// virtual bool operator==(const BreakIterator&) const = 0; // /** // * Returns the complement of the result of operator== @@ -131,7 +131,7 @@ // * @return the complement of the result of operator== // * @stable ICU 2.0 // */ -// UBool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); } +// bool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); } // /** // * Return a polymorphic copy of this object. This is an abstract diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/bytestriebuilder.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/bytestriebuilder.h index b98374bb8..67dbbf74c 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/bytestriebuilder.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/bytestriebuilder.h @@ -151,7 +151,7 @@ class U_COMMON_API BytesTrieBuilder : public StringTrieBuilder { class BTLinearMatchNode : public LinearMatchNode { public: BTLinearMatchNode(const char *units, int32_t len, Node *nextNode); - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual void write(StringTrieBuilder &builder); private: const char *s; diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/chariter.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/chariter.h index db86f79e4..5b00e6622 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/chariter.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/chariter.h @@ -114,7 +114,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject { * character in the same character-storage object * @stable ICU 2.0 */ - virtual UBool operator==(const ForwardCharacterIterator& that) const = 0; + virtual bool operator==(const ForwardCharacterIterator& that) const = 0; /** * Returns true when the iterators refer to different @@ -126,7 +126,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject { * same text-storage object * @stable ICU 2.0 */ - inline UBool operator!=(const ForwardCharacterIterator& that) const; + inline bool operator!=(const ForwardCharacterIterator& that) const; /** * Generates a hash code for this iterator. @@ -692,7 +692,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator { int32_t end; }; -inline UBool +inline bool ForwardCharacterIterator::operator!=(const ForwardCharacterIterator& that) const { return !operator==(that); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/dtintrv.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/dtintrv.h index 15e15c9d4..fb3f531e9 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/dtintrv.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/dtintrv.h @@ -109,14 +109,14 @@ class U_COMMON_API DateInterval : public UObject { * @return TRUE if the two DateIntervals are the same * @stable ICU 4.0 */ - virtual UBool operator==(const DateInterval& other) const; + virtual bool operator==(const DateInterval& other) const; /** * Non-equality operator * @return TRUE if the two DateIntervals are not the same * @stable ICU 4.0 */ - inline UBool operator!=(const DateInterval& other) const; + inline bool operator!=(const DateInterval& other) const; /** @@ -151,7 +151,7 @@ DateInterval::getToDate() const { } -inline UBool +inline bool DateInterval::operator!=(const DateInterval& other) const { return ( !operator==(other) ); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/locid.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/locid.h index 57c669b33..210e4f425 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/locid.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/locid.h @@ -329,7 +329,7 @@ class U_COMMON_API Locale : public UObject { * @return True if the two locale keys are the same, false otherwise. * @stable ICU 2.0 */ - UBool operator==(const Locale& other) const; + bool operator==(const Locale& other) const; /** * Checks if two locale keys are not the same. @@ -339,7 +339,7 @@ class U_COMMON_API Locale : public UObject { * otherwise. * @stable ICU 2.0 */ - inline UBool operator!=(const Locale& other) const; + inline bool operator!=(const Locale& other) const; /** * Clone this object. @@ -1153,7 +1153,7 @@ class U_COMMON_API Locale : public UObject { friend void U_CALLCONV locale_available_init(); }; -inline UBool +inline bool Locale::operator!=(const Locale& other) const { return !operator==(other); diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/messagepattern.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/messagepattern.h index 04f00a875..3084c4267 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/messagepattern.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/messagepattern.h @@ -526,14 +526,14 @@ class U_COMMON_API MessagePattern : public UObject { * @return TRUE if this object is equivalent to the other one. * @stable ICU 4.8 */ - UBool operator==(const MessagePattern &other) const; + bool operator==(const MessagePattern &other) const; /** * @param other another object to compare with. * @return FALSE if this object is equivalent to the other one. * @stable ICU 4.8 */ - inline UBool operator!=(const MessagePattern &other) const { + inline bool operator!=(const MessagePattern &other) const { return !operator==(other); } @@ -797,14 +797,14 @@ class U_COMMON_API MessagePattern : public UObject { * @return TRUE if this object is equivalent to the other one. * @stable ICU 4.8 */ - UBool operator==(const Part &other) const; + bool operator==(const Part &other) const; /** * @param other another object to compare with. * @return FALSE if this object is equivalent to the other one. * @stable ICU 4.8 */ - inline UBool operator!=(const Part &other) const { + inline bool operator!=(const Part &other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/normlzr.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/normlzr.h index 07a596bd1..14729720d 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/normlzr.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/normlzr.h @@ -584,7 +584,7 @@ class U_COMMON_API Normalizer : public UObject { * @return comparison result * @deprecated ICU 56 Use Normalizer2 instead. */ - UBool operator==(const Normalizer& that) const; + bool operator==(const Normalizer& that) const; /** * Returns FALSE when both iterators refer to the same character in the same @@ -594,7 +594,7 @@ class U_COMMON_API Normalizer : public UObject { * @return comparison result * @deprecated ICU 56 Use Normalizer2 instead. */ - inline UBool operator!=(const Normalizer& that) const; + inline bool operator!=(const Normalizer& that) const; /** * Returns a pointer to a new Normalizer that is a clone of this one. @@ -777,7 +777,7 @@ class U_COMMON_API Normalizer : public UObject { //------------------------------------------------------------------------- #ifndef U_HIDE_DEPRECATED_API -inline UBool +inline bool Normalizer::operator!= (const Normalizer& other) const { return ! operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/parsepos.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/parsepos.h index 909d288d4..76c3fd282 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/parsepos.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/parsepos.h @@ -100,14 +100,14 @@ class U_COMMON_API ParsePosition : public UObject { * @return TRUE if the two parse positions are equal, FALSE otherwise. * @stable ICU 2.0 */ - inline UBool operator==(const ParsePosition& that) const; + inline bool operator==(const ParsePosition& that) const; /** * Equality operator. * @return TRUE if the two parse positions are not equal, FALSE otherwise. * @stable ICU 2.0 */ - inline UBool operator!=(const ParsePosition& that) const; + inline bool operator!=(const ParsePosition& that) const; /** * Clone this object. @@ -192,7 +192,7 @@ ParsePosition::operator=(const ParsePosition& copy) return *this; } -inline UBool +inline bool ParsePosition::operator==(const ParsePosition& copy) const { if(index != copy.index || errorIndex != copy.errorIndex) @@ -201,7 +201,7 @@ ParsePosition::operator==(const ParsePosition& copy) const return TRUE; } -inline UBool +inline bool ParsePosition::operator!=(const ParsePosition& copy) const { return !operator==(copy); diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/rbbi.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/rbbi.h index dcff281ff..978539625 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/rbbi.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/rbbi.h @@ -253,7 +253,7 @@ // * same class, have the same behavior, and iterate over the same text. // * @stable ICU 2.0 // */ -// virtual UBool operator==(const BreakIterator& that) const; +// virtual bool operator==(const BreakIterator& that) const; // /** // * Not-equal operator. If operator== returns TRUE, this returns FALSE, @@ -262,7 +262,7 @@ // * @return TRUE if both BreakIterators are not same. // * @stable ICU 2.0 // */ -// inline UBool operator!=(const BreakIterator& that) const; +// inline bool operator!=(const BreakIterator& that) const; // /** // * Returns a newly-constructed RuleBasedBreakIterator with the same diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/schriter.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/schriter.h index 1ca5b70fc..024c80b89 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/schriter.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/schriter.h @@ -124,7 +124,7 @@ class U_COMMON_API StringCharacterIterator : public UCharCharacterIterator { * same string and are pointing at the same character. * @stable ICU 2.0 */ - virtual UBool operator==(const ForwardCharacterIterator& that) const; + virtual bool operator==(const ForwardCharacterIterator& that) const; /** * Returns a new StringCharacterIterator referring to the same diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/strenum.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/strenum.h index 8601f1f7c..e6b932224 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/strenum.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/strenum.h @@ -199,7 +199,7 @@ class U_COMMON_API StringEnumeration : public UObject { * @return TRUE if the enumerations are equal. FALSE if not. * @stable ICU 3.6 */ - virtual UBool operator==(const StringEnumeration& that)const; + virtual bool operator==(const StringEnumeration& that)const; /** * Compares this enumeration to other to check if both are not equal * @@ -207,7 +207,7 @@ class U_COMMON_API StringEnumeration : public UObject { * @return TRUE if the enumerations are equal. FALSE if not. * @stable ICU 3.6 */ - virtual UBool operator!=(const StringEnumeration& that)const; + virtual bool operator!=(const StringEnumeration& that)const; protected: /** diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/stringpiece.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/stringpiece.h index f581091f8..3025f3294 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/stringpiece.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/stringpiece.h @@ -248,7 +248,7 @@ operator==(const StringPiece& x, const StringPiece& y); * @return TRUE if the string data is not equal * @stable ICU 4.8 */ -inline UBool operator!=(const StringPiece& x, const StringPiece& y) { +inline bool operator!=(const StringPiece& x, const StringPiece& y) { return !(x == y); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/stringtriebuilder.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/stringtriebuilder.h index 2c47dd415..dc00a7c39 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/stringtriebuilder.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/stringtriebuilder.h @@ -204,8 +204,8 @@ class U_COMMON_API StringTrieBuilder : public UObject { // Handles node==NULL. static inline int32_t hashCode(const Node *node) { return node==NULL ? 0 : node->hashCode(); } // Base class operator==() compares the actual class types. - virtual UBool operator==(const Node &other) const; - inline UBool operator!=(const Node &other) const { return !operator==(other); } + virtual bool operator==(const Node &other) const; + inline bool operator!=(const Node &other) const { return !operator==(other); } /** * Traverses the Node graph and numbers branch edges, with rightmost edges first. * This is to avoid writing a duplicate node twice. @@ -265,7 +265,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { class FinalValueNode : public Node { public: FinalValueNode(int32_t v) : Node(0x111111u*37u+v), value(v) {} - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual void write(StringTrieBuilder &builder); protected: int32_t value; @@ -280,7 +280,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { class ValueNode : public Node { public: ValueNode(int32_t initialHash) : Node(initialHash), hasValue(FALSE), value(0) {} - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; void setValue(int32_t v) { hasValue=TRUE; value=v; @@ -299,7 +299,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { public: IntermediateValueNode(int32_t v, Node *nextNode) : ValueNode(0x222222u*37u+hashCode(nextNode)), next(nextNode) { setValue(v); } - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); virtual void write(StringTrieBuilder &builder); protected: @@ -317,7 +317,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { LinearMatchNode(int32_t len, Node *nextNode) : ValueNode((0x333333u*37u+len)*37u+hashCode(nextNode)), length(len), next(nextNode) {} - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); protected: int32_t length; @@ -341,7 +341,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { class ListBranchNode : public BranchNode { public: ListBranchNode() : BranchNode(0x444444), length(0) {} - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); virtual void write(StringTrieBuilder &builder); // Adds a unit with a final value. @@ -376,7 +376,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { : BranchNode(((0x555555u*37u+middleUnit)*37u+ hashCode(lessThanNode))*37u+hashCode(greaterOrEqualNode)), unit(middleUnit), lessThan(lessThanNode), greaterOrEqual(greaterOrEqualNode) {} - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); virtual void write(StringTrieBuilder &builder); protected: @@ -392,7 +392,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { BranchHeadNode(int32_t len, Node *subNode) : ValueNode((0x666666u*37u+len)*37u+hashCode(subNode)), length(len), next(subNode) {} - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); virtual void write(StringTrieBuilder &builder); protected: diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/ucharstriebuilder.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/ucharstriebuilder.h index 540dcc047..f01853954 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/ucharstriebuilder.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/ucharstriebuilder.h @@ -156,7 +156,7 @@ class U_COMMON_API UCharsTrieBuilder : public StringTrieBuilder { class UCTLinearMatchNode : public LinearMatchNode { public: UCTLinearMatchNode(const char16_t *units, int32_t len, Node *nextNode); - virtual UBool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const; virtual void write(StringTrieBuilder &builder); private: const char16_t *s; diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/uchriter.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/uchriter.h index a485259b8..f6979e2bc 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/uchriter.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/uchriter.h @@ -119,7 +119,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * same string and are pointing at the same character. * @stable ICU 2.0 */ - virtual UBool operator==(const ForwardCharacterIterator& that) const; + virtual bool operator==(const ForwardCharacterIterator& that) const; /** * Generates a hash code for this iterator. diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/uniset.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/uniset.h index 18cc93764..623f8087e 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/uniset.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/uniset.h @@ -487,14 +487,14 @@ class U_COMMON_API UnicodeSet U_FINAL : public UnicodeFilter { * @return true if the specified set is equal to this set. * @stable ICU 2.0 */ - virtual UBool operator==(const UnicodeSet& o) const; + virtual bool operator==(const UnicodeSet& o) const; /** * Compares the specified object with this set for equality. Returns * true if the specified set is not equal to this set. * @stable ICU 2.0 */ - inline UBool operator!=(const UnicodeSet& o) const; + inline bool operator!=(const UnicodeSet& o) const; /** * Returns a copy of this object. All UnicodeFunctor objects have @@ -1677,7 +1677,7 @@ class U_COMMON_API UnicodeSet U_FINAL : public UnicodeFilter { -inline UBool UnicodeSet::operator!=(const UnicodeSet& o) const { +inline bool UnicodeSet::operator!=(const UnicodeSet& o) const { return !operator==(o); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/unistr.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/unistr.h index 368ce2c6e..b7c87e6b8 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/unistr.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/unistr.h @@ -324,7 +324,7 @@ class U_COMMON_API UnicodeString : public Replaceable * FALSE otherwise. * @stable ICU 2.0 */ - inline UBool operator== (const UnicodeString& text) const; + inline bool operator== (const UnicodeString& text) const; /** * Inequality operator. Performs only bitwise comparison. @@ -333,7 +333,7 @@ class U_COMMON_API UnicodeString : public Replaceable * TRUE otherwise. * @stable ICU 2.0 */ - inline UBool operator!= (const UnicodeString& text) const; + inline bool operator!= (const UnicodeString& text) const; /** * Greater than operator. Performs only bitwise comparison. @@ -342,7 +342,7 @@ class U_COMMON_API UnicodeString : public Replaceable * greater than the characters in `text`, FALSE otherwise * @stable ICU 2.0 */ - inline UBool operator> (const UnicodeString& text) const; + inline bool operator> (const UnicodeString& text) const; /** * Less than operator. Performs only bitwise comparison. @@ -351,7 +351,7 @@ class U_COMMON_API UnicodeString : public Replaceable * less than the characters in `text`, FALSE otherwise * @stable ICU 2.0 */ - inline UBool operator< (const UnicodeString& text) const; + inline bool operator< (const UnicodeString& text) const; /** * Greater than or equal operator. Performs only bitwise comparison. @@ -360,7 +360,7 @@ class U_COMMON_API UnicodeString : public Replaceable * greater than or equal to the characters in `text`, FALSE otherwise * @stable ICU 2.0 */ - inline UBool operator>= (const UnicodeString& text) const; + inline bool operator>= (const UnicodeString& text) const; /** * Less than or equal operator. Performs only bitwise comparison. @@ -369,7 +369,7 @@ class U_COMMON_API UnicodeString : public Replaceable * less than or equal to the characters in `text`, FALSE otherwise * @stable ICU 2.0 */ - inline UBool operator<= (const UnicodeString& text) const; + inline bool operator<= (const UnicodeString& text) const; /** * Compare the characters bitwise in this UnicodeString to @@ -3946,7 +3946,7 @@ UnicodeString::doCompare(int32_t start, } } -inline UBool +inline bool UnicodeString::operator== (const UnicodeString& text) const { if(isBogus()) { @@ -3957,23 +3957,23 @@ UnicodeString::operator== (const UnicodeString& text) const } } -inline UBool +inline bool UnicodeString::operator!= (const UnicodeString& text) const { return (! operator==(text)); } -inline UBool +inline bool UnicodeString::operator> (const UnicodeString& text) const { return doCompare(0, length(), text, 0, text.length()) == 1; } -inline UBool +inline bool UnicodeString::operator< (const UnicodeString& text) const { return doCompare(0, length(), text, 0, text.length()) == -1; } -inline UBool +inline bool UnicodeString::operator>= (const UnicodeString& text) const { return doCompare(0, length(), text, 0, text.length()) != -1; } -inline UBool +inline bool UnicodeString::operator<= (const UnicodeString& text) const { return doCompare(0, length(), text, 0, text.length()) != 1; } diff --git a/src/duckdb/extension/icu/third_party/icu/common/unicode/uobject.h b/src/duckdb/extension/icu/third_party/icu/common/unicode/uobject.h index eeb331ce9..25a8330f9 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unicode/uobject.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unicode/uobject.h @@ -262,8 +262,8 @@ class U_COMMON_API UObject : public UMemory { // UObject &operator=(const UObject &other) { return *this; } // comparison operators - virtual inline UBool operator==(const UObject &other) const { return this==&other; } - inline UBool operator!=(const UObject &other) const { return !operator==(other); } + virtual inline bool operator==(const UObject &other) const { return this==&other; } + inline bool operator!=(const UObject &other) const { return !operator==(other); } // clone() commented out from the base class: // some compilers do not support co-variant return types diff --git a/src/duckdb/extension/icu/third_party/icu/common/unifiedcache.h b/src/duckdb/extension/icu/third_party/icu/common/unifiedcache.h index 5c0bd76f4..d7f5689fb 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/unifiedcache.h +++ b/src/duckdb/extension/icu/third_party/icu/common/unifiedcache.h @@ -56,7 +56,7 @@ class U_COMMON_API CacheKeyBase : public UObject { /** * Equality operator. */ - virtual UBool operator == (const CacheKeyBase &other) const = 0; + virtual bool operator == (const CacheKeyBase &other) const = 0; /** * Create a new object for this key. Called by cache on cache miss. @@ -83,7 +83,7 @@ class U_COMMON_API CacheKeyBase : public UObject { /** * Inequality operator. */ - UBool operator != (const CacheKeyBase &other) const { + bool operator != (const CacheKeyBase &other) const { return !(*this == other); } private: @@ -123,7 +123,7 @@ class CacheKey : public CacheKeyBase { /** * Two objects are equal if they are of the same type. */ - virtual UBool operator == (const CacheKeyBase &other) const { + virtual bool operator == (const CacheKeyBase &other) const { return typeid(*this) == typeid(other); } }; @@ -144,7 +144,7 @@ class LocaleCacheKey : public CacheKey { virtual int32_t hashCode() const { return (int32_t)(37u * (uint32_t)CacheKey::hashCode() + (uint32_t)fLoc.hashCode()); } - virtual UBool operator == (const CacheKeyBase &other) const { + virtual bool operator == (const CacheKeyBase &other) const { // reflexive if (this == &other) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/uniset.cpp b/src/duckdb/extension/icu/third_party/icu/common/uniset.cpp index 1936fedb6..92545c74e 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/uniset.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/uniset.cpp @@ -300,7 +300,7 @@ UnicodeSet *UnicodeSet::cloneAsThawed() const { * @param o set to be compared for equality with this set. * @return true if the specified set is equal to this set. */ -UBool UnicodeSet::operator==(const UnicodeSet& o) const { +bool UnicodeSet::operator==(const UnicodeSet& o) const { if (len != o.len) return FALSE; for (int32_t i = 0; i < len; ++i) { if (list[i] != o.list[i]) return FALSE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/ustr_titlecase_brkiter.cpp b/src/duckdb/extension/icu/third_party/icu/common/ustr_titlecase_brkiter.cpp index 4b6120294..8f4b956fc 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/ustr_titlecase_brkiter.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/ustr_titlecase_brkiter.cpp @@ -44,7 +44,7 @@ // public: // WholeStringBreakIterator() : BreakIterator(), length(0) {} // ~WholeStringBreakIterator() U_OVERRIDE; -// UBool operator==(const BreakIterator&) const U_OVERRIDE; +// bool operator==(const BreakIterator&) const U_OVERRIDE; // WholeStringBreakIterator *clone() const U_OVERRIDE; // static UClassID U_EXPORT2 getStaticClassID(); // UClassID getDynamicClassID() const U_OVERRIDE; diff --git a/src/duckdb/extension/icu/third_party/icu/common/ustrenum.cpp b/src/duckdb/extension/icu/third_party/icu/common/ustrenum.cpp index 9396cea73..0d11fdd81 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/ustrenum.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/ustrenum.cpp @@ -120,12 +120,12 @@ StringEnumeration::setChars(const char *s, int32_t length, UErrorCode &status) { return NULL; } -UBool +bool StringEnumeration::operator==(const StringEnumeration& that)const { return typeid(*this) == typeid(that); } -UBool +bool StringEnumeration::operator!=(const StringEnumeration& that)const { return !operator==(that); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp b/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp index cb5b6b984..e91cea72c 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp @@ -110,7 +110,7 @@ void UVector::assign(const UVector& other, UElementAssigner *assign, UErrorCode } // This only does something sensible if this object has a non-null comparer -UBool UVector::operator==(const UVector& other) { +bool UVector::operator==(const UVector& other) { int32_t i; if (count != other.count) return FALSE; if (comparer != NULL) { diff --git a/src/duckdb/extension/icu/third_party/icu/common/uvector.h b/src/duckdb/extension/icu/third_party/icu/common/uvector.h index 98318d14c..01403cc2a 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/uvector.h +++ b/src/duckdb/extension/icu/third_party/icu/common/uvector.h @@ -113,12 +113,12 @@ class U_COMMON_API UVector : public UObject { * equal if they are of the same size and all elements are equal, * as compared using this object's comparer. */ - UBool operator==(const UVector& other); + bool operator==(const UVector& other); /** * Equivalent to !operator==() */ - inline UBool operator!=(const UVector& other); + inline bool operator!=(const UVector& other); //------------------------------------------------------------ // java.util.Vector API @@ -382,7 +382,7 @@ inline void* UVector::operator[](int32_t index) const { return elementAt(index); } -inline UBool UVector::operator!=(const UVector& other) { +inline bool UVector::operator!=(const UVector& other) { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/common/uvectr32.cpp b/src/duckdb/extension/icu/third_party/icu/common/uvectr32.cpp index ce4542c4b..571d92bd0 100644 --- a/src/duckdb/extension/icu/third_party/icu/common/uvectr32.cpp +++ b/src/duckdb/extension/icu/third_party/icu/common/uvectr32.cpp @@ -83,7 +83,7 @@ void UVector32::assign(const UVector32& other, UErrorCode &ec) { } -UBool UVector32::operator==(const UVector32& other) { +bool UVector32::operator==(const UVector32& other) { int32_t i; if (count != other.count) return FALSE; for (i=0; i::hashCode() + (uint32_t)fSkeleton.hashCode()); } - virtual UBool operator==(const CacheKeyBase &other) const { + virtual bool operator==(const CacheKeyBase &other) const { // reflexive if (this == &other) { return TRUE; @@ -174,7 +174,7 @@ DateFormat::~DateFormat() //---------------------------------------------------------------------- -UBool +bool DateFormat::operator==(const Format& other) const { // This protected comparison operator should only be called by subclasses diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/dcfmtsym.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/dcfmtsym.cpp index e6bafa4b3..6035c0091 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/dcfmtsym.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/dcfmtsym.cpp @@ -173,7 +173,7 @@ DecimalFormatSymbols::operator=(const DecimalFormatSymbols& rhs) // ------------------------------------- -UBool +bool DecimalFormatSymbols::operator==(const DecimalFormatSymbols& that) const { if (this == &that) { diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/decimfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/decimfmt.cpp index 7ce1ef560..007185446 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/decimfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/decimfmt.cpp @@ -500,7 +500,7 @@ DecimalFormat* DecimalFormat::clone() const { return nullptr; } -UBool DecimalFormat::operator==(const Format& other) const { +bool DecimalFormat::operator==(const Format& other) const { auto* otherDF = dynamic_cast(&other); if (otherDF == nullptr) { return false; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/dtfmtsym.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/dtfmtsym.cpp index 67eb89270..b9ab31caa 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/dtfmtsym.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/dtfmtsym.cpp @@ -534,7 +534,7 @@ DateFormatSymbols::arrayCompare(const UnicodeString* array1, return TRUE; } -UBool +bool DateFormatSymbols::operator==(const DateFormatSymbols& other) const { // First do cheap comparisons diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/dtitvfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/dtitvfmt.cpp index 4d330f0c2..810348ad0 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/dtitvfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/dtitvfmt.cpp @@ -221,7 +221,7 @@ DateIntervalFormat::clone() const { } -UBool +bool DateIntervalFormat::operator==(const Format& other) const { if (typeid(*this) != typeid(other)) {return FALSE;} const DateIntervalFormat* fmt = (DateIntervalFormat*)&other; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/dtitvinf.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/dtitvinf.cpp index 9356c8550..eb15ef650 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/dtitvinf.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/dtitvinf.cpp @@ -165,7 +165,7 @@ DateIntervalInfo::~DateIntervalInfo() { } -UBool +bool DateIntervalInfo::operator==(const DateIntervalInfo& other) const { UBool equal = ( fFallbackIntervalPattern == other.fFallbackIntervalPattern && diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen.cpp index 4063422a7..2f6d90bed 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen.cpp @@ -411,7 +411,7 @@ DateTimePatternGenerator::operator=(const DateTimePatternGenerator& other) { } -UBool +bool DateTimePatternGenerator::operator==(const DateTimePatternGenerator& other) const { if (this == &other) { return TRUE; @@ -435,7 +435,7 @@ DateTimePatternGenerator::operator==(const DateTimePatternGenerator& other) cons } } -UBool +bool DateTimePatternGenerator::operator!=(const DateTimePatternGenerator& other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen_impl.h b/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen_impl.h index e489567a7..d6eeac09e 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen_impl.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/dtptngen_impl.h @@ -134,20 +134,20 @@ class SkeletonFields : public UMemory { UnicodeString& appendTo(UnicodeString& string) const; UnicodeString& appendFieldTo(int32_t field, UnicodeString& string) const; UChar getFirstChar() const; - inline UBool operator==(const SkeletonFields& other) const; - inline UBool operator!=(const SkeletonFields& other) const; + inline bool operator==(const SkeletonFields& other) const; + inline bool operator!=(const SkeletonFields& other) const; private: int8_t chars[UDATPG_FIELD_COUNT]; int8_t lengths[UDATPG_FIELD_COUNT]; }; -inline UBool SkeletonFields::operator==(const SkeletonFields& other) const { +inline bool SkeletonFields::operator==(const SkeletonFields& other) const { return (uprv_memcmp(chars, other.chars, sizeof(chars)) == 0 && uprv_memcmp(lengths, other.lengths, sizeof(lengths)) == 0); } -inline UBool SkeletonFields::operator!=(const SkeletonFields& other) const { +inline bool SkeletonFields::operator!=(const SkeletonFields& other) const { return (! operator==(other)); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/dtrule.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/dtrule.cpp index 6847f1d16..63949b63a 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/dtrule.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/dtrule.cpp @@ -81,7 +81,7 @@ DateTimeRule::operator=(const DateTimeRule& right) { return *this; } -UBool +bool DateTimeRule::operator==(const DateTimeRule& that) const { return ((this == &that) || (typeid(*this) == typeid(that) && @@ -94,7 +94,7 @@ DateTimeRule::operator==(const DateTimeRule& that) const { fTimeRuleType == that.fTimeRuleType)); } -UBool +bool DateTimeRule::operator!=(const DateTimeRule& that) const { return !operator==(that); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/fmtable.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/fmtable.cpp index 6bcb5d190..f5d94cd44 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/fmtable.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/fmtable.cpp @@ -275,7 +275,7 @@ Formattable::operator=(const Formattable& source) // ------------------------------------- -UBool +bool Formattable::operator==(const Formattable& that) const { int32_t i; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp index 7139af847..fe4bfcda0 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp @@ -151,7 +151,7 @@ Format::parseObject(const UnicodeString& source, // ------------------------------------- -UBool +bool Format::operator==(const Format& that) const { // Subclasses: Call this method and then add more specific checks. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/fpositer.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/fpositer.cpp index 75d529eb8..2db774927 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/fpositer.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/fpositer.cpp @@ -45,7 +45,7 @@ FieldPositionIterator::FieldPositionIterator(const FieldPositionIterator &rhs) } } -UBool FieldPositionIterator::operator==(const FieldPositionIterator &rhs) const { +bool FieldPositionIterator::operator==(const FieldPositionIterator &rhs) const { if (&rhs == this) { return TRUE; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/measfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/measfmt.cpp index 1949f17b1..2783807bc 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/measfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/measfmt.cpp @@ -424,7 +424,7 @@ MeasureFormat::~MeasureFormat() { delete listFormatter; } -UBool MeasureFormat::operator==(const Format &other) const { +bool MeasureFormat::operator==(const Format &other) const { if (this == &other) { // Same object, equal return TRUE; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/measunit.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/measunit.cpp index 7a0a60605..17d8c0ec0 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/measunit.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/measunit.cpp @@ -2042,7 +2042,7 @@ const char *MeasureUnit::getSubtype() const { return fCurrency[0] == 0 ? gSubTypes[getOffset()] : fCurrency; } -UBool MeasureUnit::operator==(const UObject& other) const { +bool MeasureUnit::operator==(const UObject& other) const { if (this == &other) { // Same object, equal return TRUE; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/measure.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/measure.cpp index bffa44215..cf8e3568a 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/measure.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/measure.cpp @@ -56,7 +56,7 @@ Measure::~Measure() { delete unit; } -UBool Measure::operator==(const UObject& other) const { +bool Measure::operator==(const UObject& other) const { if (this == &other) { // Same object, equal return TRUE; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/msgfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/msgfmt.cpp index b97dcfa1d..b187a0078 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/msgfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/msgfmt.cpp @@ -389,7 +389,7 @@ MessageFormat::operator=(const MessageFormat& that) return *this; } -UBool +bool MessageFormat::operator==(const Format& rhs) const { if (this == &rhs) return TRUE; @@ -1869,7 +1869,7 @@ UBool MessageFormat::equalFormats(const void* left, const void* right) { } -UBool MessageFormat::DummyFormat::operator==(const Format&) const { +bool MessageFormat::DummyFormat::operator==(const Format&) const { return TRUE; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.cpp index d4e7d2058..dc337728f 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.cpp @@ -344,7 +344,7 @@ util_equalRules(const NFRule* rule1, const NFRule* rule2) return FALSE; } -UBool +bool NFRuleSet::operator==(const NFRuleSet& rhs) const { if (rules.size() == rhs.rules.size() && diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.h b/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.h index db03c9039..1c3bf4219 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/nfrs.h @@ -40,8 +40,8 @@ class NFRuleSet : public UMemory { ~NFRuleSet(); - UBool operator==(const NFRuleSet& rhs) const; - UBool operator!=(const NFRuleSet& rhs) const { return !operator==(rhs); } + bool operator==(const NFRuleSet& rhs) const; + bool operator!=(const NFRuleSet& rhs) const { return !operator==(rhs); } UBool isPublic() const { return fIsPublic; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.cpp index 487354565..b1c83121a 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.cpp @@ -631,7 +631,7 @@ util_equalSubstitutions(const NFSubstitution* sub1, const NFSubstitution* sub2) * @param that The rule to compare this one against * @return True is the two rules are functionally equivalent */ -UBool +bool NFRule::operator==(const NFRule& rhs) const { return baseValue == rhs.baseValue diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.h b/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.h index ed33eaa5a..0934b5490 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/nfrule.h @@ -54,8 +54,8 @@ class NFRule : public UMemory { NFRule(const RuleBasedNumberFormat* rbnf, const UnicodeString &ruleText, UErrorCode &status); ~NFRule(); - UBool operator==(const NFRule& rhs) const; - UBool operator!=(const NFRule& rhs) const { return !operator==(rhs); } + bool operator==(const NFRule& rhs) const; + bool operator!=(const NFRule& rhs) const { return !operator==(rhs); } ERuleType getType() const { return (ERuleType)(baseValue <= kNoBase ? (ERuleType)baseValue : kOtherRule); } void setType(ERuleType ruleType) { baseValue = (int32_t)ruleType; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.cpp index 8ef8e00e5..77e49af87 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.cpp @@ -96,7 +96,7 @@ class MultiplierSubstitution : public NFSubstitution { } } - virtual UBool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const; virtual int64_t transformNumber(int64_t number) const { return number / divisor; @@ -145,7 +145,7 @@ class ModulusSubstitution : public NFSubstitution { } } - virtual UBool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const; virtual void doSubstitution(int64_t number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; @@ -213,7 +213,7 @@ class FractionalPartSubstitution : public NFSubstitution { UErrorCode& status); virtual ~FractionalPartSubstitution(); - virtual UBool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const; virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; virtual void doSubstitution(int64_t /*number*/, UnicodeString& /*toInsertInto*/, int32_t /*_pos*/, int32_t /*recursionCount*/, UErrorCode& /*status*/) const {} @@ -285,7 +285,7 @@ class NumeratorSubstitution : public NFSubstitution { } virtual ~NumeratorSubstitution(); - virtual UBool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const; virtual int64_t transformNumber(int64_t number) const { return number * ldenominator; } virtual double transformNumber(double number) const { return uprv_round(number * denominator); } @@ -515,7 +515,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NFSubstitution) * @param The substitution to compare this one to * @return true if the two substitutions are functionally equivalent */ -UBool +bool NFSubstitution::operator==(const NFSubstitution& rhs) const { // compare class and all of the fields all substitutions have @@ -810,7 +810,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SameValueSubstitution) UOBJECT_DEFINE_RTTI_IMPLEMENTATION(MultiplierSubstitution) -UBool MultiplierSubstitution::operator==(const NFSubstitution& rhs) const +bool MultiplierSubstitution::operator==(const NFSubstitution& rhs) const { return NFSubstitution::operator==(rhs) && divisor == ((const MultiplierSubstitution*)&rhs)->divisor; @@ -856,7 +856,7 @@ ModulusSubstitution::ModulusSubstitution(int32_t _pos, UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ModulusSubstitution) -UBool ModulusSubstitution::operator==(const NFSubstitution& rhs) const +bool ModulusSubstitution::operator==(const NFSubstitution& rhs) const { return NFSubstitution::operator==(rhs) && divisor == ((const ModulusSubstitution*)&rhs)->divisor && @@ -1195,7 +1195,7 @@ FractionalPartSubstitution::doParse(const UnicodeString& text, } } -UBool +bool FractionalPartSubstitution::operator==(const NFSubstitution& rhs) const { return NFSubstitution::operator==(rhs) && @@ -1325,7 +1325,7 @@ NumeratorSubstitution::doParse(const UnicodeString& text, return TRUE; } -UBool +bool NumeratorSubstitution::operator==(const NFSubstitution& rhs) const { return NFSubstitution::operator==(rhs) && diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.h b/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.h index 948627c0c..49eb0a070 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.h @@ -74,7 +74,7 @@ class NFSubstitution : public UObject { * @param rhs the object to be compared with. * @return true if the given Format objects are semantically equal. */ - virtual UBool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const; /** * Return true if the given Format objects are semantically unequal. @@ -82,7 +82,7 @@ class NFSubstitution : public UObject { * @param rhs the object to be compared with. * @return true if the given Format objects are semantically unequal. */ - UBool operator!=(const NFSubstitution& rhs) const { return !operator==(rhs); } + bool operator!=(const NFSubstitution& rhs) const { return !operator==(rhs); } /** * Sets the substitution's divisor. Used by NFRule.setBaseValue(). diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.cpp index 065f57028..dee276771 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.cpp @@ -35,7 +35,7 @@ LocalizedNumberFormatterAsFormat::LocalizedNumberFormatterAsFormat( LocalizedNumberFormatterAsFormat::~LocalizedNumberFormatterAsFormat() = default; -UBool LocalizedNumberFormatterAsFormat::operator==(const Format& other) const { +bool LocalizedNumberFormatterAsFormat::operator==(const Format& other) const { auto* _other = dynamic_cast(&other); if (_other == nullptr) { return false; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.h b/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.h index 7b0a1dee6..ca162ae2a 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/number_asformat.h @@ -40,7 +40,7 @@ class U_I18N_API LocalizedNumberFormatterAsFormat : public Format { /** * Equals operator. */ - UBool operator==(const Format& other) const U_OVERRIDE; + bool operator==(const Format& other) const U_OVERRIDE; /** * Creates a copy of this object. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/numfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/numfmt.cpp index 7c3a0551c..a8b55be4b 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/numfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/numfmt.cpp @@ -285,7 +285,7 @@ NumberFormat::operator=(const NumberFormat& rhs) // ------------------------------------- -UBool +bool NumberFormat::operator==(const Format& that) const { // Format::operator== guarantees this cast is safe diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.cpp index d21e6e992..01b913ab7 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.cpp @@ -308,7 +308,7 @@ OlsonTimeZone::~OlsonTimeZone() { /** * Returns true if the two TimeZone objects are equal. */ -UBool OlsonTimeZone::operator==(const TimeZone& other) const { +bool OlsonTimeZone::operator==(const TimeZone& other) const { return ((this == &other) || (typeid(*this) == typeid(other) && TimeZone::operator==(other) && diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.h b/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.h index a3b7dcc8f..c4e225910 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/olsontz.h @@ -146,7 +146,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { /** * Returns true if the two TimeZone objects are equal. */ - virtual UBool operator==(const TimeZone& other) const; + virtual bool operator==(const TimeZone& other) const; /** * TimeZone API. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/plurfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/plurfmt.cpp index b99437630..292a3168a 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/plurfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/plurfmt.cpp @@ -381,7 +381,7 @@ PluralFormat::operator=(const PluralFormat& other) { return *this; } -UBool +bool PluralFormat::operator==(const Format& other) const { if (this == &other) { return TRUE; @@ -400,7 +400,7 @@ PluralFormat::operator==(const Format& other) const { *pluralRulesWrapper.pluralRules == *o.pluralRulesWrapper.pluralRules); } -UBool +bool PluralFormat::operator!=(const Format& other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/plurrule.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/plurrule.cpp index 4bca51720..9c1791a9b 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/plurrule.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/plurrule.cpp @@ -440,7 +440,7 @@ PluralRules::getKeywordOther() const { return UnicodeString(TRUE, PLURAL_KEYWORD_OTHER, 5); } -UBool +bool PluralRules::operator==(const PluralRules& other) const { const UnicodeString *ptrKeyword; UErrorCode status= U_ZERO_ERROR; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/rbnf.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/rbnf.cpp index 49e6bf9e9..0efc2ddce 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/rbnf.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/rbnf.cpp @@ -99,8 +99,8 @@ class LocalizationInfo : public UMemory { return NULL; } - virtual UBool operator==(const LocalizationInfo* rhs) const; - inline UBool operator!=(const LocalizationInfo* rhs) const { return !operator==(rhs); } + virtual bool operator==(const LocalizationInfo* rhs) const; + inline bool operator!=(const LocalizationInfo* rhs) const { return !operator==(rhs); } virtual int32_t getNumberOfRuleSets(void) const = 0; virtual const UChar* getRuleSetName(int32_t index) const = 0; @@ -131,7 +131,7 @@ streq(const UChar* lhs, const UChar* rhs) { return FALSE; } -UBool +bool LocalizationInfo::operator==(const LocalizationInfo* rhs) const { if (rhs) { if (this == rhs) { @@ -936,7 +936,7 @@ RuleBasedNumberFormat::clone() const return new RuleBasedNumberFormat(*this); } -UBool +bool RuleBasedNumberFormat::operator==(const Format& other) const { if (this == &other) { diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/rbtz.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/rbtz.cpp index 3249a32a1..7cf1d37e5 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/rbtz.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/rbtz.cpp @@ -88,7 +88,7 @@ RuleBasedTimeZone::operator=(const RuleBasedTimeZone& right) { return *this; } -UBool +bool RuleBasedTimeZone::operator==(const TimeZone& that) const { if (this == &that) { return TRUE; @@ -108,7 +108,7 @@ RuleBasedTimeZone::operator==(const TimeZone& that) const { return FALSE; } -UBool +bool RuleBasedTimeZone::operator!=(const TimeZone& that) const { return !operator==(that); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/region.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/region.cpp index 76445aef3..0d9e7a1b7 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/region.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/region.cpp @@ -439,7 +439,7 @@ Region::~Region () { * Returns true if the two regions are equal. * Per PMC, just use pointer compare, since we have at most one instance of each Region. */ -UBool +bool Region::operator==(const Region &that) const { return (idStr == that.idStr); } @@ -448,7 +448,7 @@ Region::operator==(const Region &that) const { * Returns true if the two regions are NOT equal; that is, if operator ==() returns false. * Per PMC, just use pointer compare, since we have at most one instance of each Region. */ -UBool +bool Region::operator!=(const Region &that) const { return (idStr != that.idStr); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.cpp index af62aaee7..1c8c44a88 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.cpp @@ -135,7 +135,7 @@ RelativeDateFormat* RelativeDateFormat::clone() const { return new RelativeDateFormat(*this); } -UBool RelativeDateFormat::operator==(const Format& other) const { +bool RelativeDateFormat::operator==(const Format& other) const { if(DateFormat::operator==(other)) { // The DateFormat::operator== check for fCapitalizationContext equality above // is sufficient to check equality of all derived context-related data. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.h index 02760569e..24fffb7b5 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/reldtfmt.h @@ -80,7 +80,7 @@ class RelativeDateFormat : public DateFormat { * @return true if the given Format objects are semantically equal. * @internal ICU 3.8 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; using DateFormat::format; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/rulebasedcollator.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/rulebasedcollator.cpp index 60acf1781..f00d536c2 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/rulebasedcollator.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/rulebasedcollator.cpp @@ -239,7 +239,7 @@ RuleBasedCollator &RuleBasedCollator::operator=(const RuleBasedCollator &other) UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RuleBasedCollator) -UBool +bool RuleBasedCollator::operator==(const Collator& other) const { if(this == &other) { return TRUE; } if(!Collator::operator==(other)) { return FALSE; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/selfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/selfmt.cpp index 3badef4fd..37f4e6ed8 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/selfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/selfmt.cpp @@ -164,7 +164,7 @@ SelectFormat::operator=(const SelectFormat& other) { return *this; } -UBool +bool SelectFormat::operator==(const Format& other) const { if (this == &other) { return TRUE; @@ -176,7 +176,7 @@ SelectFormat::operator==(const Format& other) const { return msgPattern == o.msgPattern; } -UBool +bool SelectFormat::operator!=(const Format& other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/simpletz.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/simpletz.cpp index 7972e2bb0..80e0df555 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/simpletz.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/simpletz.cpp @@ -231,7 +231,7 @@ SimpleTimeZone::operator=(const SimpleTimeZone &right) // ------------------------------------- -UBool +bool SimpleTimeZone::operator==(const TimeZone& that) const { return ((this == &that) || diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/smpdtfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/smpdtfmt.cpp index d16eed035..68792a318 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/smpdtfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/smpdtfmt.cpp @@ -628,7 +628,7 @@ SimpleDateFormat::clone() const //---------------------------------------------------------------------- -UBool +bool SimpleDateFormat::operator==(const Format& other) const { if (DateFormat::operator==(other)) { diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/sortkey.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/sortkey.cpp index 12289482e..2a86cad1b 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/sortkey.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/sortkey.cpp @@ -137,7 +137,7 @@ CollationKey::setToBogus() return *this; } -UBool +bool CollationKey::operator==(const CollationKey& source) const { return getLength() == source.getLength() && diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/timezone.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/timezone.cpp index 7d0f094a2..e8c670448 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/timezone.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/timezone.cpp @@ -376,7 +376,7 @@ TimeZone::operator=(const TimeZone &right) // ------------------------------------- -UBool +bool TimeZone::operator==(const TimeZone& that) const { return typeid(*this) == typeid(that) && diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tmutamt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/tmutamt.cpp index 25464693e..2753c2937 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tmutamt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tmutamt.cpp @@ -45,7 +45,7 @@ TimeUnitAmount::operator=(const TimeUnitAmount& other) { } -UBool +bool TimeUnitAmount::operator==(const UObject& other) const { return Measure::operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tzfmt.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/tzfmt.cpp index 0beaa310d..2f4166c93 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tzfmt.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tzfmt.cpp @@ -482,7 +482,7 @@ TimeZoneFormat::operator=(const TimeZoneFormat& other) { } -UBool +bool TimeZoneFormat::operator==(const Format& other) const { TimeZoneFormat* tzfmt = (TimeZoneFormat*)&other; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp index b8d44244c..eb4d80103 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp @@ -1287,7 +1287,7 @@ TimeZoneGenericNames::createInstance(const Locale& locale, UErrorCode& status) { return instance; } -UBool +bool TimeZoneGenericNames::operator==(const TimeZoneGenericNames& other) const { // Just compare if the other object also use the same // ref entry diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.h b/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.h index 71d9d84dc..6be9862b1 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.h @@ -45,8 +45,8 @@ class U_I18N_API TimeZoneGenericNames : public UMemory { static TimeZoneGenericNames* createInstance(const Locale& locale, UErrorCode& status); - virtual UBool operator==(const TimeZoneGenericNames& other) const; - virtual UBool operator!=(const TimeZoneGenericNames& other) const {return !operator==(other);} + virtual bool operator==(const TimeZoneGenericNames& other) const; + virtual bool operator!=(const TimeZoneGenericNames& other) const {return !operator==(other);} virtual TimeZoneGenericNames* clone() const; UnicodeString& getDisplayName(const TimeZone& tz, UTimeZoneGenericNameType type, diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tznames.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/tznames.cpp index 2343c9a26..d898bc2e8 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tznames.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tznames.cpp @@ -104,8 +104,8 @@ class TimeZoneNamesDelegate : public TimeZoneNames { TimeZoneNamesDelegate(const Locale& locale, UErrorCode& status); virtual ~TimeZoneNamesDelegate(); - virtual UBool operator==(const TimeZoneNames& other) const; - virtual UBool operator!=(const TimeZoneNames& other) const {return !operator==(other);} + virtual bool operator==(const TimeZoneNames& other) const; + virtual bool operator!=(const TimeZoneNames& other) const {return !operator==(other);} virtual TimeZoneNamesDelegate* clone() const; StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const; @@ -219,7 +219,7 @@ TimeZoneNamesDelegate::~TimeZoneNamesDelegate() { umtx_unlock(&gTimeZoneNamesLock); } -UBool +bool TimeZoneNamesDelegate::operator==(const TimeZoneNames& other) const { if (this == &other) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.cpp index 43cf8f430..14c8e8d71 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.cpp @@ -1104,7 +1104,7 @@ TimeZoneNamesImpl::cleanup() { } } -UBool +bool TimeZoneNamesImpl::operator==(const TimeZoneNames& other) const { if (this == &other) { return TRUE; @@ -2156,7 +2156,7 @@ TZDBTimeZoneNames::TZDBTimeZoneNames(const Locale& locale) TZDBTimeZoneNames::~TZDBTimeZoneNames() { } -UBool +bool TZDBTimeZoneNames::operator==(const TimeZoneNames& other) const { if (this == &other) { return TRUE; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.h b/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.h index 1286eeb80..f70452c60 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tznames_impl.h @@ -173,7 +173,7 @@ class TimeZoneNamesImpl : public TimeZoneNames { virtual ~TimeZoneNamesImpl(); - virtual UBool operator==(const TimeZoneNames& other) const; + virtual bool operator==(const TimeZoneNames& other) const; virtual TimeZoneNamesImpl* clone() const; StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const; @@ -235,7 +235,7 @@ class TZDBTimeZoneNames : public TimeZoneNames { TZDBTimeZoneNames(const Locale& locale); virtual ~TZDBTimeZoneNames(); - virtual UBool operator==(const TimeZoneNames& other) const; + virtual bool operator==(const TimeZoneNames& other) const; virtual TZDBTimeZoneNames* clone() const; StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tzrule.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/tzrule.cpp index 759a2d4c6..0303cfcf1 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tzrule.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tzrule.cpp @@ -53,7 +53,7 @@ TimeZoneRule::operator=(const TimeZoneRule& right) { return *this; } -UBool +bool TimeZoneRule::operator==(const TimeZoneRule& that) const { return ((this == &that) || (typeid(*this) == typeid(that) && @@ -62,7 +62,7 @@ TimeZoneRule::operator==(const TimeZoneRule& that) const { fDSTSavings == that.fDSTSavings)); } -UBool +bool TimeZoneRule::operator!=(const TimeZoneRule& that) const { return !operator==(that); } @@ -120,14 +120,14 @@ InitialTimeZoneRule::operator=(const InitialTimeZoneRule& right) { return *this; } -UBool +bool InitialTimeZoneRule::operator==(const TimeZoneRule& that) const { return ((this == &that) || (typeid(*this) == typeid(that) && TimeZoneRule::operator==(that))); } -UBool +bool InitialTimeZoneRule::operator!=(const TimeZoneRule& that) const { return !operator==(that); } @@ -226,7 +226,7 @@ AnnualTimeZoneRule::operator=(const AnnualTimeZoneRule& right) { return *this; } -UBool +bool AnnualTimeZoneRule::operator==(const TimeZoneRule& that) const { if (this == &that) { return TRUE; @@ -240,7 +240,7 @@ AnnualTimeZoneRule::operator==(const TimeZoneRule& that) const { fEndYear == atzr->fEndYear); } -UBool +bool AnnualTimeZoneRule::operator!=(const TimeZoneRule& that) const { return !operator==(that); } @@ -445,7 +445,7 @@ TimeArrayTimeZoneRule::operator=(const TimeArrayTimeZoneRule& right) { return *this; } -UBool +bool TimeArrayTimeZoneRule::operator==(const TimeZoneRule& that) const { if (this == &that) { return TRUE; @@ -469,7 +469,7 @@ TimeArrayTimeZoneRule::operator==(const TimeZoneRule& that) const { return res; } -UBool +bool TimeArrayTimeZoneRule::operator!=(const TimeZoneRule& that) const { return !operator==(that); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/tztrans.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/tztrans.cpp index 3199b78ea..8230ed209 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/tztrans.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/tztrans.cpp @@ -63,7 +63,7 @@ TimeZoneTransition::operator=(const TimeZoneTransition& right) { return *this; } -UBool +bool TimeZoneTransition::operator==(const TimeZoneTransition& that) const { if (this == &that) { return TRUE; @@ -84,7 +84,7 @@ TimeZoneTransition::operator==(const TimeZoneTransition& that) const { return FALSE; } -UBool +bool TimeZoneTransition::operator!=(const TimeZoneTransition& that) const { return !operator==(that); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/alphaindex.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/alphaindex.h index e3c68ea7c..d38a20893 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/alphaindex.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/alphaindex.h @@ -660,13 +660,13 @@ class U_I18N_API AlphabeticIndex: public UObject { * No Equality operators. * @internal */ - virtual UBool operator==(const AlphabeticIndex& other) const; + virtual bool operator==(const AlphabeticIndex& other) const; /** * Inequality operator. * @internal */ - virtual UBool operator!=(const AlphabeticIndex& other) const; + virtual bool operator!=(const AlphabeticIndex& other) const; // Common initialization, for use from all constructors. void init(const Locale *locale, UErrorCode &status); diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/calendar.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/calendar.h index 2a8c2935c..ba880c30d 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/calendar.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/calendar.h @@ -451,7 +451,7 @@ class U_I18N_API Calendar : public UObject { * otherwise. * @stable ICU 2.0 */ - virtual UBool operator==(const Calendar& that) const; + virtual bool operator==(const Calendar& that) const; /** * Compares the inequality of two Calendar objects. @@ -461,7 +461,7 @@ class U_I18N_API Calendar : public UObject { * otherwise. * @stable ICU 2.0 */ - UBool operator!=(const Calendar& that) const {return !operator==(that);} + bool operator!=(const Calendar& that) const {return !operator==(that);} /** * Returns TRUE if the given Calendar object is equivalent to this diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/choicfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/choicfmt.h index 3b2f48cb1..867cd38d0 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/choicfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/choicfmt.h @@ -261,7 +261,7 @@ class U_I18N_API ChoiceFormat: public NumberFormat { * @return true if other is the same as this. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; /** * Sets the pattern. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h index f4995e05e..c028aef6b 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h @@ -156,7 +156,7 @@ class U_I18N_API CollationElementIterator U_FINAL : public UObject { * @return true if "other" is the same as "this" * @stable ICU 2.0 */ - UBool operator==(const CollationElementIterator& other) const; + bool operator==(const CollationElementIterator& other) const; /** * Returns true if "other" is not the same as "this". @@ -165,7 +165,7 @@ class U_I18N_API CollationElementIterator U_FINAL : public UObject { * @return true if "other" is not the same as "this" * @stable ICU 2.0 */ - UBool operator!=(const CollationElementIterator& other) const; + bool operator!=(const CollationElementIterator& other) const; /** * Resets the cursor to the beginning of the string. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coll.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coll.h index bf478853b..7dcd367c5 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coll.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coll.h @@ -251,7 +251,7 @@ class U_I18N_API Collator : public UObject { * @return TRUE if other is the same as this. * @stable ICU 2.0 */ - virtual UBool operator==(const Collator& other) const; + virtual bool operator==(const Collator& other) const; /** * Returns true if "other" is not the same as "this". @@ -260,7 +260,7 @@ class U_I18N_API Collator : public UObject { * @return TRUE if other is not the same as this. * @stable ICU 2.0 */ - virtual UBool operator!=(const Collator& other) const; + virtual bool operator!=(const Collator& other) const; /** * Makes a copy of this object. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/currpinf.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/currpinf.h index fb0b2a7db..8e73f9f00 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/currpinf.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/currpinf.h @@ -92,7 +92,7 @@ class U_I18N_API CurrencyPluralInfo : public UObject { * * @stable ICU 4.2 */ - UBool operator==(const CurrencyPluralInfo& info) const; + bool operator==(const CurrencyPluralInfo& info) const; /** @@ -100,7 +100,7 @@ class U_I18N_API CurrencyPluralInfo : public UObject { * * @stable ICU 4.2 */ - UBool operator!=(const CurrencyPluralInfo& info) const; + bool operator!=(const CurrencyPluralInfo& info) const; /** @@ -259,7 +259,7 @@ class U_I18N_API CurrencyPluralInfo : public UObject { }; -inline UBool +inline bool CurrencyPluralInfo::operator!=(const CurrencyPluralInfo& info) const { return !operator==(info); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/datefmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/datefmt.h index b4a6cb302..7ae2fc232 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/datefmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/datefmt.h @@ -235,7 +235,7 @@ class U_I18N_API DateFormat : public Format { * Equality operator. Returns true if the two formats have the same behavior. * @stable ICU 2.0 */ - virtual UBool operator==(const Format&) const; + virtual bool operator==(const Format&) const; using Format::format; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dcfmtsym.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dcfmtsym.h index e1e0ab6b0..84f6e07f7 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dcfmtsym.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dcfmtsym.h @@ -255,7 +255,7 @@ class U_I18N_API DecimalFormatSymbols : public UObject { * @return true if another object is semantically equal to this one. * @stable ICU 2.0 */ - UBool operator==(const DecimalFormatSymbols& other) const; + bool operator==(const DecimalFormatSymbols& other) const; /** * Return true if another object is semantically unequal to this one. @@ -264,7 +264,7 @@ class U_I18N_API DecimalFormatSymbols : public UObject { * @return true if another object is semantically unequal to this one. * @stable ICU 2.0 */ - UBool operator!=(const DecimalFormatSymbols& other) const { return !operator==(other); } + bool operator!=(const DecimalFormatSymbols& other) const { return !operator==(other); } /** * Get one of the format symbols by its enum constant. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/decimfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/decimfmt.h index c33ec80ca..d7a12e5e2 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/decimfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/decimfmt.h @@ -909,7 +909,7 @@ class U_I18N_API DecimalFormat : public NumberFormat { * @return true if the given Format objects are semantically equal. * @stable ICU 2.0 */ - UBool operator==(const Format& other) const U_OVERRIDE; + bool operator==(const Format& other) const U_OVERRIDE; using NumberFormat::format; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtfmtsym.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtfmtsym.h index c6d76fe98..1bbd92e57 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtfmtsym.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtfmtsym.h @@ -174,7 +174,7 @@ class U_I18N_API DateFormatSymbols U_FINAL : public UObject { * @return true if other is semantically equal to this. * @stable ICU 2.0 */ - UBool operator==(const DateFormatSymbols& other) const; + bool operator==(const DateFormatSymbols& other) const; /** * Return true if another object is semantically unequal to this one. @@ -183,7 +183,7 @@ class U_I18N_API DateFormatSymbols U_FINAL : public UObject { * @return true if other is semantically unequal to this. * @stable ICU 2.0 */ - UBool operator!=(const DateFormatSymbols& other) const { return !operator==(other); } + bool operator!=(const DateFormatSymbols& other) const { return !operator==(other); } /** * Gets abbreviated era strings. For example: "AD" and "BC". diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvfmt.h index 23fc02e2a..e3aea2521 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvfmt.h @@ -443,7 +443,7 @@ class U_I18N_API DateIntervalFormat : public Format { * @return true if the given Format objects are semantically equal. * @stable ICU 4.0 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; /** * Return true if the given Format objects are not semantically equal. @@ -452,7 +452,7 @@ class U_I18N_API DateIntervalFormat : public Format { * @return true if the given Format objects are not semantically equal. * @stable ICU 4.0 */ - UBool operator!=(const Format& other) const; + bool operator!=(const Format& other) const; using Format::format; @@ -1144,7 +1144,7 @@ class U_I18N_API DateIntervalFormat : public Format { UnicodeString* fDateTimeFormat; }; -inline UBool +inline bool DateIntervalFormat::operator!=(const Format& other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvinf.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvinf.h index a894d12ca..f3a6dd01b 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvinf.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtitvinf.h @@ -214,7 +214,7 @@ class U_I18N_API DateIntervalInfo U_FINAL : public UObject { * @return true if other is semantically equal to this. * @stable ICU 4.0 */ - virtual UBool operator==(const DateIntervalInfo& other) const; + virtual bool operator==(const DateIntervalInfo& other) const; /** * Return true if another object is semantically unequal to this one. @@ -223,7 +223,7 @@ class U_I18N_API DateIntervalInfo U_FINAL : public UObject { * @return true if other is semantically unequal to this. * @stable ICU 4.0 */ - UBool operator!=(const DateIntervalInfo& other) const; + bool operator!=(const DateIntervalInfo& other) const; @@ -507,7 +507,7 @@ class U_I18N_API DateIntervalInfo U_FINAL : public UObject { };// end class DateIntervalInfo -inline UBool +inline bool DateIntervalInfo::operator!=(const DateIntervalInfo& other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtptngen.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtptngen.h index a71938b31..06bf15702 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtptngen.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtptngen.h @@ -113,7 +113,7 @@ class U_I18N_API DateTimePatternGenerator : public UObject { * @return true if other is semantically equal to this. * @stable ICU 3.8 */ - UBool operator==(const DateTimePatternGenerator& other) const; + bool operator==(const DateTimePatternGenerator& other) const; /** * Return true if another object is semantically unequal to this one. @@ -122,7 +122,7 @@ class U_I18N_API DateTimePatternGenerator : public UObject { * @return true if other is semantically unequal to this. * @stable ICU 3.8 */ - UBool operator!=(const DateTimePatternGenerator& other) const; + bool operator!=(const DateTimePatternGenerator& other) const; /** * Utility to return a unique skeleton from a given pattern. For example, diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtrule.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtrule.h index adab8967f..09eeba674 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtrule.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/dtrule.h @@ -144,7 +144,7 @@ class U_I18N_API DateTimeRule : public UObject { * @return true if the given DateTimeRule objects are semantically equal. * @stable ICU 3.8 */ - UBool operator==(const DateTimeRule& that) const; + bool operator==(const DateTimeRule& that) const; /** * Return true if the given DateTimeRule objects are semantically unequal. Objects @@ -153,7 +153,7 @@ class U_I18N_API DateTimeRule : public UObject { * @return true if the given DateTimeRule objects are semantically unequal. * @stable ICU 3.8 */ - UBool operator!=(const DateTimeRule& that) const; + bool operator!=(const DateTimeRule& that) const; /** * Gets the date rule type, such as DOM diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fieldpos.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fieldpos.h index 23ee38624..4843e0214 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fieldpos.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fieldpos.h @@ -164,7 +164,7 @@ class U_I18N_API FieldPosition : public UObject { * @return TRUE if the two field positions are equal, FALSE otherwise. * @stable ICU 2.0 */ - UBool operator==(const FieldPosition& that) const; + bool operator==(const FieldPosition& that) const; /** * Equality operator. @@ -172,7 +172,7 @@ class U_I18N_API FieldPosition : public UObject { * @return TRUE if the two field positions are not equal, FALSE otherwise. * @stable ICU 2.0 */ - UBool operator!=(const FieldPosition& that) const; + bool operator!=(const FieldPosition& that) const; /** * Clone this object. @@ -274,7 +274,7 @@ FieldPosition::operator=(const FieldPosition& copy) return *this; } -inline UBool +inline bool FieldPosition::operator==(const FieldPosition& copy) const { return (fField == copy.fField && @@ -282,7 +282,7 @@ FieldPosition::operator==(const FieldPosition& copy) const fBeginIndex == copy.fBeginIndex); } -inline UBool +inline bool FieldPosition::operator!=(const FieldPosition& copy) const { return !operator==(copy); diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fmtable.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fmtable.h index 7bec4f690..a83d905a6 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fmtable.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fmtable.h @@ -182,7 +182,7 @@ class U_I18N_API Formattable : public UObject { * @return TRUE if other are equal to this, FALSE otherwise. * @stable ICU 2.0 */ - UBool operator==(const Formattable &other) const; + bool operator==(const Formattable &other) const; /** * Equality operator. @@ -190,7 +190,7 @@ class U_I18N_API Formattable : public UObject { * @return TRUE if other are unequal to this, FALSE otherwise. * @stable ICU 2.0 */ - UBool operator!=(const Formattable& other) const + bool operator!=(const Formattable& other) const { return !operator==(other); } /** diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h index 8788f77ee..f1a49d958 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h @@ -111,7 +111,7 @@ class U_I18N_API Format : public UObject { * Objects of different subclasses are considered unequal. * @stable ICU 2.0 */ - virtual UBool operator==(const Format& other) const = 0; + virtual bool operator==(const Format& other) const = 0; /** * Return true if the given Format objects are not semantically @@ -120,7 +120,7 @@ class U_I18N_API Format : public UObject { * @return Return true if the given Format objects are not semantically. * @stable ICU 2.0 */ - UBool operator!=(const Format& other) const { return !operator==(other); } + bool operator!=(const Format& other) const { return !operator==(other); } /** * Clone this object polymorphically. The caller is responsible diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fpositer.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fpositer.h index 3e8a0108f..99d691332 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fpositer.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/fpositer.h @@ -84,7 +84,7 @@ class U_I18N_API FieldPositionIterator : public UObject { * equal array of run values. * @stable ICU 4.4 */ - UBool operator==(const FieldPositionIterator&) const; + bool operator==(const FieldPositionIterator&) const; /** * Returns the complement of the result of operator== @@ -92,7 +92,7 @@ class U_I18N_API FieldPositionIterator : public UObject { * @return the complement of the result of operator== * @stable ICU 4.4 */ - UBool operator!=(const FieldPositionIterator& rhs) const { return !operator==(rhs); } + bool operator!=(const FieldPositionIterator& rhs) const { return !operator==(rhs); } /** * If the current position is valid, updates the FieldPosition values, advances the iterator, diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measfmt.h index b4f904862..b7756cb25 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measfmt.h @@ -147,7 +147,7 @@ class U_I18N_API MeasureFormat : public Format { * Return true if given Format objects are semantically equal. * @stable ICU 53 */ - virtual UBool operator==(const Format &other) const; + virtual bool operator==(const Format &other) const; /** * Clones this object polymorphically. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measunit.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measunit.h index dbcad62f2..5049c212a 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measunit.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measunit.h @@ -77,14 +77,14 @@ class U_I18N_API MeasureUnit: public UObject { * to the given object. * @stable ICU 3.0 */ - virtual UBool operator==(const UObject& other) const; + virtual bool operator==(const UObject& other) const; /** * Inequality operator. Return true if this object is not equal * to the given object. * @stable ICU 53 */ - UBool operator!=(const UObject& other) const { + bool operator!=(const UObject& other) const { return !(*this == other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measure.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measure.h index fa9c29351..1fd20dfca 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measure.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/measure.h @@ -87,7 +87,7 @@ class U_I18N_API Measure: public UObject { * to the given object. * @stable ICU 3.0 */ - UBool operator==(const UObject& other) const; + bool operator==(const UObject& other) const; /** * Return a reference to the numeric value of this object. The diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/msgfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/msgfmt.h index 99b0eaeec..39d70ce04 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/msgfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/msgfmt.h @@ -429,7 +429,7 @@ class U_I18N_API MessageFormat : public Format { * @return true if the given Format objects are semantically equal. * @stable ICU 2.0 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; /** * Sets the locale to be used for creating argument Format objects. @@ -1088,7 +1088,7 @@ class U_I18N_API MessageFormat : public Format { */ class U_I18N_API DummyFormat : public Format { public: - virtual UBool operator==(const Format&) const; + virtual bool operator==(const Format&) const; virtual DummyFormat* clone() const; virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/numfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/numfmt.h index fbd4fb4e5..af67223bf 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/numfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/numfmt.h @@ -276,7 +276,7 @@ class U_I18N_API NumberFormat : public Format { * @return true if the given Format objects are semantically equal. * @stable ICU 2.0 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; using Format::format; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurfmt.h index 6faa5ad49..f8d3e1779 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurfmt.h @@ -434,7 +434,7 @@ class U_I18N_API PluralFormat : public Format { * @return true if other is semantically equal to this. * @stable ICU 4.0 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; /** * Return true if another object is semantically unequal to this one. @@ -443,7 +443,7 @@ class U_I18N_API PluralFormat : public Format { * @return true if other is semantically unequal to this. * @stable ICU 4.0 */ - virtual UBool operator!=(const Format& other) const; + virtual bool operator!=(const Format& other) const; /** * Clones this Format object polymorphically. The caller owns the diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurrule.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurrule.h index 4e1ef017b..c299470b8 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurrule.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/plurrule.h @@ -484,7 +484,7 @@ class U_I18N_API PluralRules : public UObject { * PluralRules; false otherwise. * @stable ICU 4.0 */ - virtual UBool operator==(const PluralRules& other) const; + virtual bool operator==(const PluralRules& other) const; /** * Compares the inequality of two PluralRules objects. @@ -494,7 +494,7 @@ class U_I18N_API PluralRules : public UObject { * PluralRules; false otherwise. * @stable ICU 4.0 */ - UBool operator!=(const PluralRules& other) const {return !operator==(other);} + bool operator!=(const PluralRules& other) const {return !operator==(other);} /** diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbnf.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbnf.h index fa494957d..da5d900c8 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbnf.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbnf.h @@ -707,7 +707,7 @@ class U_I18N_API RuleBasedNumberFormat : public NumberFormat { * @return true if the given Format objects are semantically equal. * @stable ICU 2.6 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; //----------------------------------------------------------------------- // public API functions diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbtz.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbtz.h index d66e1f08e..32129a50f 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbtz.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/rbtz.h @@ -76,7 +76,7 @@ class U_I18N_API RuleBasedTimeZone : public BasicTimeZone { *semantically equal. * @stable ICU 3.8 */ - virtual UBool operator==(const TimeZone& that) const; + virtual bool operator==(const TimeZone& that) const; /** * Return true if the given TimeZone objects are @@ -86,7 +86,7 @@ class U_I18N_API RuleBasedTimeZone : public BasicTimeZone { * semantically unequal. * @stable ICU 3.8 */ - virtual UBool operator!=(const TimeZone& that) const; + virtual bool operator!=(const TimeZone& that) const; /** * Adds the TimeZoneRule which represents time transitions. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/region.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/region.h index 9ec8dd451..ba4a650f4 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/region.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/region.h @@ -81,13 +81,13 @@ class U_I18N_API Region : public UObject { * Returns true if the two regions are equal. * @stable ICU 51 */ - UBool operator==(const Region &that) const; + bool operator==(const Region &that) const; /** * Returns true if the two regions are NOT equal; that is, if operator ==() returns false. * @stable ICU 51 */ - UBool operator!=(const Region &that) const; + bool operator!=(const Region &that) const; /** * Returns a pointer to a Region using the given region code. The region code can be either 2-letter ISO code, diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/search.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/search.h index 7e328bcd2..c79fbfdab 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/search.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/search.h @@ -272,7 +272,7 @@ // * attributes. FALSE otherwise. // * @stable ICU 2.0 // */ -// virtual UBool operator==(const SearchIterator &that) const; +// virtual bool operator==(const SearchIterator &that) const; // /** // * Not-equal operator. @@ -280,7 +280,7 @@ // * @return FALSE if operator== returns TRUE, and vice versa. // * @stable ICU 2.0 // */ -// UBool operator!=(const SearchIterator &that) const; +// bool operator!=(const SearchIterator &that) const; // // public methods ---------------------------------------------------- diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/selfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/selfmt.h index 971be21c1..de77602fe 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/selfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/selfmt.h @@ -259,7 +259,7 @@ class U_I18N_API SelectFormat : public Format { * @return true if other is semantically equal to this. * @stable ICU 4.4 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; /** * Return true if another object is semantically unequal to this one. @@ -268,7 +268,7 @@ class U_I18N_API SelectFormat : public Format { * @return true if other is semantically unequal to this. * @stable ICU 4.4 */ - virtual UBool operator!=(const Format& other) const; + virtual bool operator!=(const Format& other) const; /** * Clones this Format object polymorphically. The caller owns the diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/simpletz.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/simpletz.h index 980a1b8c6..362489223 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/simpletz.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/simpletz.h @@ -111,7 +111,7 @@ class U_I18N_API SimpleTimeZone: public BasicTimeZone { * otherwise. * @stable ICU 2.0 */ - virtual UBool operator==(const TimeZone& that) const; + virtual bool operator==(const TimeZone& that) const; /** * Constructs a SimpleTimeZone with the given raw GMT offset and time zone ID, diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/smpdtfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/smpdtfmt.h index 5549ffb4a..ad390213b 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/smpdtfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/smpdtfmt.h @@ -876,7 +876,7 @@ class U_I18N_API SimpleDateFormat: public DateFormat { * @return true if the given Format objects are semantically equal. * @stable ICU 2.0 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; using DateFormat::format; diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/sortkey.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/sortkey.h index 34ed7ee69..ee0e6a5ce 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/sortkey.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/sortkey.h @@ -145,7 +145,7 @@ class U_I18N_API CollationKey : public UObject { * @return Returns true if two collation keys are equal, false otherwise. * @stable ICU 2.0 */ - UBool operator==(const CollationKey& source) const; + bool operator==(const CollationKey& source) const; /** * Compare if two collation keys are not the same. @@ -153,7 +153,7 @@ class U_I18N_API CollationKey : public UObject { * @return Returns TRUE if two collation keys are different, FALSE otherwise. * @stable ICU 2.0 */ - UBool operator!=(const CollationKey& source) const; + bool operator!=(const CollationKey& source) const; /** @@ -316,7 +316,7 @@ class U_I18N_API CollationKey : public UObject { } fUnion; }; -inline UBool +inline bool CollationKey::operator!=(const CollationKey& other) const { return !(*this == other); diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/stsearch.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/stsearch.h index e3c812bfd..6dfcf7802 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/stsearch.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/stsearch.h @@ -297,7 +297,7 @@ // * while looking for the same pattern. // * @stable ICU 2.0 // */ -// virtual UBool operator==(const SearchIterator &that) const; +// virtual bool operator==(const SearchIterator &that) const; // // public get and set methods ---------------------------------------- diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tblcoll.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tblcoll.h index f5dc135bc..050b08a9a 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tblcoll.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tblcoll.h @@ -223,7 +223,7 @@ class U_I18N_API RuleBasedCollator : public Collator { * @return true if arguments is the same as this object. * @stable ICU 2.0 */ - virtual UBool operator==(const Collator& other) const; + virtual bool operator==(const Collator& other) const; /** * Makes a copy of this object. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/timezone.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/timezone.h index 4d321186b..eb68485d6 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/timezone.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/timezone.h @@ -445,7 +445,7 @@ class U_I18N_API TimeZone : public UObject { * otherwise. * @stable ICU 2.0 */ - virtual UBool operator==(const TimeZone& that) const; + virtual bool operator==(const TimeZone& that) const; /** * Returns true if the two TimeZones are NOT equal; that is, if operator==() returns @@ -456,7 +456,7 @@ class U_I18N_API TimeZone : public UObject { * otherwise. * @stable ICU 2.0 */ - UBool operator!=(const TimeZone& that) const {return !operator==(that);} + bool operator!=(const TimeZone& that) const {return !operator==(that);} /** * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutamt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutamt.h index 8bcc684d3..13e49668d 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutamt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutamt.h @@ -103,7 +103,7 @@ class U_I18N_API TimeUnitAmount: public Measure { * @return true if this object is equal to the given object. * @stable ICU 4.2 */ - virtual UBool operator==(const UObject& other) const; + virtual bool operator==(const UObject& other) const; /** @@ -112,7 +112,7 @@ class U_I18N_API TimeUnitAmount: public Measure { * @return true if this object is not equal to the given object. * @stable ICU 4.2 */ - UBool operator!=(const UObject& other) const; + bool operator!=(const UObject& other) const; /** @@ -160,7 +160,7 @@ class U_I18N_API TimeUnitAmount: public Measure { -inline UBool +inline bool TimeUnitAmount::operator!=(const UObject& other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutfmt.h index ad871f7c0..b1be87c30 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tmutfmt.h @@ -141,7 +141,7 @@ class U_I18N_API TimeUnitFormat: public MeasureFormat { * @return true if the given Format objects are not semantically equal. * @deprecated ICU 53 */ - UBool operator!=(const Format& other) const; + bool operator!=(const Format& other) const; /** * Set the locale used for formatting or parsing. @@ -236,7 +236,7 @@ class U_I18N_API TimeUnitFormat: public MeasureFormat { friend struct TimeUnitFormatReadSink; }; -inline UBool +inline bool TimeUnitFormat::operator!=(const Format& other) const { return !operator==(other); } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzfmt.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzfmt.h index 6d3863b1e..706f0a037 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzfmt.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzfmt.h @@ -299,7 +299,7 @@ class U_I18N_API TimeZoneFormat : public Format { * Objects of different subclasses are considered unequal. * @stable ICU 50 */ - virtual UBool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const; /** * Clone this object polymorphically. The caller is responsible diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tznames.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tznames.h index 860494221..7bb4d7702 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tznames.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tznames.h @@ -142,7 +142,7 @@ class U_I18N_API TimeZoneNames : public UObject { * @return Return TRUE if the given Format objects are semantically equal. * @stable ICU 50 */ - virtual UBool operator==(const TimeZoneNames& other) const = 0; + virtual bool operator==(const TimeZoneNames& other) const = 0; /** * Return true if the given TimeZoneNames objects are not semantically @@ -151,7 +151,7 @@ class U_I18N_API TimeZoneNames : public UObject { * @return Return TRUE if the given Format objects are not semantically equal. * @stable ICU 50 */ - UBool operator!=(const TimeZoneNames& other) const { return !operator==(other); } + bool operator!=(const TimeZoneNames& other) const { return !operator==(other); } /** * Clone this object polymorphically. The caller is responsible diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzrule.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzrule.h index 795806d90..45c5ab3e0 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzrule.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tzrule.h @@ -56,7 +56,7 @@ class U_I18N_API TimeZoneRule : public UObject { * @return true if the given TimeZoneRule objects are semantically equal. * @stable ICU 3.8 */ - virtual UBool operator==(const TimeZoneRule& that) const; + virtual bool operator==(const TimeZoneRule& that) const; /** * Return true if the given TimeZoneRule objects are semantically unequal. Objects @@ -65,7 +65,7 @@ class U_I18N_API TimeZoneRule : public UObject { * @return true if the given TimeZoneRule objects are semantically unequal. * @stable ICU 3.8 */ - virtual UBool operator!=(const TimeZoneRule& that) const; + virtual bool operator!=(const TimeZoneRule& that) const; /** * Fills in "name" with the name of this time zone. @@ -247,7 +247,7 @@ class U_I18N_API InitialTimeZoneRule : public TimeZoneRule { * @return true if the given TimeZoneRule objects are semantically equal. * @stable ICU 3.8 */ - virtual UBool operator==(const TimeZoneRule& that) const; + virtual bool operator==(const TimeZoneRule& that) const; /** * Return true if the given TimeZoneRule objects are semantically unequal. Objects @@ -256,7 +256,7 @@ class U_I18N_API InitialTimeZoneRule : public TimeZoneRule { * @return true if the given TimeZoneRule objects are semantically unequal. * @stable ICU 3.8 */ - virtual UBool operator!=(const TimeZoneRule& that) const; + virtual bool operator!=(const TimeZoneRule& that) const; /** * Gets the time when this rule takes effect in the given year. @@ -458,7 +458,7 @@ class U_I18N_API AnnualTimeZoneRule : public TimeZoneRule { * @return true if the given TimeZoneRule objects are semantically equal. * @stable ICU 3.8 */ - virtual UBool operator==(const TimeZoneRule& that) const; + virtual bool operator==(const TimeZoneRule& that) const; /** * Return true if the given TimeZoneRule objects are semantically unequal. Objects @@ -467,7 +467,7 @@ class U_I18N_API AnnualTimeZoneRule : public TimeZoneRule { * @return true if the given TimeZoneRule objects are semantically unequal. * @stable ICU 3.8 */ - virtual UBool operator!=(const TimeZoneRule& that) const; + virtual bool operator!=(const TimeZoneRule& that) const; /** * Gets the start date/time rule used by this rule. @@ -674,7 +674,7 @@ class U_I18N_API TimeArrayTimeZoneRule : public TimeZoneRule { * @return true if the given TimeZoneRule objects are semantically equal. * @stable ICU 3.8 */ - virtual UBool operator==(const TimeZoneRule& that) const; + virtual bool operator==(const TimeZoneRule& that) const; /** * Return true if the given TimeZoneRule objects are semantically unequal. Objects @@ -683,7 +683,7 @@ class U_I18N_API TimeArrayTimeZoneRule : public TimeZoneRule { * @return true if the given TimeZoneRule objects are semantically unequal. * @stable ICU 3.8 */ - virtual UBool operator!=(const TimeZoneRule& that) const; + virtual bool operator!=(const TimeZoneRule& that) const; /** * Gets the time type of the start times used by this rule. The return value diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tztrans.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tztrans.h index 217d711ee..03d961846 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tztrans.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/tztrans.h @@ -86,7 +86,7 @@ class U_I18N_API TimeZoneTransition : public UObject { * @return true if the given TimeZoneTransition objects are semantically equal. * @stable ICU 3.8 */ - UBool operator==(const TimeZoneTransition& that) const; + bool operator==(const TimeZoneTransition& that) const; /** * Return true if the given TimeZoneTransition objects are semantically unequal. Objects @@ -95,7 +95,7 @@ class U_I18N_API TimeZoneTransition : public UObject { * @return true if the given TimeZoneTransition objects are semantically unequal. * @stable ICU 3.8 */ - UBool operator!=(const TimeZoneTransition& that) const; + bool operator!=(const TimeZoneTransition& that) const; /** * Returns the time of transition in milliseconds. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/vtzone.h b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/vtzone.h index 2743b6c47..7ed070624 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/unicode/vtzone.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/unicode/vtzone.h @@ -72,7 +72,7 @@ class U_I18N_API VTimeZone : public BasicTimeZone { *semantically equal. * @stable ICU 3.8 */ - virtual UBool operator==(const TimeZone& that) const; + virtual bool operator==(const TimeZone& that) const; /** * Return true if the given TimeZone objects are @@ -82,7 +82,7 @@ class U_I18N_API VTimeZone : public BasicTimeZone { * semantically unequal. * @stable ICU 3.8 */ - virtual UBool operator!=(const TimeZone& that) const; + virtual bool operator!=(const TimeZone& that) const; /** * Create a VTimeZone instance by the time zone ID. diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.cpp index 7598b0ee5..daa575c5f 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.cpp @@ -37,7 +37,7 @@ UTF16CollationIterator::UTF16CollationIterator(const UTF16CollationIterator &oth UTF16CollationIterator::~UTF16CollationIterator() {} -UBool +bool UTF16CollationIterator::operator==(const CollationIterator &other) const { if(!CollationIterator::operator==(other)) { return FALSE; } const UTF16CollationIterator &o = static_cast(other); @@ -171,7 +171,7 @@ FCDUTF16CollationIterator::FCDUTF16CollationIterator(const FCDUTF16CollationIter FCDUTF16CollationIterator::~FCDUTF16CollationIterator() {} -UBool +bool FCDUTF16CollationIterator::operator==(const CollationIterator &other) const { // Skip the UTF16CollationIterator and call its parent. if(!CollationIterator::operator==(other)) { return FALSE; } diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.h b/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.h index fd3a05e9e..31361099b 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.h +++ b/src/duckdb/extension/icu/third_party/icu/i18n/utf16collationiterator.h @@ -42,7 +42,7 @@ class U_I18N_API UTF16CollationIterator : public CollationIterator { virtual ~UTF16CollationIterator(); - virtual UBool operator==(const CollationIterator &other) const; + virtual bool operator==(const CollationIterator &other) const; virtual void resetToOffset(int32_t newOffset); @@ -95,7 +95,7 @@ class U_I18N_API FCDUTF16CollationIterator : public UTF16CollationIterator { virtual ~FCDUTF16CollationIterator(); - virtual UBool operator==(const CollationIterator &other) const; + virtual bool operator==(const CollationIterator &other) const; virtual void resetToOffset(int32_t newOffset); diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/vtzone.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/vtzone.cpp index ccfa6b715..b9b0464a1 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/vtzone.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/vtzone.cpp @@ -1038,7 +1038,7 @@ VTimeZone::operator=(const VTimeZone& right) { return *this; } -UBool +bool VTimeZone::operator==(const TimeZone& that) const { if (this == &that) { return TRUE; @@ -1057,7 +1057,7 @@ VTimeZone::operator==(const TimeZone& that) const { return FALSE; } -UBool +bool VTimeZone::operator!=(const TimeZone& that) const { return !operator==(that); } diff --git a/src/duckdb/extension/json/json_scan.cpp b/src/duckdb/extension/json/json_scan.cpp index d038885d9..6fd732a0b 100644 --- a/src/duckdb/extension/json/json_scan.cpp +++ b/src/duckdb/extension/json/json_scan.cpp @@ -206,11 +206,15 @@ unique_ptr JSONGlobalTableFunctionState::Init(ClientCo gstate.json_readers.emplace_back(reader.get()); } - vector dummy_types(input.column_ids.size(), LogicalType::ANY); + vector dummy_global_types(bind_data.names.size(), LogicalType::ANY); + vector dummy_local_types(gstate.names.size(), LogicalType::ANY); + auto local_columns = MultiFileReaderColumnDefinition::ColumnsFromNamesAndTypes(gstate.names, dummy_local_types); + auto global_columns = + MultiFileReaderColumnDefinition::ColumnsFromNamesAndTypes(bind_data.names, dummy_global_types); for (auto &reader : gstate.json_readers) { MultiFileReader().FinalizeBind(reader->GetOptions().file_options, gstate.bind_data.reader_bind, - reader->GetFileName(), gstate.names, dummy_types, bind_data.names, - input.column_indexes, reader->reader_data, context, nullptr); + reader->GetFileName(), local_columns, global_columns, input.column_indexes, + reader->reader_data, context, nullptr); } return std::move(result); diff --git a/src/duckdb/extension/parquet/column_writer.cpp b/src/duckdb/extension/parquet/column_writer.cpp index 677bacf42..5ba51a7c1 100644 --- a/src/duckdb/extension/parquet/column_writer.cpp +++ b/src/duckdb/extension/parquet/column_writer.cpp @@ -1311,21 +1311,26 @@ class StandardColumnWriter : public BasicColumnWriter { auto &state = state_p.Cast>(); if (state.dictionary.size() == 0 || state.dictionary.size() > writer.DictionarySizeLimit()) { - // If we aren't doing dictionary encoding, the following encodings are virtually always better than PLAIN - switch (type) { - case Type::type::INT32: - case Type::type::INT64: - state.encoding = Encoding::DELTA_BINARY_PACKED; - break; - case Type::type::BYTE_ARRAY: - state.encoding = Encoding::DELTA_LENGTH_BYTE_ARRAY; - break; - case Type::type::FLOAT: - case Type::type::DOUBLE: - state.encoding = Encoding::BYTE_STREAM_SPLIT; - break; - default: + if (writer.GetParquetVersion() == ParquetVersion::V1) { + // Can't do the cool stuff for V1 state.encoding = Encoding::PLAIN; + } else { + // If we aren't doing dictionary encoding, these encodings are virtually always better than PLAIN + switch (type) { + case Type::type::INT32: + case Type::type::INT64: + state.encoding = Encoding::DELTA_BINARY_PACKED; + break; + case Type::type::BYTE_ARRAY: + state.encoding = Encoding::DELTA_LENGTH_BYTE_ARRAY; + break; + case Type::type::FLOAT: + case Type::type::DOUBLE: + state.encoding = Encoding::BYTE_STREAM_SPLIT; + break; + default: + state.encoding = Encoding::PLAIN; + } } state.dictionary.clear(); } diff --git a/src/duckdb/extension/parquet/include/parquet_reader.hpp b/src/duckdb/extension/parquet/include/parquet_reader.hpp index 79de2b4cc..df537ea04 100644 --- a/src/duckdb/extension/parquet/include/parquet_reader.hpp +++ b/src/duckdb/extension/parquet/include/parquet_reader.hpp @@ -71,10 +71,12 @@ struct ParquetColumnDefinition { static ParquetColumnDefinition FromSchemaValue(ClientContext &context, const Value &column_value); public: + // DEPRECATED, use 'identifier' instead int32_t field_id; string name; LogicalType type; Value default_value; + Value identifier; public: void Serialize(Serializer &serializer) const; @@ -127,16 +129,13 @@ class ParquetReader { FileSystem &fs; Allocator &allocator; string file_name; - vector return_types; - vector names; + vector columns; shared_ptr metadata; ParquetOptions parquet_options; MultiFileReaderData reader_data; unique_ptr root_reader; shared_ptr encryption_util; - //! Index of the file_row_number column - idx_t file_row_number_idx = DConstants::INVALID_INDEX; //! Parquet schema for the generated columns vector generated_column_schema; //! Table column names - set when using COPY tbl FROM file.parquet @@ -150,17 +149,23 @@ class ParquetReader { auto result = make_uniq(); result->file_name = reader_p->file_name; if (file_idx == 0) { - result->names = reader_p->names; - result->types = reader_p->return_types; + for (auto &column : reader_p->columns) { + result->names.push_back(column.name); + result->types.push_back(column.type); + } result->options = reader_p->parquet_options; result->metadata = reader_p->metadata; result->reader = std::move(reader_p); } else { - result->names = std::move(reader_p->names); - result->types = std::move(reader_p->return_types); + for (auto &column : reader_p->columns) { + result->names.push_back(column.name); + result->types.push_back(column.type); + } + reader_p->columns.clear(); result->options = std::move(reader_p->parquet_options); result->metadata = std::move(reader_p->metadata); } + return result; } @@ -183,11 +188,9 @@ class ParquetReader { const string &GetFileName() { return file_name; } - const vector &GetNames() { - return names; - } - const vector &GetTypes() { - return return_types; + + const vector &GetColumns() { + return columns; } static unique_ptr ReadStatistics(ClientContext &context, ParquetOptions parquet_options, diff --git a/src/duckdb/extension/parquet/include/parquet_writer.hpp b/src/duckdb/extension/parquet/include/parquet_writer.hpp index e601926b2..f638b2f6b 100644 --- a/src/duckdb/extension/parquet/include/parquet_writer.hpp +++ b/src/duckdb/extension/parquet/include/parquet_writer.hpp @@ -68,13 +68,19 @@ struct ParquetBloomFilterEntry { idx_t column_idx; }; +enum class ParquetVersion : uint8_t { + V1 = 1, //! Excludes DELTA_BINARY_PACKED, DELTA_LENGTH_BYTE_ARRAY, BYTE_STREAM_SPLIT + V2 = 2, //! Includes the encodings above +}; + class ParquetWriter { public: ParquetWriter(ClientContext &context, FileSystem &fs, string file_name, vector types, vector names, duckdb_parquet::CompressionCodec::type codec, ChildFieldIDs field_ids, const vector> &kv_metadata, shared_ptr encryption_config, idx_t dictionary_size_limit, - double bloom_filter_false_positive_ratio, int64_t compression_level, bool debug_use_openssl); + double bloom_filter_false_positive_ratio, int64_t compression_level, bool debug_use_openssl, + ParquetVersion parquet_version); public: void PrepareRowGroup(ColumnDataCollection &buffer, PreparedRowGroup &result); @@ -117,6 +123,9 @@ class ParquetWriter { lock_guard glock(lock); return file_meta_data.row_groups.size(); } + ParquetVersion GetParquetVersion() const { + return parquet_version; + } uint32_t Write(const duckdb_apache::thrift::TBase &object); uint32_t WriteData(const const_data_ptr_t buffer, const uint32_t buffer_size); @@ -140,6 +149,7 @@ class ParquetWriter { int64_t compression_level; bool debug_use_openssl; shared_ptr encryption_util; + ParquetVersion parquet_version; unique_ptr writer; std::shared_ptr protocol; diff --git a/src/duckdb/extension/parquet/parquet_extension.cpp b/src/duckdb/extension/parquet/parquet_extension.cpp index 500b89919..8ec9924a6 100644 --- a/src/duckdb/extension/parquet/parquet_extension.cpp +++ b/src/duckdb/extension/parquet/parquet_extension.cpp @@ -5,6 +5,7 @@ #include "cast_column_reader.hpp" #include "duckdb.hpp" #include "duckdb/parser/expression/positional_reference_expression.hpp" +#include "duckdb/parser/expression/constant_expression.hpp" #include "duckdb/parser/query_node/select_node.hpp" #include "duckdb/parser/tableref/subqueryref.hpp" #include "duckdb/planner/operator/logical_projection.hpp" @@ -60,6 +61,7 @@ struct ParquetReadBindData : public TableFunctionData { atomic chunk_count; vector names; vector types; + vector columns; //! Table column names - set when using COPY tbl FROM file.parquet vector table_columns; @@ -201,6 +203,9 @@ struct ParquetWriteBindData : public TableFunctionData { ChildFieldIDs field_ids; //! The compression level, higher value is more int64_t compression_level = ZStdFileSystem::DefaultCompressionLevel(); + + //! Which encodings to include when writing + ParquetVersion parquet_version = ParquetVersion::V1; }; struct ParquetWriteGlobalState : public GlobalFunctionData { @@ -263,15 +268,47 @@ static MultiFileReaderBindData BindSchema(ClientContext &context, vector schema_col_names; vector schema_col_types; + MultiFileReaderBindData bind_data; schema_col_names.reserve(options.schema.size()); schema_col_types.reserve(options.schema.size()); - for (const auto &column : options.schema) { + bool match_by_field_id; + if (!options.schema.empty()) { + auto &column = options.schema[0]; + if (column.identifier.type().id() == LogicalTypeId::INTEGER) { + match_by_field_id = true; + } else { + match_by_field_id = false; + } + } else { + match_by_field_id = false; + } + + for (idx_t i = 0; i < options.schema.size(); i++) { + const auto &column = options.schema[i]; schema_col_names.push_back(column.name); schema_col_types.push_back(column.type); + + auto res = MultiFileReaderColumnDefinition(column.name, column.type); + res.identifier = column.identifier; +#ifdef DEBUG + if (match_by_field_id) { + D_ASSERT(res.identifier.type().id() == LogicalTypeId::INTEGER); + } else { + D_ASSERT(res.identifier.type().id() == LogicalTypeId::VARCHAR); + } +#endif + + res.default_expression = make_uniq(column.default_value); + bind_data.schema.emplace_back(std::move(res)); + } + + if (match_by_field_id) { + bind_data.mapping = MultiFileReaderColumnMappingMode::BY_FIELD_ID; + } else { + bind_data.mapping = MultiFileReaderColumnMappingMode::BY_NAME; } // perform the binding on the obtained set of names + types - MultiFileReaderBindData bind_data; result.multi_file_reader->BindOptions(options.file_options, *result.file_list, schema_col_types, schema_col_names, bind_data); @@ -295,85 +332,13 @@ static void InitializeParquetReader(ParquetReader &reader, const ParquetReadBind // Mark the file in the file list we are scanning here reader_data.file_list_idx = file_idx; - if (bind_data.parquet_options.schema.empty()) { - bind_data.multi_file_reader->InitializeReader( - reader, parquet_options.file_options, bind_data.reader_bind, bind_data.types, bind_data.names, - global_column_ids, table_filters, bind_data.file_list->GetFirstFile(), context, reader_state); - return; - } - - // a fixed schema was supplied, initialize the MultiFileReader settings here so we can read using the schema - - // this deals with hive partitioning and filename=true - bind_data.multi_file_reader->FinalizeBind(parquet_options.file_options, bind_data.reader_bind, reader.GetFileName(), - reader.GetNames(), bind_data.types, bind_data.names, global_column_ids, - reader_data, context, reader_state); - - // create a mapping from field id to column index in file - unordered_map field_id_to_column_index; - auto &column_readers = reader.root_reader->Cast().child_readers; - for (idx_t column_index = 0; column_index < column_readers.size(); column_index++) { - auto &column_reader = *column_readers[column_index]; - auto &column_schema = column_reader.Schema(); - if (column_schema.__isset.field_id) { - field_id_to_column_index[column_schema.field_id] = column_index; - } else if (column_reader.GetParentSchema()) { - auto &parent_column_schema = *column_reader.GetParentSchema(); - if (parent_column_schema.__isset.field_id) { - field_id_to_column_index[parent_column_schema.field_id] = column_index; - } - } - } - - // loop through the schema definition - for (idx_t i = 0; i < global_column_ids.size(); i++) { - auto global_column_index = global_column_ids[i].GetPrimaryIndex(); - - // check if this is a constant column - bool constant = false; - for (auto &entry : reader_data.constant_map) { - if (entry.column_id == i) { - constant = true; - break; - } - } - if (constant) { - // this column is constant for this file - continue; - } - - // Handle any generate columns that are not in the schema (currently only file_row_number) - if (global_column_index >= parquet_options.schema.size()) { - if (bind_data.reader_bind.file_row_number_idx == global_column_index) { - reader_data.column_mapping.push_back(i); - reader_data.column_ids.push_back(reader.file_row_number_idx); - } - continue; - } - - const auto &column_definition = parquet_options.schema[global_column_index]; - auto it = field_id_to_column_index.find(column_definition.field_id); - if (it == field_id_to_column_index.end()) { - // field id not present in file, use default value - reader_data.constant_map.emplace_back(i, column_definition.default_value); - continue; - } - - const auto &local_column_index = it->second; - auto &column_reader = column_readers[local_column_index]; - if (column_reader->Type() != column_definition.type) { - // differing types, wrap in a cast column reader - reader_data.cast_map[local_column_index] = column_definition.type; - } - - reader_data.column_mapping.push_back(i); - reader_data.column_ids.push_back(local_column_index); - } - reader_data.empty_columns = reader_data.column_ids.empty(); - - // Finally, initialize the filters - bind_data.multi_file_reader->CreateFilterMap(bind_data.types, table_filters, reader_data, reader_state); - reader_data.filters = table_filters; + // 'reader_bind.schema' could be set explicitly by: + // 1. The MultiFileReader::Bind call + // 2. The 'schema' parquet option + auto &global_columns = bind_data.reader_bind.schema.empty() ? bind_data.columns : bind_data.reader_bind.schema; + bind_data.multi_file_reader->InitializeReader(reader, parquet_options.file_options, bind_data.reader_bind, + global_columns, global_column_ids, table_filters, + bind_data.file_list->GetFirstFile(), context, reader_state); } static bool GetBooleanArgument(const pair> &option) { @@ -407,11 +372,9 @@ class ParquetScanFunction { table_function.named_parameters["debug_use_openssl"] = LogicalType::BOOLEAN; table_function.named_parameters["compression"] = LogicalType::VARCHAR; table_function.named_parameters["explicit_cardinality"] = LogicalType::UBIGINT; - table_function.named_parameters["schema"] = - LogicalType::MAP(LogicalType::INTEGER, LogicalType::STRUCT({{{"name", LogicalType::VARCHAR}, - {"type", LogicalType::VARCHAR}, - {"default_value", LogicalType::VARCHAR}}})); + table_function.named_parameters["schema"] = LogicalTypeId::ANY; table_function.named_parameters["encryption_config"] = LogicalTypeId::ANY; + table_function.named_parameters["parquet_version"] = LogicalType::VARCHAR; table_function.get_partition_data = ParquetScanGetPartitionData; table_function.serialize = ParquetScanSerialize; table_function.deserialize = ParquetScanDeserialize; @@ -515,16 +478,21 @@ class ParquetScanFunction { result->reader_bind = result->multi_file_reader->BindReader( context, result->types, result->names, *result->file_list, *result, parquet_options); } + + // Set the explicit cardinality if requested if (parquet_options.explicit_cardinality) { auto file_count = result->file_list->GetTotalFileCount(); result->explicit_cardinality = parquet_options.explicit_cardinality; result->initial_file_cardinality = result->explicit_cardinality / (file_count ? file_count : 1); } + if (return_types.empty()) { // no expected types - just copy the types return_types = result->types; names = result->names; } else { + // We're deserializing from a previously successful bind call + // verify that the amount of columns still matches if (return_types.size() != result->types.size()) { auto file_string = bound_on_first_file ? result->file_list->GetFirstFile() : StringUtil::Join(result->file_list->GetPaths(), ","); @@ -555,9 +523,56 @@ class ParquetScanFunction { result->table_columns = names; } result->parquet_options = parquet_options; + result->columns = MultiFileReaderColumnDefinition::ColumnsFromNamesAndTypes(result->names, result->types); return std::move(result); } + static void VerifyParquetSchemaParameter(const Value &schema) { + LogicalType::MAP(LogicalType::BLOB, LogicalType::STRUCT({{{"name", LogicalType::VARCHAR}, + {"type", LogicalType::VARCHAR}, + {"default_value", LogicalType::VARCHAR}}})); + auto &map_type = schema.type(); + if (map_type.id() != LogicalTypeId::MAP) { + throw InvalidInputException("'schema' expects a value of type MAP, not %s", + LogicalTypeIdToString(map_type.id())); + } + auto &key_type = MapType::KeyType(map_type); + auto &value_type = MapType::ValueType(map_type); + + if (value_type.id() != LogicalTypeId::STRUCT) { + throw InvalidInputException("'schema' expects a STRUCT as the value type of the map"); + } + auto &children = StructType::GetChildTypes(value_type); + if (children.size() < 3) { + throw InvalidInputException( + "'schema' expects the STRUCT to have 3 children, 'name', 'type' and 'default_value"); + } + if (!StringUtil::CIEquals(children[0].first, "name")) { + throw InvalidInputException("'schema' expects the first field of the struct to be called 'name'"); + } + if (children[0].second.id() != LogicalTypeId::VARCHAR) { + throw InvalidInputException("'schema' expects the 'name' field to be of type VARCHAR, not %s", + LogicalTypeIdToString(children[0].second.id())); + } + if (!StringUtil::CIEquals(children[1].first, "type")) { + throw InvalidInputException("'schema' expects the second field of the struct to be called 'type'"); + } + if (children[1].second.id() != LogicalTypeId::VARCHAR) { + throw InvalidInputException("'schema' expects the 'type' field to be of type VARCHAR, not %s", + LogicalTypeIdToString(children[1].second.id())); + } + if (!StringUtil::CIEquals(children[2].first, "default_value")) { + throw InvalidInputException("'schema' expects the third field of the struct to be called 'default_value'"); + } + //! NOTE: default_value can be any type + + if (key_type.id() != LogicalTypeId::INTEGER && key_type.id() != LogicalTypeId::VARCHAR) { + throw InvalidInputException( + "'schema' expects the value type of the map to be either INTEGER or VARCHAR, not %s", + LogicalTypeIdToString(key_type.id())); + } + } + static unique_ptr ParquetScanBind(ClientContext &context, TableFunctionBindInput &input, vector &return_types, vector &names) { auto multi_file_reader = MultiFileReader::Create(input.table_function); @@ -580,6 +595,7 @@ class ParquetScanFunction { } else if (loption == "schema") { // Argument is a map that defines the schema const auto &schema_value = kv.second; + VerifyParquetSchemaParameter(schema_value); const auto column_values = ListValue::GetChildren(schema_value); if (column_values.empty()) { throw BinderException("Parquet schema cannot be empty"); @@ -666,9 +682,11 @@ class ParquetScanFunction { auto &file_list = result->file_list; file_list.InitializeScan(result->file_list_scan); + auto &global_columns = bind_data.reader_bind.schema.empty() ? bind_data.columns : bind_data.reader_bind.schema; result->multi_file_reader_state = bind_data.multi_file_reader->InitializeGlobalState( - context, bind_data.parquet_options.file_options, bind_data.reader_bind, file_list, bind_data.types, - bind_data.names, input.column_indexes); + context, bind_data.parquet_options.file_options, bind_data.reader_bind, file_list, global_columns, + input.column_indexes); + if (file_list.IsEmpty()) { result->readers = {}; } else if (!bind_data.union_readers.empty()) { @@ -1275,6 +1293,15 @@ unique_ptr ParquetWriteBind(ClientContext &context, CopyFunctionBi } bind_data->compression_level = val; compression_level_set = true; + } else if (loption == "parquet_version") { + const auto roption = StringUtil::Upper(option.second[0].ToString()); + if (roption == "V1") { + bind_data->parquet_version = ParquetVersion::V1; + } else if (roption == "V2") { + bind_data->parquet_version = ParquetVersion::V2; + } else { + throw BinderException("Expected parquet_version 'V1' or 'V2'"); + } } else { throw NotImplementedException("Unrecognized option for PARQUET: %s", option.first.c_str()); } @@ -1305,7 +1332,7 @@ unique_ptr ParquetWriteInitializeGlobal(ClientContext &conte context, fs, file_path, parquet_bind.sql_types, parquet_bind.column_names, parquet_bind.codec, parquet_bind.field_ids.Copy(), parquet_bind.kv_metadata, parquet_bind.encryption_config, parquet_bind.dictionary_size_limit, parquet_bind.bloom_filter_false_positive_ratio, - parquet_bind.compression_level, parquet_bind.debug_use_openssl); + parquet_bind.compression_level, parquet_bind.debug_use_openssl, parquet_bind.parquet_version); return std::move(global_state); } @@ -1410,6 +1437,29 @@ duckdb_parquet::CompressionCodec::type EnumUtil::FromString +const char *EnumUtil::ToChars(ParquetVersion value) { + switch (value) { + case ParquetVersion::V1: + return "V1"; + case ParquetVersion::V2: + return "V2"; + default: + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + } +} + +template <> +ParquetVersion EnumUtil::FromString(const char *value) { + if (StringUtil::Equals(value, "V1")) { + return ParquetVersion::V1; + } + if (StringUtil::Equals(value, "V2")) { + return ParquetVersion::V2; + } + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); +} + static optional_idx SerializeCompressionLevel(const int64_t compression_level) { return compression_level < 0 ? NumericLimits::Maximum() - NumericCast(AbsValue(compression_level)) : NumericCast(compression_level); @@ -1441,13 +1491,24 @@ static void ParquetCopySerialize(Serializer &serializer, const FunctionData &bin bind_data.encryption_config, nullptr); // 108 was dictionary_compression_ratio_threshold, but was deleted + + // To avoid doubly defining the default values in both ParquetWriteBindData and here, + // and possibly making a mistake, we just get the values from ParquetWriteBindData. + // We have to std::move them, otherwise MSVC will complain that it's not a "const T &&" const auto compression_level = SerializeCompressionLevel(bind_data.compression_level); D_ASSERT(DeserializeCompressionLevel(compression_level) == bind_data.compression_level); - serializer.WritePropertyWithDefault(109, "compression_level", compression_level); - serializer.WriteProperty(110, "row_groups_per_file", bind_data.row_groups_per_file); - serializer.WriteProperty(111, "debug_use_openssl", bind_data.debug_use_openssl); - serializer.WriteProperty(112, "dictionary_size_limit", bind_data.dictionary_size_limit); - serializer.WriteProperty(113, "bloom_filter_false_positive_ratio", bind_data.bloom_filter_false_positive_ratio); + serializer.WritePropertyWithDefault(109, "compression_level", compression_level); + serializer.WritePropertyWithDefault(110, "row_groups_per_file", bind_data.row_groups_per_file, + std::move(ParquetWriteBindData().row_groups_per_file)); + serializer.WritePropertyWithDefault(111, "debug_use_openssl", bind_data.debug_use_openssl, + std::move(ParquetWriteBindData().debug_use_openssl)); + serializer.WritePropertyWithDefault(112, "dictionary_size_limit", bind_data.dictionary_size_limit, + std::move(ParquetWriteBindData().dictionary_size_limit)); + serializer.WritePropertyWithDefault(113, "bloom_filter_false_positive_ratio", + bind_data.bloom_filter_false_positive_ratio, + std::move(ParquetWriteBindData().bloom_filter_false_positive_ratio)); + serializer.WritePropertyWithDefault(114, "parquet_version", bind_data.parquet_version, + std::move(ParquetWriteBindData().parquet_version)); } static unique_ptr ParquetCopyDeserialize(Deserializer &deserializer, CopyFunction &function) { @@ -1459,21 +1520,24 @@ static unique_ptr ParquetCopyDeserialize(Deserializer &deserialize data->row_group_size_bytes = deserializer.ReadProperty(104, "row_group_size_bytes"); data->kv_metadata = deserializer.ReadProperty>>(105, "kv_metadata"); data->field_ids = deserializer.ReadProperty(106, "field_ids"); - deserializer.ReadPropertyWithExplicitDefault>(107, "encryption_config", - data->encryption_config, nullptr); + deserializer.ReadPropertyWithExplicitDefault>( + 107, "encryption_config", data->encryption_config, std::move(ParquetWriteBindData().encryption_config)); deserializer.ReadDeletedProperty(108, "dictionary_compression_ratio_threshold"); optional_idx compression_level; deserializer.ReadPropertyWithDefault(109, "compression_level", compression_level); data->compression_level = DeserializeCompressionLevel(compression_level); D_ASSERT(SerializeCompressionLevel(data->compression_level) == compression_level); - data->row_groups_per_file = - deserializer.ReadPropertyWithExplicitDefault(110, "row_groups_per_file", optional_idx::Invalid()); - data->debug_use_openssl = deserializer.ReadPropertyWithExplicitDefault(111, "debug_use_openssl", true); - data->dictionary_size_limit = - deserializer.ReadPropertyWithExplicitDefault(112, "dictionary_size_limit", data->row_group_size / 10); - data->bloom_filter_false_positive_ratio = - deserializer.ReadPropertyWithExplicitDefault(113, "bloom_filter_false_positive_ratio", 0.01); + data->row_groups_per_file = deserializer.ReadPropertyWithExplicitDefault( + 110, "row_groups_per_file", std::move(ParquetWriteBindData().row_groups_per_file)); + data->debug_use_openssl = deserializer.ReadPropertyWithExplicitDefault( + 111, "debug_use_openssl", std::move(ParquetWriteBindData().debug_use_openssl)); + data->dictionary_size_limit = deserializer.ReadPropertyWithExplicitDefault( + 112, "dictionary_size_limit", std::move(ParquetWriteBindData().dictionary_size_limit)); + data->bloom_filter_false_positive_ratio = deserializer.ReadPropertyWithExplicitDefault( + 113, "bloom_filter_false_positive_ratio", std::move(ParquetWriteBindData().bloom_filter_false_positive_ratio)); + data->parquet_version = deserializer.ReadPropertyWithExplicitDefault( + 114, "parquet_version", std::move(ParquetWriteBindData().parquet_version)); return std::move(data); } diff --git a/src/duckdb/extension/parquet/parquet_metadata.cpp b/src/duckdb/extension/parquet/parquet_metadata.cpp index 456c9b3e4..31c7d0870 100644 --- a/src/duckdb/extension/parquet/parquet_metadata.cpp +++ b/src/duckdb/extension/parquet/parquet_metadata.cpp @@ -615,8 +615,8 @@ void ParquetMetaDataOperatorData::ExecuteBloomProbe(ClientContext &context, cons auto meta_data = reader->GetFileMetadata(); optional_idx probe_column_idx; - for (idx_t column_idx = 0; column_idx < reader->names.size(); column_idx++) { - if (reader->names[column_idx] == column_name) { + for (idx_t column_idx = 0; column_idx < reader->columns.size(); column_idx++) { + if (reader->columns[column_idx].name == column_name) { probe_column_idx = column_idx; } } @@ -632,7 +632,7 @@ void ParquetMetaDataOperatorData::ExecuteBloomProbe(ClientContext &context, cons D_ASSERT(!probe.IsNull()); ConstantFilter filter(ExpressionType::COMPARE_EQUAL, - probe.CastAs(context, reader->GetTypes()[probe_column_idx.GetIndex()])); + probe.CastAs(context, reader->GetColumns()[probe_column_idx.GetIndex()].type)); for (idx_t row_group_idx = 0; row_group_idx < meta_data->row_groups.size(); row_group_idx++) { auto &row_group = meta_data->row_groups[row_group_idx]; diff --git a/src/duckdb/extension/parquet/parquet_reader.cpp b/src/duckdb/extension/parquet/parquet_reader.cpp index 1d2565a2d..561386773 100644 --- a/src/duckdb/extension/parquet/parquet_reader.cpp +++ b/src/duckdb/extension/parquet/parquet_reader.cpp @@ -473,8 +473,6 @@ unique_ptr ParquetReader::CreateReader(ClientContext &context) { root_struct_reader.child_readers[column_idx] = std::move(cast_reader); } if (parquet_options.file_row_number) { - file_row_number_idx = root_struct_reader.child_readers.size(); - generated_column_schema.push_back(SchemaElement()); root_struct_reader.child_readers.push_back(make_uniq( *this, LogicalType::BIGINT, generated_column_schema.back(), next_file_idx, 0, 0)); @@ -499,20 +497,39 @@ void ParquetReader::InitializeSchema(ClientContext &context) { root_reader = CreateReader(context); auto &root_type = root_reader->Type(); auto &child_types = StructType::GetChildTypes(root_type); + + auto &struct_reader = root_reader->Cast(); + auto &child_readers = struct_reader.child_readers; D_ASSERT(root_type.id() == LogicalTypeId::STRUCT); - for (auto &type_pair : child_types) { - names.push_back(type_pair.first); - return_types.push_back(type_pair.second); + + D_ASSERT(child_readers.size() >= child_types.size()); + for (idx_t i = 0; i < child_types.size(); i++) { + auto &type_pair = child_types[i]; + auto column = MultiFileReaderColumnDefinition(type_pair.first, type_pair.second); + auto &column_reader = *child_readers[i]; + auto &column_schema = column_reader.Schema(); + + if (column_schema.__isset.field_id) { + column.identifier = Value::INTEGER(column_schema.field_id); + } else if (column_reader.GetParentSchema()) { + auto &parent_column_schema = *column_reader.GetParentSchema(); + if (parent_column_schema.__isset.field_id) { + column.identifier = Value::INTEGER(parent_column_schema.field_id); + } + } + columns.emplace_back(std::move(column)); } // Add generated constant column for row number if (parquet_options.file_row_number) { - if (StringUtil::CIFind(names, "file_row_number") != DConstants::INVALID_INDEX) { - throw BinderException( - "Using file_row_number option on file with column named file_row_number is not supported"); + for (auto &column : columns) { + auto &name = column.name; + if (StringUtil::CIEquals(name, "file_row_number")) { + throw BinderException( + "Using file_row_number option on file with column named file_row_number is not supported"); + } } - return_types.emplace_back(LogicalType::BIGINT); - names.emplace_back("file_row_number"); + columns.emplace_back("file_row_number", LogicalType::BIGINT); } } @@ -525,7 +542,8 @@ ParquetOptions::ParquetOptions(ClientContext &context) { ParquetColumnDefinition ParquetColumnDefinition::FromSchemaValue(ClientContext &context, const Value &column_value) { ParquetColumnDefinition result; - result.field_id = IntegerValue::Get(StructValue::GetChildren(column_value)[0]); + auto &identifier = StructValue::GetChildren(column_value)[0]; + result.identifier = identifier; const auto &column_def = StructValue::GetChildren(column_value)[1]; D_ASSERT(column_def.type().id() == LogicalTypeId::STRUCT); @@ -607,12 +625,12 @@ const FileMetaData *ParquetReader::GetFileMetadata() { unique_ptr ParquetReader::ReadStatistics(const string &name) { idx_t file_col_idx; - for (file_col_idx = 0; file_col_idx < names.size(); file_col_idx++) { - if (names[file_col_idx] == name) { + for (file_col_idx = 0; file_col_idx < columns.size(); file_col_idx++) { + if (columns[file_col_idx].name == name) { break; } } - if (file_col_idx == names.size()) { + if (file_col_idx == columns.size()) { return nullptr; } diff --git a/src/duckdb/extension/parquet/parquet_writer.cpp b/src/duckdb/extension/parquet/parquet_writer.cpp index 883f03069..f7e3651ec 100644 --- a/src/duckdb/extension/parquet/parquet_writer.cpp +++ b/src/duckdb/extension/parquet/parquet_writer.cpp @@ -321,12 +321,12 @@ ParquetWriter::ParquetWriter(ClientContext &context, FileSystem &fs, string file const vector> &kv_metadata, shared_ptr encryption_config_p, idx_t dictionary_size_limit_p, double bloom_filter_false_positive_ratio_p, int64_t compression_level_p, - bool debug_use_openssl_p) + bool debug_use_openssl_p, ParquetVersion parquet_version) : file_name(std::move(file_name_p)), sql_types(std::move(types_p)), column_names(std::move(names_p)), codec(codec), field_ids(std::move(field_ids_p)), encryption_config(std::move(encryption_config_p)), dictionary_size_limit(dictionary_size_limit_p), bloom_filter_false_positive_ratio(bloom_filter_false_positive_ratio_p), compression_level(compression_level_p), - debug_use_openssl(debug_use_openssl_p) { + debug_use_openssl(debug_use_openssl_p), parquet_version(parquet_version) { // initialize the file writer writer = make_uniq(fs, file_name.c_str(), diff --git a/src/duckdb/extension/parquet/serialize_parquet.cpp b/src/duckdb/extension/parquet/serialize_parquet.cpp index bcb334a45..5fa792cd3 100644 --- a/src/duckdb/extension/parquet/serialize_parquet.cpp +++ b/src/duckdb/extension/parquet/serialize_parquet.cpp @@ -40,6 +40,7 @@ void ParquetColumnDefinition::Serialize(Serializer &serializer) const { serializer.WritePropertyWithDefault(101, "name", name); serializer.WriteProperty(103, "type", type); serializer.WriteProperty(104, "default_value", default_value); + serializer.WritePropertyWithDefault(105, "identifier", identifier, Value()); } ParquetColumnDefinition ParquetColumnDefinition::Deserialize(Deserializer &deserializer) { @@ -48,6 +49,7 @@ ParquetColumnDefinition ParquetColumnDefinition::Deserialize(Deserializer &deser deserializer.ReadPropertyWithDefault(101, "name", result.name); deserializer.ReadProperty(103, "type", result.type); deserializer.ReadProperty(104, "default_value", result.default_value); + deserializer.ReadPropertyWithExplicitDefault(105, "identifier", result.identifier, Value()); return result; } diff --git a/src/duckdb/src/common/arrow/arrow_type_extension.cpp b/src/duckdb/src/common/arrow/arrow_type_extension.cpp index 4483f8644..8a9779b08 100644 --- a/src/duckdb/src/common/arrow/arrow_type_extension.cpp +++ b/src/duckdb/src/common/arrow/arrow_type_extension.cpp @@ -177,7 +177,7 @@ void ArrowTypeExtension::PopulateArrowSchema(DuckDBArrowSchemaHolder &root_holde } void DBConfig::RegisterArrowExtension(const ArrowTypeExtension &extension) const { - lock_guard l(encoding_functions->lock); + lock_guard l(arrow_extensions->lock); auto extension_info = extension.GetInfo(); if (arrow_extensions->type_extensions.find(extension_info) != arrow_extensions->type_extensions.end()) { throw NotImplementedException("Arrow Extension with configuration %s is already registered", @@ -193,27 +193,37 @@ void DBConfig::RegisterArrowExtension(const ArrowTypeExtension &extension) const arrow_extensions->type_to_info[type_info].push_back(extension_info); } -ArrowTypeExtension DBConfig::GetArrowExtension(ArrowExtensionMetadata info) const { - if (arrow_extensions->type_extensions.find(info) == arrow_extensions->type_extensions.end()) { +ArrowTypeExtension GetArrowExtensionInternal( + unordered_map &type_extensions, + ArrowExtensionMetadata info) { + if (type_extensions.find(info) == type_extensions.end()) { info.SetArrowFormat(""); - if (arrow_extensions->type_extensions.find(info) == arrow_extensions->type_extensions.end()) { + if (type_extensions.find(info) == type_extensions.end()) { throw NotImplementedException("Arrow Extension with configuration:\n%s not yet registered", info.ToString()); } } - return arrow_extensions->type_extensions[info]; + return type_extensions[info]; +} +ArrowTypeExtension DBConfig::GetArrowExtension(ArrowExtensionMetadata info) const { + lock_guard l(arrow_extensions->lock); + return GetArrowExtensionInternal(arrow_extensions->type_extensions, std::move(info)); } ArrowTypeExtension DBConfig::GetArrowExtension(const LogicalType &type) const { + lock_guard l(arrow_extensions->lock); TypeInfo type_info(type); if (!arrow_extensions->type_to_info[type_info].empty()) { - return GetArrowExtension(arrow_extensions->type_to_info[type_info].front()); + return GetArrowExtensionInternal(arrow_extensions->type_extensions, + arrow_extensions->type_to_info[type_info].front()); } type_info.type = LogicalTypeId::ANY; - return GetArrowExtension(arrow_extensions->type_to_info[type_info].front()); + return GetArrowExtensionInternal(arrow_extensions->type_extensions, + arrow_extensions->type_to_info[type_info].front()); } bool DBConfig::HasArrowExtension(const LogicalType &type) const { + lock_guard l(arrow_extensions->lock); TypeInfo type_info(type); if (!arrow_extensions->type_to_info[type_info].empty()) { return true; diff --git a/src/duckdb/src/common/enum_util.cpp b/src/duckdb/src/common/enum_util.cpp index c3a99f657..56f61fc12 100644 --- a/src/duckdb/src/common/enum_util.cpp +++ b/src/duckdb/src/common/enum_util.cpp @@ -66,6 +66,7 @@ #include "duckdb/common/file_buffer.hpp" #include "duckdb/common/file_open_flags.hpp" #include "duckdb/common/multi_file_list.hpp" +#include "duckdb/common/multi_file_reader_options.hpp" #include "duckdb/common/operator/decimal_cast_operators.hpp" #include "duckdb/common/printer.hpp" #include "duckdb/common/sort/partition_state.hpp" @@ -2415,6 +2416,24 @@ MetricsType EnumUtil::FromString(const char *value) { return static_cast(StringUtil::StringToEnum(GetMetricsTypeValues(), 49, "MetricsType", value)); } +const StringUtil::EnumStringLiteral *GetMultiFileReaderColumnMappingModeValues() { + static constexpr StringUtil::EnumStringLiteral values[] { + { static_cast(MultiFileReaderColumnMappingMode::BY_NAME), "BY_NAME" }, + { static_cast(MultiFileReaderColumnMappingMode::BY_FIELD_ID), "BY_FIELD_ID" } + }; + return values; +} + +template<> +const char* EnumUtil::ToChars(MultiFileReaderColumnMappingMode value) { + return StringUtil::EnumToString(GetMultiFileReaderColumnMappingModeValues(), 2, "MultiFileReaderColumnMappingMode", static_cast(value)); +} + +template<> +MultiFileReaderColumnMappingMode EnumUtil::FromString(const char *value) { + return static_cast(StringUtil::StringToEnum(GetMultiFileReaderColumnMappingModeValues(), 2, "MultiFileReaderColumnMappingMode", value)); +} + const StringUtil::EnumStringLiteral *GetNTypeValues() { static constexpr StringUtil::EnumStringLiteral values[] { { static_cast(NType::PREFIX), "PREFIX" }, diff --git a/src/duckdb/src/common/exception.cpp b/src/duckdb/src/common/exception.cpp index 991f929f2..494a669cb 100644 --- a/src/duckdb/src/common/exception.cpp +++ b/src/duckdb/src/common/exception.cpp @@ -36,7 +36,12 @@ string Exception::ToJSON(ExceptionType type, const string &message, const unorde #endif { auto extended_extra_info = extra_info; - extended_extra_info["stack_trace_pointers"] = StackTrace::GetStacktracePointers(); + // We only want to add the stack trace pointers if they are not already present, otherwise the original + // stack traces are lost + if (extended_extra_info.find("stack_trace_pointers") == extended_extra_info.end() && + extended_extra_info.find("stack_trace") == extended_extra_info.end()) { + extended_extra_info["stack_trace_pointers"] = StackTrace::GetStacktracePointers(); + } return StringUtil::ExceptionToJSONMap(type, message, extended_extra_info); } return StringUtil::ExceptionToJSONMap(type, message, extra_info); diff --git a/src/duckdb/src/common/multi_file_reader.cpp b/src/duckdb/src/common/multi_file_reader.cpp index 97eba1014..813d13f70 100644 --- a/src/duckdb/src/common/multi_file_reader.cpp +++ b/src/duckdb/src/common/multi_file_reader.cpp @@ -8,6 +8,7 @@ #include "duckdb/function/table_function.hpp" #include "duckdb/main/config.hpp" #include "duckdb/planner/expression/bound_columnref_expression.hpp" +#include "duckdb/parser/expression/constant_expression.hpp" #include "duckdb/common/string_util.hpp" #include @@ -235,16 +236,17 @@ void MultiFileReader::BindOptions(MultiFileReaderOptions &options, MultiFileList } void MultiFileReader::FinalizeBind(const MultiFileReaderOptions &file_options, const MultiFileReaderBindData &options, - const string &filename, const vector &local_names, - const vector &global_types, const vector &global_names, + const string &filename, const vector &local_columns, + const vector &global_columns, const vector &global_column_ids, MultiFileReaderData &reader_data, ClientContext &context, optional_ptr global_state) { // create a map of name -> column index case_insensitive_map_t name_map; if (file_options.union_by_name) { - for (idx_t col_idx = 0; col_idx < local_names.size(); col_idx++) { - name_map[local_names[col_idx]] = col_idx; + for (idx_t col_idx = 0; col_idx < local_columns.size(); col_idx++) { + auto &column = local_columns[col_idx]; + name_map[column.name] = col_idx; } } for (idx_t i = 0; i < global_column_ids.size(); i++) { @@ -278,13 +280,16 @@ void MultiFileReader::FinalizeBind(const MultiFileReaderOptions &file_options, c } } if (file_options.union_by_name) { - auto &global_name = global_names[column_id]; - auto entry = name_map.find(global_name); + auto &column = global_columns[column_id]; + auto &name = column.name; + auto &type = column.type; + + auto entry = name_map.find(name); bool not_present_in_file = entry == name_map.end(); if (not_present_in_file) { // we need to project a column with name \"global_name\" - but it does not exist in the current file // push a NULL value of the specified type - reader_data.constant_map.emplace_back(i, Value(global_types[column_id])); + reader_data.constant_map.emplace_back(i, Value(type)); continue; } } @@ -294,24 +299,25 @@ void MultiFileReader::FinalizeBind(const MultiFileReaderOptions &file_options, c unique_ptr MultiFileReader::InitializeGlobalState(ClientContext &context, const MultiFileReaderOptions &file_options, const MultiFileReaderBindData &bind_data, const MultiFileList &file_list, - const vector &global_types, const vector &global_names, + const vector &global_columns, const vector &global_column_ids) { // By default, the multifilereader does not require any global state return nullptr; } -void MultiFileReader::CreateNameMapping(const string &file_name, const vector &local_types, - const vector &local_names, const vector &global_types, - const vector &global_names, - const vector &global_column_ids, MultiFileReaderData &reader_data, - const string &initial_file, - optional_ptr global_state) { - D_ASSERT(global_types.size() == global_names.size()); - D_ASSERT(local_types.size() == local_names.size()); +void MultiFileReader::CreateColumnMappingByName(const string &file_name, + const vector &local_columns, + const vector &global_columns, + const vector &global_column_ids, + MultiFileReaderData &reader_data, + const MultiFileReaderBindData &bind_data, const string &initial_file, + optional_ptr global_state) { + // we have expected types: create a map of name -> column index case_insensitive_map_t name_map; - for (idx_t col_idx = 0; col_idx < local_names.size(); col_idx++) { - name_map[local_names[col_idx]] = col_idx; + for (idx_t col_idx = 0; col_idx < local_columns.size(); col_idx++) { + auto &column = local_columns[col_idx]; + name_map[column.name] = col_idx; } for (idx_t i = 0; i < global_column_ids.size(); i++) { // check if this is a constant column @@ -329,33 +335,40 @@ void MultiFileReader::CreateNameMapping(const string &file_name, const vector= global_types.size()) { + if (global_id >= global_columns.size()) { throw InternalException( - "MultiFileReader::CreatePositionalMapping - global_id is out of range in global_types for this file"); + "MultiFileReader::CreateColumnMappingByName - global_id is out of range in global_types for this file"); } - auto &global_name = global_names[global_id]; - auto entry = name_map.find(global_name); + auto &global_column = global_columns[global_id]; + auto identifier = global_column.GetIdentifierName(); + auto entry = name_map.find(identifier); if (entry == name_map.end()) { - string candidate_names; - for (auto &local_name : local_names) { - if (!candidate_names.empty()) { - candidate_names += ", "; + // identiier not present in file, use default value + if (global_column.default_expression) { + reader_data.constant_map.emplace_back(i, global_column.GetDefaultValue()); + continue; + } else { + string candidate_names; + for (auto &column : local_columns) { + if (!candidate_names.empty()) { + candidate_names += ", "; + } + candidate_names += column.name; } - candidate_names += local_name; + throw IOException(StringUtil::Format( + "Failed to read file \"%s\": schema mismatch in glob: column \"%s\" was read from " + "the original file \"%s\", but could not be found in file \"%s\".\nCandidate names: " + "%s\nIf you are trying to " + "read files with different schemas, try setting union_by_name=True", + file_name, identifier, initial_file, file_name, candidate_names)); } - throw IOException( - StringUtil::Format("Failed to read file \"%s\": schema mismatch in glob: column \"%s\" was read from " - "the original file \"%s\", but could not be found in file \"%s\".\nCandidate names: " - "%s\nIf you are trying to " - "read files with different schemas, try setting union_by_name=True", - file_name, global_name, initial_file, file_name, candidate_names)); } // we found the column in the local file - check if the types are the same auto local_id = entry->second; - D_ASSERT(global_id < global_types.size()); - D_ASSERT(local_id < local_types.size()); - auto &global_type = global_types[global_id]; - auto &local_type = local_types[local_id]; + D_ASSERT(global_id < global_columns.size()); + D_ASSERT(local_id < local_columns.size()); + auto &global_type = global_columns[global_id].type; + auto &local_type = local_columns[local_id].type; ColumnIndex local_index(local_id); if (global_type != local_type) { // the types are not the same - add a cast @@ -372,22 +385,137 @@ void MultiFileReader::CreateNameMapping(const string &file_name, const vector &local_types, - const vector &local_names, const vector &global_types, - const vector &global_names, const vector &global_column_ids, - optional_ptr filters, MultiFileReaderData &reader_data, - const string &initial_file, const MultiFileReaderBindData &options, +void MultiFileReader::CreateColumnMappingByFieldId(const string &file_name, + const vector &local_columns, + const vector &global_columns, + const vector &global_column_ids, + MultiFileReaderData &reader_data, + const MultiFileReaderBindData &bind_data, const string &initial_file, + optional_ptr global_state) { +#ifdef DEBUG + //! Make sure the global columns have field_ids to match on + for (auto &column : global_columns) { + D_ASSERT(!column.identifier.IsNull()); + D_ASSERT(column.identifier.type().id() == LogicalTypeId::INTEGER); + } +#endif + + // we have expected types: create a map of field_id -> column index + unordered_map field_id_map; + for (idx_t col_idx = 0; col_idx < local_columns.size(); col_idx++) { + auto &column = local_columns[col_idx]; + if (column.identifier.IsNull()) { + // Extra columns at the end will not have a field_id + break; + } + auto field_id = column.GetIdentifierFieldId(); + field_id_map[field_id] = col_idx; + } + + // loop through the schema definition + for (idx_t i = 0; i < global_column_ids.size(); i++) { + + // check if this is a constant column + bool constant = false; + for (auto &entry : reader_data.constant_map) { + if (entry.column_id == i) { + constant = true; + break; + } + } + if (constant) { + // this column is constant for this file + continue; + } + + // Handle any generate columns that are not in the schema (currently only file_row_number) + auto &global_idx = global_column_ids[i]; + auto global_id = global_column_ids[i].GetPrimaryIndex(); + if (global_id >= global_columns.size()) { + if (bind_data.file_row_number_idx == global_id) { + reader_data.column_mapping.push_back(i); + // FIXME: this needs a more extensible solution + reader_data.column_ids.push_back(field_id_map.size()); + } else { + throw InternalException("Unexpected generated column"); + } + continue; + } + + const auto &global_column = global_columns[global_id]; + D_ASSERT(!global_column.identifier.IsNull()); + auto it = field_id_map.find(global_column.GetIdentifierFieldId()); + if (it == field_id_map.end()) { + // field id not present in file, use default value + auto &default_val = global_column.default_expression; + D_ASSERT(default_val); + if (default_val->type != ExpressionType::VALUE_CONSTANT) { + throw NotImplementedException("Default expression that isn't constant is not supported yet"); + } + auto &constant_expr = default_val->Cast(); + reader_data.constant_map.emplace_back(i, constant_expr.value); + continue; + } + + const auto &local_id = it->second; + auto &local_column = local_columns[local_id]; + ColumnIndex local_index(local_id); + if (local_column.type != global_column.type) { + // differing types, wrap in a cast column reader + reader_data.cast_map[local_id] = global_column.type; + } else { + local_index = ColumnIndex(local_id, global_idx.GetChildIndexes()); + } + + reader_data.column_mapping.push_back(i); + reader_data.column_ids.push_back(local_id); + reader_data.column_indexes.push_back(std::move(local_index)); + } + reader_data.empty_columns = reader_data.column_ids.empty(); +} + +void MultiFileReader::CreateColumnMapping(const string &file_name, + const vector &local_columns, + const vector &global_columns, + const vector &global_column_ids, + MultiFileReaderData &reader_data, const MultiFileReaderBindData &bind_data, + const string &initial_file, + optional_ptr global_state) { + switch (bind_data.mapping) { + case MultiFileReaderColumnMappingMode::BY_NAME: { + CreateColumnMappingByName(file_name, local_columns, global_columns, global_column_ids, reader_data, bind_data, + initial_file, global_state); + break; + } + case MultiFileReaderColumnMappingMode::BY_FIELD_ID: { + CreateColumnMappingByFieldId(file_name, local_columns, global_columns, global_column_ids, reader_data, + bind_data, initial_file, global_state); + break; + } + default: { + throw InternalException("Unsupported MultiFileReaderColumnMappingMode type"); + } + } +} + +void MultiFileReader::CreateMapping(const string &file_name, + const vector &local_columns, + const vector &global_columns, + const vector &global_column_ids, optional_ptr filters, + MultiFileReaderData &reader_data, const string &initial_file, + const MultiFileReaderBindData &bind_data, optional_ptr global_state) { - CreateNameMapping(file_name, local_types, local_names, global_types, global_names, global_column_ids, reader_data, - initial_file, global_state); - CreateFilterMap(global_types, filters, reader_data, global_state); + // copy global columns and inject any different defaults + CreateColumnMapping(file_name, local_columns, global_columns, global_column_ids, reader_data, bind_data, + initial_file, global_state); + CreateFilterMap(global_columns, filters, reader_data, global_state); } -void MultiFileReader::CreateFilterMap(const vector &global_types, optional_ptr filters, - MultiFileReaderData &reader_data, +void MultiFileReader::CreateFilterMap(const vector &global_columns, + optional_ptr filters, MultiFileReaderData &reader_data, optional_ptr global_state) { if (filters) { - auto filter_map_size = global_types.size(); + auto filter_map_size = global_columns.size(); if (global_state) { filter_map_size += global_state->extra_columns.size(); } diff --git a/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp b/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp index c1ab79dfe..29838280e 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp @@ -77,7 +77,7 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m logical_types.emplace_back(LogicalType::VARCHAR); } } - names = csv_file_scan->names; + names = csv_file_scan->GetNames(); if (!csv_file_scan->projected_columns.empty()) { projecting_columns = false; projected_columns = make_unsafe_uniq_array(number_of_columns); @@ -1001,6 +1001,7 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { // We keep track of the borked lines, in case we are ignoring errors D_ASSERT(csv_file_scan); + auto &names = csv_file_scan->GetNames(); auto &reader_data = csv_file_scan->reader_data; // Now Do the cast-aroo for (idx_t c = 0; c < reader_data.column_ids.size(); c++) { @@ -1059,8 +1060,7 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { string error_msg = error.str(); SanitizeError(error_msg); auto csv_error = CSVError::CastError( - state_machine->options, csv_file_scan->names[col_idx], error_msg, col_idx, borked_line, - lines_per_batch, + state_machine->options, names[col_idx], error_msg, col_idx, borked_line, lines_per_batch, result.line_positions_per_row[line_error].begin.GetGlobalPosition(result.result_size, first_nl), optional_idx::Invalid(), result_vector.GetType().id(), result.path); error_handler->Error(csv_error); @@ -1089,12 +1089,11 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { << LogicalTypeIdToString(type.id()) << "\'"; string error_msg = error.str(); SanitizeError(error_msg); - auto csv_error = - CSVError::CastError(state_machine->options, csv_file_scan->names[col_idx], error_msg, - col_idx, borked_line, lines_per_batch, - result.line_positions_per_row[line_error].begin.GetGlobalPosition( - result.result_size, first_nl), - optional_idx::Invalid(), result_vector.GetType().id(), result.path); + auto csv_error = CSVError::CastError( + state_machine->options, names[col_idx], error_msg, col_idx, borked_line, lines_per_batch, + result.line_positions_per_row[line_error].begin.GetGlobalPosition(result.result_size, + first_nl), + optional_idx::Invalid(), result_vector.GetType().id(), result.path); error_handler->Error(csv_error); } } diff --git a/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp b/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp index 093e698d0..ed251cbd0 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp @@ -16,31 +16,32 @@ CSVFileScan::CSVFileScan(ClientContext &context, shared_ptr bu error_handler(make_shared_ptr(options_p.ignore_errors.GetValue())), on_disk_file(buffer_manager->file_handle->OnDiskFile()), options(options_p) { + auto global_columns = + MultiFileReaderColumnDefinition::ColumnsFromNamesAndTypes(bind_data.return_names, bind_data.return_types); + auto multi_file_reader = MultiFileReader::CreateDefault("CSV Scan"); if (bind_data.initial_reader.get()) { auto &union_reader = *bind_data.initial_reader; - names = union_reader.GetNames(); + SetNamesAndTypes(union_reader.GetNames(), union_reader.GetTypes()); options = union_reader.options; - types = union_reader.GetTypes(); - multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, global_columns, + column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); return; } if (!bind_data.column_info.empty()) { // Serialized Union By name - names = bind_data.column_info[0].names; - types = bind_data.column_info[0].types; - multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); + SetNamesAndTypes(bind_data.column_info[0].names, bind_data.column_info[0].types); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, global_columns, + column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); return; } - names = bind_data.csv_names; - types = bind_data.csv_types; + SetNamesAndTypes(bind_data.csv_names, bind_data.csv_types); + file_schema.Initialize(names, types, file_path); - multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, global_columns, column_ids, + nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); SetStart(); @@ -59,12 +60,22 @@ void CSVFileScan::SetStart() { start_iterator = skip_scanner.GetIterator(); } +void CSVFileScan::SetNamesAndTypes(const vector &names_p, const vector &types_p) { + names = names_p; + types = types_p; + columns = MultiFileReaderColumnDefinition::ColumnsFromNamesAndTypes(names, types); +} + CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, const CSVReaderOptions &options_p, idx_t file_idx_p, const ReadCSVData &bind_data, const vector &column_ids, CSVSchema &file_schema, bool per_file_single_threaded) : file_path(file_path_p), file_idx(file_idx_p), error_handler(make_shared_ptr(options_p.ignore_errors.GetValue())), options(options_p) { auto multi_file_reader = MultiFileReader::CreateDefault("CSV Scan"); + + auto global_columns = + MultiFileReaderColumnDefinition::ColumnsFromNamesAndTypes(bind_data.return_names, bind_data.return_types); + if (file_idx == 0 && bind_data.initial_reader) { auto &union_reader = *bind_data.initial_reader; // Initialize Buffer Manager @@ -72,12 +83,11 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons // Initialize On Disk and Size of file on_disk_file = union_reader.on_disk_file; file_size = union_reader.file_size; - names = union_reader.GetNames(); options = union_reader.options; - types = union_reader.GetTypes(); + SetNamesAndTypes(union_reader.GetNames(), union_reader.GetTypes()); state_machine = union_reader.state_machine; - multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, global_columns, + column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); SetStart(); @@ -94,8 +104,7 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons if (file_idx < bind_data.column_info.size()) { // (Serialized) Union By name - names = bind_data.column_info[file_idx].names; - types = bind_data.column_info[file_idx].types; + SetNamesAndTypes(bind_data.column_info[file_idx].names, bind_data.column_info[file_idx].types); if (file_idx < bind_data.union_readers.size()) { // union readers - use cached options D_ASSERT(names == bind_data.union_readers[file_idx]->names); @@ -112,15 +121,14 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons state_machine = make_shared_ptr( state_machine_cache.Get(options.dialect_options.state_machine_options), options); - multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, global_columns, + column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); SetStart(); return; } // Sniff it! - names = bind_data.csv_names; - types = bind_data.csv_types; + SetNamesAndTypes(bind_data.csv_names, bind_data.csv_types); if (options.auto_detect && bind_data.files.size() > 1) { if (file_schema.Empty()) { CSVSniffer sniffer(options, buffer_manager, state_machine_cache); @@ -130,8 +138,7 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons options.file_path = file_path; CSVSniffer sniffer(options, buffer_manager, state_machine_cache, false); auto result = sniffer.AdaptiveSniff(file_schema); - names = result.names; - types = result.return_types; + SetNamesAndTypes(result.names, result.return_types); } } if (options.dialect_options.num_cols == 0) { @@ -143,8 +150,8 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons } state_machine = make_shared_ptr( state_machine_cache.Get(options.dialect_options.state_machine_options), options); - multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, global_columns, column_ids, + nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); SetStart(); } @@ -164,8 +171,7 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_name, const CSVSniffer sniffer(options, buffer_manager, state_machine_cache); auto sniffer_result = sniffer.SniffCSV(); if (names.empty()) { - names = sniffer_result.names; - types = sniffer_result.return_types; + SetNamesAndTypes(sniffer_result.names, sniffer_result.return_types); } } if (options.dialect_options.num_cols == 0) { @@ -226,6 +232,10 @@ const vector &CSVFileScan::GetNames() { const vector &CSVFileScan::GetTypes() { return types; } +const vector &CSVFileScan::GetColumns() { + D_ASSERT(types.size() == columns.size()); + return columns; +} void CSVFileScan::InitializeProjection() { for (idx_t i = 0; i < options.dialect_options.num_cols; i++) { diff --git a/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp b/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp index b1a4a6165..283a96719 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp @@ -239,12 +239,16 @@ void FillScanErrorTable(InternalAppender &scan_appender, idx_t scan_idx, idx_t f scan_appender.Append(Value::UINTEGER(NumericCast(options.dialect_options.skip_rows.GetValue()))); // 9. Has Header scan_appender.Append(Value::BOOLEAN(options.dialect_options.header.GetValue())); + + auto &types = file.GetTypes(); + auto &names = file.GetNames(); + // 10. List> {'col1': 'INTEGER', 'col2': 'VARCHAR'} std::ostringstream columns; columns << "{"; - for (idx_t i = 0; i < file.types.size(); i++) { - columns << "'" << file.names[i] << "': '" << file.types[i].ToString() << "'"; - if (i != file.types.size() - 1) { + for (idx_t i = 0; i < types.size(); i++) { + columns << "'" << names[i] << "': '" << types[i].ToString() << "'"; + if (i != types.size() - 1) { columns << ","; } } diff --git a/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp b/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp index f77a93ac0..d4443c173 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp @@ -270,8 +270,8 @@ void CSVError::RemoveNewLine(string &error) { error = StringUtil::Split(error, "\n")[0]; } -CSVError CSVError::CastError(const CSVReaderOptions &options, string &column_name, string &cast_error, idx_t column_idx, - string &csv_row, LinesPerBoundary error_info, idx_t row_byte_position, +CSVError CSVError::CastError(const CSVReaderOptions &options, const string &column_name, string &cast_error, + idx_t column_idx, string &csv_row, LinesPerBoundary error_info, idx_t row_byte_position, optional_idx byte_position, LogicalTypeId type, const string ¤t_path) { std::ostringstream error; // Which column diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index de1ba7272..0f4bbf287 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -1,5 +1,5 @@ #ifndef DUCKDB_PATCH_VERSION -#define DUCKDB_PATCH_VERSION "4-dev4570" +#define DUCKDB_PATCH_VERSION "4-dev4648" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 1 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 1 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v1.1.4-dev4570" +#define DUCKDB_VERSION "v1.1.4-dev4648" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "d1740d6cf7" +#define DUCKDB_SOURCE_ID "09cef57892" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/include/duckdb/common/enum_util.hpp b/src/duckdb/src/include/duckdb/common/enum_util.hpp index d3ab3ac44..accdea5d4 100644 --- a/src/duckdb/src/include/duckdb/common/enum_util.hpp +++ b/src/duckdb/src/include/duckdb/common/enum_util.hpp @@ -226,6 +226,8 @@ enum class MetaPipelineType : uint8_t; enum class MetricsType : uint8_t; +enum class MultiFileReaderColumnMappingMode : uint8_t; + enum class NType : uint8_t; enum class NewLineIdentifier : uint8_t; @@ -680,6 +682,9 @@ const char* EnumUtil::ToChars(MetaPipelineType value); template<> const char* EnumUtil::ToChars(MetricsType value); +template<> +const char* EnumUtil::ToChars(MultiFileReaderColumnMappingMode value); + template<> const char* EnumUtil::ToChars(NType value); @@ -1215,6 +1220,9 @@ MetaPipelineType EnumUtil::FromString(const char *value); template<> MetricsType EnumUtil::FromString(const char *value); +template<> +MultiFileReaderColumnMappingMode EnumUtil::FromString(const char *value); + template<> NType EnumUtil::FromString(const char *value); diff --git a/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp b/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp index 364f8641c..5778d77ba 100644 --- a/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +++ b/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp @@ -15,6 +15,7 @@ #include "duckdb/common/optional_ptr.hpp" #include "duckdb/common/types/value.hpp" #include "duckdb/common/union_by_name.hpp" +#include "duckdb/parser/expression/constant_expression.hpp" namespace duckdb { class TableFunction; @@ -35,6 +36,87 @@ struct HivePartitioningIndex { DUCKDB_API static HivePartitioningIndex Deserialize(Deserializer &deserializer); }; +struct MultiFileReaderColumnDefinition { +public: + MultiFileReaderColumnDefinition(const string &name, const LogicalType &type) : name(name), type(type) { + } + + MultiFileReaderColumnDefinition(const MultiFileReaderColumnDefinition &other) + : name(other.name), type(other.type), children(other.children), + default_expression(other.default_expression ? other.default_expression->Copy() : nullptr), + identifier(other.identifier) { + } + + MultiFileReaderColumnDefinition(MultiFileReaderColumnDefinition &&other) noexcept = default; + MultiFileReaderColumnDefinition &operator=(const MultiFileReaderColumnDefinition &other) { + if (this != &other) { + name = other.name; + type = other.type; + children = other.children; + default_expression = other.default_expression ? other.default_expression->Copy() : nullptr; + identifier = other.identifier; + } + return *this; + } + MultiFileReaderColumnDefinition &operator=(MultiFileReaderColumnDefinition &&other) noexcept = default; + +public: + static vector ColumnsFromNamesAndTypes(const vector &names, + const vector &types) { + vector columns; + D_ASSERT(names.size() == types.size()); + for (idx_t i = 0; i < names.size(); i++) { + auto &name = names[i]; + auto &type = types[i]; + columns.emplace_back(name, type); + } + return columns; + } + + static void ExtractNamesAndTypes(const vector &columns, vector &names, + vector &types) { + D_ASSERT(names.empty()); + D_ASSERT(types.empty()); + for (auto &column : columns) { + names.push_back(column.name); + types.push_back(column.type); + } + } + + int32_t GetIdentifierFieldId() const { + D_ASSERT(!identifier.IsNull()); + D_ASSERT(identifier.type().id() == LogicalTypeId::INTEGER); + return identifier.GetValue(); + } + + string GetIdentifierName() const { + if (identifier.IsNull()) { + // No identifier was provided, assume the name as the identifier + return name; + } + D_ASSERT(identifier.type().id() == LogicalTypeId::VARCHAR); + return identifier.GetValue(); + } + + Value GetDefaultValue() const { + D_ASSERT(default_expression); + if (default_expression->type != ExpressionType::VALUE_CONSTANT) { + throw NotImplementedException("Default expression that isn't constant is not supported yet"); + } + auto &constant_expr = default_expression->Cast(); + return constant_expr.value; + } + +public: + string name; + LogicalType type; + vector children; + unique_ptr default_expression; + + //! Either the field_id or the name to map on + Value identifier; +}; + //! The bind data for the multi-file reader, obtained through MultiFileReader::BindReader struct MultiFileReaderBindData { //! The index of the filename column (if any) @@ -43,6 +125,10 @@ struct MultiFileReaderBindData { vector hive_partitioning_indexes; //! The index of the file_row_number column (if any) idx_t file_row_number_idx = DConstants::INVALID_INDEX; + //! (optional) The schema set by the multi file reader + vector schema; + //! The method used to map local -> global columns + MultiFileReaderColumnMappingMode mapping = MultiFileReaderColumnMappingMode::BY_NAME; DUCKDB_API void Serialize(Serializer &serializer) const; DUCKDB_API static MultiFileReaderBindData Deserialize(Deserializer &deserializer); @@ -168,28 +254,28 @@ struct MultiFileReader { DUCKDB_API virtual unique_ptr InitializeGlobalState(ClientContext &context, const MultiFileReaderOptions &file_options, const MultiFileReaderBindData &bind_data, const MultiFileList &file_list, - const vector &global_types, const vector &global_names, + const vector &global_columns, const vector &global_column_ids); //! Finalize the bind phase of the multi-file reader after we know (1) the required (output) columns, and (2) the //! pushed down table filters DUCKDB_API virtual void FinalizeBind(const MultiFileReaderOptions &file_options, const MultiFileReaderBindData &options, const string &filename, - const vector &local_names, const vector &global_types, - const vector &global_names, + const vector &local_columns, + const vector &global_columns, const vector &global_column_ids, MultiFileReaderData &reader_data, ClientContext &context, optional_ptr global_state); //! Create all required mappings from the global types/names to the file-local types/names - DUCKDB_API virtual void CreateMapping(const string &file_name, const vector &local_types, - const vector &local_names, const vector &global_types, - const vector &global_names, + DUCKDB_API virtual void CreateMapping(const string &file_name, + const vector &local_columns, + const vector &global_columns, const vector &global_column_ids, optional_ptr filters, MultiFileReaderData &reader_data, const string &initial_file, const MultiFileReaderBindData &options, optional_ptr global_state); //! Populated the filter_map - DUCKDB_API virtual void CreateFilterMap(const vector &global_types, + DUCKDB_API virtual void CreateFilterMap(const vector &global_columns, optional_ptr filters, MultiFileReaderData &reader_data, optional_ptr global_state); @@ -239,8 +325,11 @@ struct MultiFileReader { } else { shared_ptr reader; reader = make_shared_ptr(context, files.GetFirstFile(), options); - return_types = reader->return_types; - names = reader->names; + auto &columns = reader->GetColumns(); + for (auto &column : columns) { + return_types.emplace_back(column.type); + names.emplace_back(column.name); + } result.Initialize(std::move(reader)); MultiFileReaderBindData bind_data; BindOptions(options.file_options, files, return_types, names, bind_data); @@ -250,14 +339,15 @@ struct MultiFileReader { template void InitializeReader(READER_CLASS &reader, const MultiFileReaderOptions &options, - const MultiFileReaderBindData &bind_data, const vector &global_types, - const vector &global_names, const vector &global_column_ids, - optional_ptr table_filters, const string &initial_file, - ClientContext &context, optional_ptr global_state) { - FinalizeBind(options, bind_data, reader.GetFileName(), reader.GetNames(), global_types, global_names, - global_column_ids, reader.reader_data, context, global_state); - CreateMapping(reader.GetFileName(), reader.GetTypes(), reader.GetNames(), global_types, global_names, - global_column_ids, table_filters, reader.reader_data, initial_file, bind_data, global_state); + const MultiFileReaderBindData &bind_data, + const vector &global_columns, + const vector &global_column_ids, optional_ptr table_filters, + const string &initial_file, ClientContext &context, + optional_ptr global_state) { + FinalizeBind(options, bind_data, reader.GetFileName(), reader.GetColumns(), global_columns, global_column_ids, + reader.reader_data, context, global_state); + CreateMapping(reader.GetFileName(), reader.GetColumns(), global_columns, global_column_ids, table_filters, + reader.reader_data, initial_file, bind_data, global_state); reader.reader_data.filters = table_filters; } @@ -303,11 +393,26 @@ struct MultiFileReader { TableFunctionPartitionInput &input); protected: - virtual void CreateNameMapping(const string &file_name, const vector &local_types, - const vector &local_names, const vector &global_types, - const vector &global_names, const vector &global_column_ids, - MultiFileReaderData &reader_data, const string &initial_file, - optional_ptr global_state); + virtual void CreateColumnMapping(const string &file_name, + const vector &local_columns, + const vector &global_columns, + const vector &global_column_ids, MultiFileReaderData &reader_data, + const MultiFileReaderBindData &bind_data, const string &initial_file, + optional_ptr global_state); + virtual void CreateColumnMappingByFieldId(const string &file_name, + const vector &local_columns, + const vector &global_columns, + const vector &global_column_ids, + MultiFileReaderData &reader_data, + const MultiFileReaderBindData &bind_data, const string &initial_file, + optional_ptr global_state); + virtual void CreateColumnMappingByName(const string &file_name, + const vector &local_columns, + const vector &global_columns, + const vector &global_column_ids, + MultiFileReaderData &reader_data, const MultiFileReaderBindData &bind_data, + const string &initial_file, + optional_ptr global_state); //! Used in errors to report which function is using this MultiFileReader string function_name; diff --git a/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp b/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp index 99a0297f4..32486cc8f 100644 --- a/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +++ b/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp @@ -17,12 +17,16 @@ namespace duckdb { struct BindInfo; class MultiFileList; +enum class MultiFileReaderColumnMappingMode : uint8_t { BY_NAME, BY_FIELD_ID }; + struct MultiFileReaderOptions { bool filename = false; bool hive_partitioning = false; bool auto_detect_hive_partitioning = true; bool union_by_name = false; bool hive_types_autocast = true; + MultiFileReaderColumnMappingMode mapping = MultiFileReaderColumnMappingMode::BY_NAME; + case_insensitive_map_t hive_types_schema; // Default/configurable name of the column containing the file names diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp index a31fd6190..c585576f2 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp @@ -55,7 +55,7 @@ class CSVError { //! Produces error messages for column name -> type mismatch. static CSVError ColumnTypesError(case_insensitive_map_t sql_types_per_column, const vector &names); //! Produces error messages for casting errors - static CSVError CastError(const CSVReaderOptions &options, string &column_name, string &cast_error, + static CSVError CastError(const CSVReaderOptions &options, const string &column_name, string &cast_error, idx_t column_idx, string &csv_row, LinesPerBoundary error_info, idx_t row_byte_position, optional_idx byte_position, LogicalTypeId type, const string ¤t_path); //! Produces error for when the line size exceeds the maximum line size option diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp index 3ebc88ff3..016f0b908 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp @@ -51,10 +51,15 @@ class CSVFileScan { CSVFileScan(ClientContext &context, const string &file_name, const CSVReaderOptions &options); +public: void SetStart(); + void SetNamesAndTypes(const vector &names, const vector &types); + +public: const string &GetFileName() const; const vector &GetNames(); const vector &GetTypes(); + const vector &GetColumns(); void InitializeProjection(); void Finish(); @@ -96,8 +101,6 @@ class CSVFileScan { //! Whether or not this is an on-disk file bool on_disk_file = true; - vector names; - vector types; MultiFileReaderData reader_data; vector file_types; @@ -110,5 +113,10 @@ class CSVFileScan { CSVReaderOptions options; CSVIterator start_iterator; + +private: + vector names; + vector types; + vector columns; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp b/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp index 181751c1e..0467e37c5 100644 --- a/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +++ b/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp @@ -17,7 +17,7 @@ struct BoundParameterData { public: BoundParameterData() { } - explicit BoundParameterData(Value val) : value(std::move(val)), return_type(value.type()) { + explicit BoundParameterData(Value val) : value(std::move(val)), return_type(GetDefaultType(value.type())) { } BoundParameterData(Value val, LogicalType type_p) : value(std::move(val)), return_type(std::move(type_p)) { } @@ -39,6 +39,14 @@ struct BoundParameterData { void Serialize(Serializer &serializer) const; static shared_ptr Deserialize(Deserializer &deserializer); + +private: + LogicalType GetDefaultType(const LogicalType &type) { + if (value.type().id() == LogicalTypeId::VARCHAR && StringType::GetCollation(type).empty()) { + return LogicalTypeId::STRING_LITERAL; + } + return value.type(); + } }; } // namespace duckdb diff --git a/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp b/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp index cd490f433..525dd3c62 100644 --- a/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +++ b/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp @@ -28,6 +28,7 @@ void ExpressionBinder::TestCollation(ClientContext &context, const string &colla static bool SwitchVarcharComparison(const LogicalType &type) { switch (type.id()) { + case LogicalTypeId::BOOLEAN: case LogicalTypeId::TINYINT: case LogicalTypeId::SMALLINT: case LogicalTypeId::INTEGER: diff --git a/src/duckdb/src/planner/binder/statement/bind_execute.cpp b/src/duckdb/src/planner/binder/statement/bind_execute.cpp index 3e3af4d6a..86799dc95 100644 --- a/src/duckdb/src/planner/binder/statement/bind_execute.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_execute.cpp @@ -54,7 +54,8 @@ BoundStatement Binder::Bind(ExecuteStatement &stmt) { parameter_data = BoundParameterData(std::move(constant.value), std::move(return_type)); } else { auto value = ExpressionExecutor::EvaluateScalar(context, *bound_expr, true); - parameter_data = BoundParameterData(std::move(value)); + auto value_type = value.type(); + parameter_data = BoundParameterData(std::move(value), std::move(value_type)); } bind_values[pair.first] = std::move(parameter_data); } diff --git a/src/duckdb/third_party/httplib/httplib.hpp b/src/duckdb/third_party/httplib/httplib.hpp index 6432d5d1a..f06db896a 100644 --- a/src/duckdb/third_party/httplib/httplib.hpp +++ b/src/duckdb/third_party/httplib/httplib.hpp @@ -2466,7 +2466,6 @@ inline std::string encode_url(const std::string &s) { for (size_t i = 0; s[i]; i++) { switch (s[i]) { case ' ': result += "%20"; break; - case '+': result += "%2B"; break; case '\r': result += "%0D"; break; case '\n': result += "%0A"; break; case '\'': result += "%27"; break;