diff --git a/c_src/duckdb/duckdb.cpp b/c_src/duckdb/duckdb.cpp index 9fcb9a1..5c5ff20 100644 --- a/c_src/duckdb/duckdb.cpp +++ b/c_src/duckdb/duckdb.cpp @@ -2520,6 +2520,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = { {"st_envelope_agg", "spatial", CatalogType::AGGREGATE_FUNCTION_ENTRY}, {"st_equals", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_extent", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"st_extent_agg", "spatial", CatalogType::AGGREGATE_FUNCTION_ENTRY}, {"st_extent_approx", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_exteriorring", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_flipcoordinates", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, @@ -2558,6 +2559,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = { {"st_makevalid", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_mmax", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_mmin", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"st_multi", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_ngeometries", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_ninteriorrings", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, {"st_normalize", "spatial", CatalogType::SCALAR_FUNCTION_ENTRY}, @@ -2738,11 +2740,18 @@ static constexpr ExtensionEntry EXTENSION_SECRET_TYPES[] = { // Note: these are currently hardcoded in scripts/generate_extensions_function.py // TODO: automate by passing though to script via duckdb static constexpr ExtensionEntry EXTENSION_SECRET_PROVIDERS[] = { - {"s3/config", "httpfs"}, {"gcs/config", "httpfs"}, - {"r2/config", "httpfs"}, {"s3/credential_chain", "aws"}, - {"gcs/credential_chain", "aws"}, {"r2/credential_chain", "aws"}, - {"azure/config", "azure"}, {"azure/credential_chain", "azure"}, - {"huggingface/config", "httfps"}, {"huggingface/credential_chain", "httpfs"}, + {"s3/config", "httpfs"}, + {"gcs/config", "httpfs"}, + {"r2/config", "httpfs"}, + {"s3/credential_chain", "aws"}, + {"gcs/credential_chain", "aws"}, + {"r2/credential_chain", "aws"}, + {"azure/access_token", "azure"}, + {"azure/config", "azure"}, + {"azure/credential_chain", "azure"}, + {"azure/service_principal", "azure"}, + {"huggingface/config", "httfps"}, + {"huggingface/credential_chain", "httpfs"}, {"bearer/config", "httpfs"}}; // EXTENSION_SECRET_PROVIDERS static constexpr const char *AUTOLOADABLE_EXTENSIONS[] = { @@ -2866,7 +2875,7 @@ class ExtensionHelper { static bool CheckExtensionSignature(FileHandle &handle, ParsedExtensionMetaData &parsed_metadata, const bool allow_community_extensions); - static ParsedExtensionMetaData ParseExtensionMetaData(const char *metadata); + static ParsedExtensionMetaData ParseExtensionMetaData(const char *metadata) noexcept; static ParsedExtensionMetaData ParseExtensionMetaData(FileHandle &handle); //! Get the extension url template, containing placeholders for version, platform and extension name @@ -4042,7 +4051,9 @@ class BlockManager { //! Convert an existing in-memory buffer into a persistent disk-backed block shared_ptr ConvertToPersistent(block_id_t block_id, shared_ptr old_block); - void UnregisterBlock(block_id_t block_id); + void UnregisterBlock(BlockHandle &block); + //! UnregisterBlock, only accepts non-temporary block ids + void UnregisterBlock(block_id_t id); //! Returns a reference to the metadata manager of this block manager. MetadataManager &GetMetadataManager(); @@ -4160,8 +4171,7 @@ class BufferManager { } public: - virtual BufferHandle Allocate(MemoryTag tag, idx_t block_size, bool can_destroy = true, - shared_ptr *block = nullptr) = 0; + virtual BufferHandle Allocate(MemoryTag tag, idx_t block_size, bool can_destroy = true) = 0; //! Reallocate an in-memory buffer that is pinned. virtual void ReAllocate(shared_ptr &handle, idx_t block_size) = 0; virtual BufferHandle Pin(shared_ptr &handle) = 0; @@ -4228,8 +4238,9 @@ class BufferManager { virtual void PurgeQueue(FileBufferType type) = 0; virtual void AddToEvictionQueue(shared_ptr &handle); virtual void WriteTemporaryBuffer(MemoryTag tag, block_id_t block_id, FileBuffer &buffer); - virtual unique_ptr ReadTemporaryBuffer(MemoryTag tag, block_id_t id, unique_ptr buffer); - virtual void DeleteTemporaryFile(block_id_t id); + virtual unique_ptr ReadTemporaryBuffer(MemoryTag tag, BlockHandle &block, + unique_ptr buffer); + virtual void DeleteTemporaryFile(BlockHandle &block); }; } // namespace duckdb @@ -4312,7 +4323,7 @@ struct TempBufferPoolReservation : BufferPoolReservation { } }; -class BlockHandle { +class BlockHandle : public enable_shared_from_this { friend class BlockManager; friend struct BufferEvictionNode; friend class BufferHandle; @@ -4354,6 +4365,10 @@ class BlockHandle { unswizzled = unswizzler; } + MemoryTag GetMemoryTag() const { + return tag; + } + inline void SetDestroyBufferUpon(DestroyBufferUpon destroy_buffer_upon_p) { lock_guard guard(lock); destroy_buffer_upon = destroy_buffer_upon_p; @@ -4375,9 +4390,8 @@ class BlockHandle { } private: - static BufferHandle Load(shared_ptr &handle, unique_ptr buffer = nullptr); - static BufferHandle LoadFromBuffer(shared_ptr &handle, data_ptr_t data, - unique_ptr reusable_buffer); + BufferHandle Load(unique_ptr buffer = nullptr); + BufferHandle LoadFromBuffer(data_ptr_t data, unique_ptr reusable_buffer); unique_ptr UnloadAndTakeBlock(); void Unload(); bool CanUnload(); @@ -4884,6 +4898,7 @@ class ColumnDataAllocator { explicit ColumnDataAllocator(BufferManager &buffer_manager); ColumnDataAllocator(ClientContext &context, ColumnDataAllocatorType allocator_type); ColumnDataAllocator(ColumnDataAllocator &allocator); + ~ColumnDataAllocator(); //! Returns an allocator object to allocate with. This returns the allocator in IN_MEMORY_ALLOCATOR, and a buffer //! allocator in case of BUFFER_MANAGER_ALLOCATOR. @@ -8061,6 +8076,7 @@ class MetadataManager; struct VacuumState; struct CollectionCheckpointState; struct PersistentCollectionData; +class CheckpointTask; class RowGroupCollection { public: @@ -8126,8 +8142,9 @@ class RowGroupCollection { void InitializeVacuumState(CollectionCheckpointState &checkpoint_state, VacuumState &state, vector> &segments); - bool ScheduleVacuumTasks(CollectionCheckpointState &checkpoint_state, VacuumState &state, idx_t segment_idx); - void ScheduleCheckpointTask(CollectionCheckpointState &checkpoint_state, idx_t segment_idx); + bool ScheduleVacuumTasks(CollectionCheckpointState &checkpoint_state, VacuumState &state, idx_t segment_idx, + bool schedule_vacuum); + unique_ptr GetCheckpointTask(CollectionCheckpointState &checkpoint_state, idx_t segment_idx); void CommitDropColumn(idx_t index); void CommitDropTable(); @@ -8245,6 +8262,7 @@ class OptimisticDataWriter { + namespace duckdb { class AttachedDatabase; class Catalog; @@ -13344,6 +13362,7 @@ class BoundForeignKeyConstraint : public BoundConstraint { + namespace duckdb { class CheckpointLock; class RowGroupCollection; @@ -25400,44 +25419,6 @@ CatalogTransaction CatalogTransaction::GetSystemTransaction(DatabaseInstance &db -//===----------------------------------------------------------------------===// -// DuckDB -// -// duckdb/parser/simplified_token.hpp -// -// -//===----------------------------------------------------------------------===// - - - - - -namespace duckdb { - -//! Simplified tokens are a simplified (dense) representation of the lexer -//! Used for simple syntax highlighting in the tests -enum class SimplifiedTokenType : uint8_t { - SIMPLIFIED_TOKEN_IDENTIFIER, - SIMPLIFIED_TOKEN_NUMERIC_CONSTANT, - SIMPLIFIED_TOKEN_STRING_CONSTANT, - SIMPLIFIED_TOKEN_OPERATOR, - SIMPLIFIED_TOKEN_KEYWORD, - SIMPLIFIED_TOKEN_COMMENT -}; - -struct SimplifiedToken { - SimplifiedTokenType type; - idx_t start; -}; - -enum class KeywordCategory : uint8_t { KEYWORD_RESERVED, KEYWORD_UNRESERVED, KEYWORD_TYPE_FUNC, KEYWORD_COL_NAME }; - -struct ParserKeyword { - string name; - KeywordCategory category; -}; - -} // namespace duckdb //===----------------------------------------------------------------------===// // DuckDB @@ -25494,7 +25475,7 @@ class Parser { static vector Tokenize(const string &query); //! Returns true if the given text matches a keyword of the parser - static bool IsKeyword(const string &text); + static KeywordCategory IsKeyword(const string &text); //! Returns a list of all keywords in the parser static vector KeywordList(); @@ -28146,6 +28127,8 @@ using std::thread; +#include + @@ -28337,6 +28320,10 @@ class ArrowType { explicit ArrowType(LogicalType type_p, unique_ptr type_info = nullptr) : type(std::move(type_p)), type_info(std::move(type_info)) { } + explicit ArrowType(string error_message_p, bool not_implemented_p = false) + : type(LogicalTypeId::INVALID), type_info(nullptr), error_message(std::move(error_message_p)), + not_implemented(not_implemented_p) { + } public: LogicalType GetDuckType(bool use_dictionary = false) const; @@ -28352,6 +28339,7 @@ class ArrowType { const T &GetTypeInfo() const { return type_info->Cast(); } + void ThrowIfInvalid() const; private: LogicalType type; @@ -28360,6 +28348,10 @@ class ArrowType { //! Is run-end-encoded bool run_end_encoded = false; unique_ptr type_info; + //! Error message in case of an invalid type (i.e., from an unsupported extension) + string error_message; + //! In case of an error do we throw not implemented? + bool not_implemented = false; }; using arrow_column_map_t = unordered_map>; @@ -34597,6 +34589,49 @@ class VectorCache { + + + + +namespace duckdb { + +class DataChunk; + +//! Abstract chunk fetcher +class ChunkScanState { +public: + explicit ChunkScanState(); + virtual ~ChunkScanState(); + +public: + ChunkScanState(const ChunkScanState &other) = delete; + ChunkScanState(ChunkScanState &&other) = default; + ChunkScanState &operator=(const ChunkScanState &other) = delete; + ChunkScanState &operator=(ChunkScanState &&other) = default; + +public: + virtual bool LoadNextChunk(ErrorData &error) = 0; + virtual bool HasError() const = 0; + virtual ErrorData &GetError() = 0; + virtual const vector &Types() const = 0; + virtual const vector &Names() const = 0; + idx_t CurrentOffset() const; + idx_t RemainingInChunk() const; + DataChunk &CurrentChunk(); + bool ChunkIsEmpty() const; + bool Finished() const; + bool ScanStarted() const; + void IncreaseOffset(idx_t increment, bool unsafe = false); + +protected: + idx_t offset = 0; + bool finished = false; + unique_ptr current_chunk; +}; + +} // namespace duckdb + + namespace duckdb { class ArrowSchemaMetadata { public: @@ -34781,7 +34816,7 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co break; } case LogicalTypeId::VARCHAR: - if (type.IsJSONType()) { + if (type.IsJSONType() && options.arrow_lossless_conversion) { auto schema_metadata = ArrowSchemaMetadata::MetadataFromName("arrow.json"); root_holder.metadata_info.emplace_back(schema_metadata.SerializeMetadata()); child.metadata = root_holder.metadata_info.back().get(); @@ -35311,6 +35346,38 @@ class ArrowMergeEvent : public BasePipelineEvent { } // namespace duckdb +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/common/arrow/arrow_util.hpp +// +// +//===----------------------------------------------------------------------===// + + + + + + + + +namespace duckdb { + +class QueryResult; +class DataChunk; + +class ArrowUtil { +public: + static bool TryFetchChunk(ChunkScanState &scan_state, ClientProperties options, idx_t chunk_size, ArrowArray *out, + idx_t &result_count, ErrorData &error); + static idx_t FetchChunk(ChunkScanState &scan_state, ClientProperties options, idx_t chunk_size, ArrowArray *out); + +private: + static bool TryFetchNext(QueryResult &result, unique_ptr &out, ErrorData &error); +}; + +} // namespace duckdb + namespace duckdb { @@ -35861,6 +35928,67 @@ idx_t ArrowQueryResult::BatchSize() const { +namespace duckdb { + +bool ArrowUtil::TryFetchChunk(ChunkScanState &scan_state, ClientProperties options, idx_t batch_size, ArrowArray *out, + idx_t &count, ErrorData &error) { + count = 0; + ArrowAppender appender(scan_state.Types(), batch_size, std::move(options)); + auto remaining_tuples_in_chunk = scan_state.RemainingInChunk(); + if (remaining_tuples_in_chunk) { + // We start by scanning the non-finished current chunk + idx_t cur_consumption = MinValue(remaining_tuples_in_chunk, batch_size); + count += cur_consumption; + auto ¤t_chunk = scan_state.CurrentChunk(); + appender.Append(current_chunk, scan_state.CurrentOffset(), scan_state.CurrentOffset() + cur_consumption, + current_chunk.size()); + scan_state.IncreaseOffset(cur_consumption); + } + while (count < batch_size) { + if (!scan_state.LoadNextChunk(error)) { + if (scan_state.HasError()) { + error = scan_state.GetError(); + } + return false; + } + if (scan_state.ChunkIsEmpty()) { + // The scan was successful, but an empty chunk was returned + break; + } + auto ¤t_chunk = scan_state.CurrentChunk(); + if (scan_state.Finished() || current_chunk.size() == 0) { + break; + } + // The amount we still need to append into this chunk + auto remaining = batch_size - count; + + // The amount remaining, capped by the amount left in the current chunk + auto to_append_to_batch = MinValue(remaining, scan_state.RemainingInChunk()); + appender.Append(current_chunk, 0, to_append_to_batch, current_chunk.size()); + count += to_append_to_batch; + scan_state.IncreaseOffset(to_append_to_batch); + } + if (count > 0) { + *out = appender.Finalize(); + } + return true; +} + +idx_t ArrowUtil::FetchChunk(ChunkScanState &scan_state, ClientProperties options, idx_t chunk_size, ArrowArray *out) { + ErrorData error; + idx_t result_count; + if (!TryFetchChunk(scan_state, std::move(options), chunk_size, out, result_count, error)) { + error.Throw(); + } + return result_count; +} + +} // namespace duckdb + + + + + @@ -36099,59 +36227,6 @@ ResultArrowArrayStreamWrapper::ResultArrowArrayStreamWrapper(unique_ptr 0) { - *out = appender.Finalize(); - } - return true; -} - -idx_t ArrowUtil::FetchChunk(ChunkScanState &scan_state, ClientProperties options, idx_t chunk_size, ArrowArray *out) { - ErrorData error; - idx_t result_count; - if (!TryFetchChunk(scan_state, std::move(options), chunk_size, out, result_count, error)) { - error.Throw(); - } - return result_count; -} - } // namespace duckdb @@ -36178,6 +36253,7 @@ idx_t ArrowUtil::FetchChunk(ChunkScanState &scan_state, ClientProperties options + namespace duckdb { class PreparedStatementData; @@ -38479,6 +38555,66 @@ DUCKDB_API bool TryCast::Operation(double input, double &result, bool strict); //===--------------------------------------------------------------------===// // String -> Numeric Casts //===--------------------------------------------------------------------===// +static inline bool TryCastStringBool(const char *input_data, idx_t input_size, bool &result, bool strict) { + switch (input_size) { + case 1: { + unsigned char c = static_cast(std::tolower(*input_data)); + if (c == 't' || (!strict && c == 'y') || (!strict && c == '1')) { + result = true; + return true; + } else if (c == 'f' || (!strict && c == 'n') || (!strict && c == '0')) { + result = false; + return true; + } + return false; + } + case 2: { + unsigned char n = static_cast(std::tolower(input_data[0])); + unsigned char o = static_cast(std::tolower(input_data[1])); + if (n == 'n' && o == 'o') { + result = false; + return true; + } + return false; + } + case 3: { + unsigned char y = static_cast(std::tolower(input_data[0])); + unsigned char e = static_cast(std::tolower(input_data[1])); + unsigned char s = static_cast(std::tolower(input_data[2])); + if (y == 'y' && e == 'e' && s == 's') { + result = true; + return true; + } + return false; + } + case 4: { + unsigned char t = static_cast(std::tolower(input_data[0])); + unsigned char r = static_cast(std::tolower(input_data[1])); + unsigned char u = static_cast(std::tolower(input_data[2])); + unsigned char e = static_cast(std::tolower(input_data[3])); + if (t == 't' && r == 'r' && u == 'u' && e == 'e') { + result = true; + return true; + } + return false; + } + case 5: { + unsigned char f = static_cast(std::tolower(input_data[0])); + unsigned char a = static_cast(std::tolower(input_data[1])); + unsigned char l = static_cast(std::tolower(input_data[2])); + unsigned char s = static_cast(std::tolower(input_data[3])); + unsigned char e = static_cast(std::tolower(input_data[4])); + if (f == 'f' && a == 'a' && l == 'l' && s == 's' && e == 'e') { + result = false; + return true; + } + return false; + } + default: + return false; + } +} + template <> DUCKDB_API bool TryCast::Operation(string_t input, bool &result, bool strict); template <> @@ -38941,9 +39077,7 @@ optional_idx CGroups::GetMemoryLimit(FileSystem &fs) { } optional_idx CGroups::GetCGroupV2MemoryLimit(FileSystem &fs) { -#ifdef DUCKDB_WASM - return optional_idx(); -#else +#if defined(__linux__) && !defined(DUCKDB_WASM) const char *cgroup_self = "/proc/self/cgroup"; const char *memory_max = "/sys/fs/cgroup/%s/memory.max"; @@ -38964,13 +39098,13 @@ optional_idx CGroups::GetCGroupV2MemoryLimit(FileSystem &fs) { } return ReadCGroupValue(fs, memory_max_path); +#else + return optional_idx(); #endif } optional_idx CGroups::GetCGroupV1MemoryLimit(FileSystem &fs) { -#ifdef DUCKDB_WASM - return optional_idx(); -#else +#if defined(__linux__) && !defined(DUCKDB_WASM) const char *cgroup_self = "/proc/self/cgroup"; const char *memory_limit = "/sys/fs/cgroup/memory/%s/memory.limit_in_bytes"; @@ -38991,13 +39125,13 @@ optional_idx CGroups::GetCGroupV1MemoryLimit(FileSystem &fs) { } return ReadCGroupValue(fs, memory_limit_path); +#else + return optional_idx(); #endif } string CGroups::ReadCGroupPath(FileSystem &fs, const char *cgroup_file) { -#ifdef DUCKDB_WASM - return ""; -#else +#if defined(__linux__) && !defined(DUCKDB_WASM) auto handle = fs.OpenFile(cgroup_file, FileFlags::FILE_FLAGS_READ); char buffer[1024]; auto bytes_read = fs.Read(*handle, buffer, sizeof(buffer) - 1); @@ -39009,15 +39143,12 @@ string CGroups::ReadCGroupPath(FileSystem &fs, const char *cgroup_file) { if (pos != string::npos) { return content.substr(pos + 2); } - - return ""; #endif + return ""; } string CGroups::ReadMemoryCGroupPath(FileSystem &fs, const char *cgroup_file) { -#ifdef DUCKDB_WASM - return ""; -#else +#if defined(__linux__) && !defined(DUCKDB_WASM) auto handle = fs.OpenFile(cgroup_file, FileFlags::FILE_FLAGS_READ); char buffer[1024]; auto bytes_read = fs.Read(*handle, buffer, sizeof(buffer) - 1); @@ -39034,15 +39165,12 @@ string CGroups::ReadMemoryCGroupPath(FileSystem &fs, const char *cgroup_file) { } content.erase(0, pos + 1); } - - return ""; #endif + return ""; } optional_idx CGroups::ReadCGroupValue(FileSystem &fs, const char *file_path) { -#ifdef DUCKDB_WASM - return optional_idx(); -#else +#if defined(__linux__) && !defined(DUCKDB_WASM) auto handle = fs.OpenFile(file_path, FileFlags::FILE_FLAGS_READ); char buffer[100]; auto bytes_read = fs.Read(*handle, buffer, 99); @@ -39052,15 +39180,12 @@ optional_idx CGroups::ReadCGroupValue(FileSystem &fs, const char *file_path) { if (TryCast::Operation(string_t(buffer), value)) { return optional_idx(value); } - return optional_idx(); #endif + return optional_idx(); } idx_t CGroups::GetCPULimit(FileSystem &fs, idx_t physical_cores) { -#ifdef DUCKDB_WASM - return physical_cores; -#else - +#if defined(__linux__) && !defined(DUCKDB_WASM) static constexpr const char *cpu_max = "/sys/fs/cgroup/cpu.max"; static constexpr const char *cfs_quota = "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"; static constexpr const char *cfs_period = "/sys/fs/cgroup/cpu/cpu.cfs_period_us"; @@ -39102,6 +39227,8 @@ idx_t CGroups::GetCPULimit(FileSystem &fs, idx_t physical_cores) { } else { return physical_cores; } +#else + return physical_cores; #endif } @@ -39393,6 +39520,7 @@ bool CompressedFileSystem::CanSeek() { + namespace duckdb { constexpr const idx_t DConstants::INVALID_INDEX; @@ -39411,6 +39539,10 @@ bool IsPowerOfTwo(uint64_t v) { } uint64_t NextPowerOfTwo(uint64_t v) { + auto v_in = v; + if (v < 1) { // this is not strictly right but we seem to rely on it in places + return 2; + } v--; v |= v >> 1; v |= v >> 2; @@ -39419,6 +39551,9 @@ uint64_t NextPowerOfTwo(uint64_t v) { v |= v >> 16; v |= v >> 32; v++; + if (v == 0) { + throw OutOfRangeException("Can't find next power of 2 for %llu", v_in); + } return v; } @@ -43488,7 +43623,8 @@ struct RowDataBlock { RowDataBlock(MemoryTag tag, BufferManager &buffer_manager, idx_t capacity, idx_t entry_size) : capacity(capacity), entry_size(entry_size), count(0), byte_offset(0) { auto size = MaxValue(buffer_manager.GetBlockSize(), capacity * entry_size); - buffer_manager.Allocate(tag, size, false, &block); + auto buffer_handle = buffer_manager.Allocate(tag, size, false); + block = buffer_handle.GetBlockHandle(); D_ASSERT(BufferManager::GetAllocSize(size) == block->GetMemoryUsage()); } @@ -46402,7 +46538,7 @@ const char* EnumUtil::ToChars(AccessMode value) { case AccessMode::READ_WRITE: return "READ_WRITE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46420,7 +46556,7 @@ AccessMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "READ_WRITE")) { return AccessMode::READ_WRITE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46431,7 +46567,7 @@ const char* EnumUtil::ToChars(AggregateCombineType value) case AggregateCombineType::ALLOW_DESTRUCTIVE: return "ALLOW_DESTRUCTIVE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46443,7 +46579,7 @@ AggregateCombineType EnumUtil::FromString(const char *valu if (StringUtil::Equals(value, "ALLOW_DESTRUCTIVE")) { return AggregateCombineType::ALLOW_DESTRUCTIVE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46456,7 +46592,7 @@ const char* EnumUtil::ToChars(AggregateHandling value) { case AggregateHandling::FORCE_AGGREGATES: return "FORCE_AGGREGATES"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46471,7 +46607,7 @@ AggregateHandling EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "FORCE_AGGREGATES")) { return AggregateHandling::FORCE_AGGREGATES; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46482,7 +46618,7 @@ const char* EnumUtil::ToChars(AggregateOrderDependent v case AggregateOrderDependent::NOT_ORDER_DEPENDENT: return "NOT_ORDER_DEPENDENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46494,7 +46630,7 @@ AggregateOrderDependent EnumUtil::FromString(const char if (StringUtil::Equals(value, "NOT_ORDER_DEPENDENT")) { return AggregateOrderDependent::NOT_ORDER_DEPENDENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46505,7 +46641,7 @@ const char* EnumUtil::ToChars(AggregateType value) { case AggregateType::DISTINCT: return "DISTINCT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46517,7 +46653,7 @@ AggregateType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DISTINCT")) { return AggregateType::DISTINCT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46528,7 +46664,7 @@ const char* EnumUtil::ToChars(AlterForeignKeyType value) { case AlterForeignKeyType::AFT_DELETE: return "AFT_DELETE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46540,7 +46676,7 @@ AlterForeignKeyType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "AFT_DELETE")) { return AlterForeignKeyType::AFT_DELETE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46551,7 +46687,7 @@ const char* EnumUtil::ToChars(AlterScalarFunctionType v case AlterScalarFunctionType::ADD_FUNCTION_OVERLOADS: return "ADD_FUNCTION_OVERLOADS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46563,7 +46699,7 @@ AlterScalarFunctionType EnumUtil::FromString(const char if (StringUtil::Equals(value, "ADD_FUNCTION_OVERLOADS")) { return AlterScalarFunctionType::ADD_FUNCTION_OVERLOADS; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46574,7 +46710,7 @@ const char* EnumUtil::ToChars(AlterTableFunctionType val case AlterTableFunctionType::ADD_FUNCTION_OVERLOADS: return "ADD_FUNCTION_OVERLOADS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46586,7 +46722,7 @@ AlterTableFunctionType EnumUtil::FromString(const char * if (StringUtil::Equals(value, "ADD_FUNCTION_OVERLOADS")) { return AlterTableFunctionType::ADD_FUNCTION_OVERLOADS; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46615,7 +46751,7 @@ const char* EnumUtil::ToChars(AlterTableType value) { case AlterTableType::SET_COLUMN_COMMENT: return "SET_COLUMN_COMMENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46654,7 +46790,7 @@ AlterTableType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SET_COLUMN_COMMENT")) { return AlterTableType::SET_COLUMN_COMMENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46679,7 +46815,7 @@ const char* EnumUtil::ToChars(AlterType value) { case AlterType::SET_COLUMN_COMMENT: return "SET_COLUMN_COMMENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46712,7 +46848,7 @@ AlterType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SET_COLUMN_COMMENT")) { return AlterType::SET_COLUMN_COMMENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46723,7 +46859,7 @@ const char* EnumUtil::ToChars(AlterViewType value) { case AlterViewType::RENAME_VIEW: return "RENAME_VIEW"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46735,7 +46871,7 @@ AlterViewType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "RENAME_VIEW")) { return AlterViewType::RENAME_VIEW; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46746,7 +46882,7 @@ const char* EnumUtil::ToChars(AppenderType value) { case AppenderType::PHYSICAL: return "PHYSICAL"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46758,7 +46894,7 @@ AppenderType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PHYSICAL")) { return AppenderType::PHYSICAL; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46779,7 +46915,7 @@ const char* EnumUtil::ToChars(ArrowDateTimeType value) { case ArrowDateTimeType::MONTH_DAY_NANO: return "MONTH_DAY_NANO"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46806,7 +46942,7 @@ ArrowDateTimeType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "MONTH_DAY_NANO")) { return ArrowDateTimeType::MONTH_DAY_NANO; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46817,7 +46953,7 @@ const char* EnumUtil::ToChars(ArrowOffsetSize value) { case ArrowOffsetSize::LARGE: return "LARGE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46829,7 +46965,7 @@ ArrowOffsetSize EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "LARGE")) { return ArrowOffsetSize::LARGE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46846,7 +46982,7 @@ const char* EnumUtil::ToChars(ArrowTypeInfoType value) { case ArrowTypeInfoType::ARRAY: return "ARRAY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46867,7 +47003,7 @@ ArrowTypeInfoType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ARRAY")) { return ArrowTypeInfoType::ARRAY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46882,7 +47018,7 @@ const char* EnumUtil::ToChars(ArrowVariableSizeType value case ArrowVariableSizeType::VIEW: return "VIEW"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46900,7 +47036,7 @@ ArrowVariableSizeType EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "VIEW")) { return ArrowVariableSizeType::VIEW; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46911,7 +47047,7 @@ const char* EnumUtil::ToChars(BinderType value) { case BinderType::VIEW_BINDER: return "VIEW_BINDER"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46923,7 +47059,7 @@ BinderType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "VIEW_BINDER")) { return BinderType::VIEW_BINDER; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46936,7 +47072,7 @@ const char* EnumUtil::ToChars(BindingMode value) { case BindingMode::EXTRACT_REPLACEMENT_SCANS: return "EXTRACT_REPLACEMENT_SCANS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46951,7 +47087,7 @@ BindingMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "EXTRACT_REPLACEMENT_SCANS")) { return BindingMode::EXTRACT_REPLACEMENT_SCANS; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -46970,7 +47106,7 @@ const char* EnumUtil::ToChars(BitpackingMode value) { case BitpackingMode::FOR: return "FOR"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -46994,7 +47130,7 @@ BitpackingMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "FOR")) { return BitpackingMode::FOR; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47005,7 +47141,7 @@ const char* EnumUtil::ToChars(BlockState value) { case BlockState::BLOCK_LOADED: return "BLOCK_LOADED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47017,7 +47153,7 @@ BlockState EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BLOCK_LOADED")) { return BlockState::BLOCK_LOADED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47032,7 +47168,7 @@ const char* EnumUtil::ToChars(CAPIResultSetType value) { case CAPIResultSetType::CAPI_RESULT_TYPE_DEPRECATED: return "CAPI_RESULT_TYPE_DEPRECATED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47050,7 +47186,7 @@ CAPIResultSetType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "CAPI_RESULT_TYPE_DEPRECATED")) { return CAPIResultSetType::CAPI_RESULT_TYPE_DEPRECATED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47081,7 +47217,7 @@ const char* EnumUtil::ToChars(CSVState value) { case CSVState::COMMENT: return "COMMENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47123,7 +47259,7 @@ CSVState EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "COMMENT")) { return CSVState::COMMENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47136,7 +47272,7 @@ const char* EnumUtil::ToChars(CTEMaterialize value) { case CTEMaterialize::CTE_MATERIALIZE_NEVER: return "CTE_MATERIALIZE_NEVER"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47151,7 +47287,7 @@ CTEMaterialize EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "CTE_MATERIALIZE_NEVER")) { return CTEMaterialize::CTE_MATERIALIZE_NEVER; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47164,7 +47300,7 @@ const char* EnumUtil::ToChars(CatalogLookupBehavior value case CatalogLookupBehavior::NEVER_LOOKUP: return "NEVER_LOOKUP"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47179,7 +47315,7 @@ CatalogLookupBehavior EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "NEVER_LOOKUP")) { return CatalogLookupBehavior::NEVER_LOOKUP; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47232,7 +47368,7 @@ const char* EnumUtil::ToChars(CatalogType value) { case CatalogType::DEPENDENCY_ENTRY: return "DEPENDENCY_ENTRY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47307,7 +47443,7 @@ CatalogType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DEPENDENCY_ENTRY")) { return CatalogType::DEPENDENCY_ENTRY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47322,7 +47458,7 @@ const char* EnumUtil::ToChars(CheckpointAbort value) { case CheckpointAbort::DEBUG_ABORT_AFTER_FREE_LIST_WRITE: return "DEBUG_ABORT_AFTER_FREE_LIST_WRITE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47340,7 +47476,7 @@ CheckpointAbort EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DEBUG_ABORT_AFTER_FREE_LIST_WRITE")) { return CheckpointAbort::DEBUG_ABORT_AFTER_FREE_LIST_WRITE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47353,7 +47489,7 @@ const char* EnumUtil::ToChars(ChunkInfoType value) { case ChunkInfoType::EMPTY_INFO: return "EMPTY_INFO"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47368,7 +47504,7 @@ ChunkInfoType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "EMPTY_INFO")) { return ChunkInfoType::EMPTY_INFO; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47381,7 +47517,7 @@ const char* EnumUtil::ToChars(ColumnDataAllocatorType v case ColumnDataAllocatorType::HYBRID: return "HYBRID"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47396,7 +47532,7 @@ ColumnDataAllocatorType EnumUtil::FromString(const char if (StringUtil::Equals(value, "HYBRID")) { return ColumnDataAllocatorType::HYBRID; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47409,7 +47545,7 @@ const char* EnumUtil::ToChars(ColumnDataScanProperties case ColumnDataScanProperties::DISALLOW_ZERO_COPY: return "DISALLOW_ZERO_COPY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47424,7 +47560,7 @@ ColumnDataScanProperties EnumUtil::FromString(const ch if (StringUtil::Equals(value, "DISALLOW_ZERO_COPY")) { return ColumnDataScanProperties::DISALLOW_ZERO_COPY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47435,7 +47571,7 @@ const char* EnumUtil::ToChars(ColumnSegmentType value) { case ColumnSegmentType::PERSISTENT: return "PERSISTENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47447,7 +47583,7 @@ ColumnSegmentType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PERSISTENT")) { return ColumnSegmentType::PERSISTENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47460,7 +47596,7 @@ const char* EnumUtil::ToChars(CompressedMate case CompressedMaterializationDirection::DECOMPRESS: return "DECOMPRESS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47475,7 +47611,7 @@ CompressedMaterializationDirection EnumUtil::FromString", value)); } template<> @@ -47508,7 +47644,7 @@ const char* EnumUtil::ToChars(CompressionType value) { case CompressionType::COMPRESSION_COUNT: return "COMPRESSION_COUNT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47553,7 +47689,7 @@ CompressionType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "COMPRESSION_COUNT")) { return CompressionType::COMPRESSION_COUNT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47564,7 +47700,7 @@ const char* EnumUtil::ToChars(ConflictManagerMode value) { case ConflictManagerMode::THROW: return "THROW"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47576,7 +47712,7 @@ ConflictManagerMode EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "THROW")) { return ConflictManagerMode::THROW; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47593,7 +47729,7 @@ const char* EnumUtil::ToChars(ConstraintType value) { case ConstraintType::FOREIGN_KEY: return "FOREIGN_KEY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47614,7 +47750,7 @@ ConstraintType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "FOREIGN_KEY")) { return ConstraintType::FOREIGN_KEY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47625,7 +47761,7 @@ const char* EnumUtil::ToChars(CopyFunctionReturnType val case CopyFunctionReturnType::CHANGED_ROWS_AND_FILE_LIST: return "CHANGED_ROWS_AND_FILE_LIST"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47637,7 +47773,7 @@ CopyFunctionReturnType EnumUtil::FromString(const char * if (StringUtil::Equals(value, "CHANGED_ROWS_AND_FILE_LIST")) { return CopyFunctionReturnType::CHANGED_ROWS_AND_FILE_LIST; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47652,7 +47788,7 @@ const char* EnumUtil::ToChars(CopyOverwriteMode value) { case CopyOverwriteMode::COPY_APPEND: return "COPY_APPEND"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47670,7 +47806,7 @@ CopyOverwriteMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "COPY_APPEND")) { return CopyOverwriteMode::COPY_APPEND; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47681,7 +47817,7 @@ const char* EnumUtil::ToChars(CopyToType value) { case CopyToType::EXPORT_DATABASE: return "EXPORT_DATABASE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47693,7 +47829,7 @@ CopyToType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "EXPORT_DATABASE")) { return CopyToType::EXPORT_DATABASE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47708,7 +47844,7 @@ const char* EnumUtil::ToChars(DataFileType value) { case DataFileType::PARQUET_FILE: return "PARQUET_FILE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47726,7 +47862,7 @@ DataFileType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PARQUET_FILE")) { return DataFileType::PARQUET_FILE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47783,7 +47919,7 @@ const char* EnumUtil::ToChars(DatePartSpecifier value) { case DatePartSpecifier::INVALID: return "INVALID"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47864,7 +48000,7 @@ DatePartSpecifier EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID")) { return DatePartSpecifier::INVALID; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47877,7 +48013,7 @@ const char* EnumUtil::ToChars(DebugInitialize value) { case DebugInitialize::DEBUG_ONE_INITIALIZE: return "DEBUG_ONE_INITIALIZE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47892,7 +48028,7 @@ DebugInitialize EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DEBUG_ONE_INITIALIZE")) { return DebugInitialize::DEBUG_ONE_INITIALIZE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47909,7 +48045,7 @@ const char* EnumUtil::ToChars(DefaultOrderByNullType val case DefaultOrderByNullType::NULLS_LAST_ON_ASC_FIRST_ON_DESC: return "NULLS_LAST_ON_ASC_FIRST_ON_DESC"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47930,7 +48066,7 @@ DefaultOrderByNullType EnumUtil::FromString(const char * if (StringUtil::Equals(value, "NULLS_LAST_ON_ASC_FIRST_ON_DESC")) { return DefaultOrderByNullType::NULLS_LAST_ON_ASC_FIRST_ON_DESC; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47941,7 +48077,7 @@ const char* EnumUtil::ToChars(DependencyEntryType value) { case DependencyEntryType::DEPENDENT: return "DEPENDENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47953,7 +48089,7 @@ DependencyEntryType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "DEPENDENT")) { return DependencyEntryType::DEPENDENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47966,7 +48102,7 @@ const char* EnumUtil::ToChars(DeprecatedIndexType value) { case DeprecatedIndexType::EXTENSION: return "EXTENSION"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -47981,7 +48117,7 @@ DeprecatedIndexType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "EXTENSION")) { return DeprecatedIndexType::EXTENSION; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -47994,7 +48130,7 @@ const char* EnumUtil::ToChars(DestroyBufferUpon value) { case DestroyBufferUpon::UNPIN: return "UNPIN"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48009,7 +48145,7 @@ DestroyBufferUpon EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "UNPIN")) { return DestroyBufferUpon::UNPIN; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48020,7 +48156,7 @@ const char* EnumUtil::ToChars(DistinctType value) { case DistinctType::DISTINCT_ON: return "DISTINCT_ON"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48032,7 +48168,7 @@ DistinctType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DISTINCT_ON")) { return DistinctType::DISTINCT_ON; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48049,7 +48185,7 @@ const char* EnumUtil::ToChars(ErrorType value) { case ErrorType::INVALID: return "INVALID"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48070,7 +48206,7 @@ ErrorType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID")) { return ErrorType::INVALID; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48083,7 +48219,7 @@ const char* EnumUtil::ToChars(ExceptionFormatValueType case ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING: return "FORMAT_VALUE_TYPE_STRING"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48098,7 +48234,7 @@ ExceptionFormatValueType EnumUtil::FromString(const ch if (StringUtil::Equals(value, "FORMAT_VALUE_TYPE_STRING")) { return ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48191,7 +48327,7 @@ const char* EnumUtil::ToChars(ExceptionType value) { case ExceptionType::INVALID_CONFIGURATION: return "INVALID_CONFIGURATION"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48326,7 +48462,7 @@ ExceptionType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID_CONFIGURATION")) { return ExceptionType::INVALID_CONFIGURATION; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48343,7 +48479,7 @@ const char* EnumUtil::ToChars(ExplainFormat value) { case ExplainFormat::GRAPHVIZ: return "GRAPHVIZ"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48364,7 +48500,7 @@ ExplainFormat EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "GRAPHVIZ")) { return ExplainFormat::GRAPHVIZ; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48377,7 +48513,7 @@ const char* EnumUtil::ToChars(ExplainOutputType value) { case ExplainOutputType::PHYSICAL_ONLY: return "PHYSICAL_ONLY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48392,7 +48528,7 @@ ExplainOutputType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PHYSICAL_ONLY")) { return ExplainOutputType::PHYSICAL_ONLY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48403,7 +48539,7 @@ const char* EnumUtil::ToChars(ExplainType value) { case ExplainType::EXPLAIN_ANALYZE: return "EXPLAIN_ANALYZE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48415,7 +48551,7 @@ ExplainType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "EXPLAIN_ANALYZE")) { return ExplainType::EXPLAIN_ANALYZE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48428,7 +48564,7 @@ const char* EnumUtil::ToChars(ExponentType value) { case ExponentType::NEGATIVE: return "NEGATIVE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48443,7 +48579,7 @@ ExponentType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "NEGATIVE")) { return ExponentType::NEGATIVE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48530,7 +48666,7 @@ const char* EnumUtil::ToChars(ExpressionClass value) { case ExpressionClass::BOUND_EXPANDED: return "BOUND_EXPANDED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -48656,7 +48792,7 @@ ExpressionClass EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BOUND_EXPANDED")) { return ExpressionClass::BOUND_EXPANDED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -48801,7 +48937,7 @@ const char* EnumUtil::ToChars(ExpressionType value) { case ExpressionType::BOUND_EXPANDED: return "BOUND_EXPANDED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49014,7 +49150,7 @@ ExpressionType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BOUND_EXPANDED")) { return ExpressionType::BOUND_EXPANDED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49027,7 +49163,7 @@ const char* EnumUtil::ToChars(ExtensionABIType value) { case ExtensionABIType::C_STRUCT: return "C_STRUCT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49042,7 +49178,7 @@ ExtensionABIType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "C_STRUCT")) { return ExtensionABIType::C_STRUCT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49059,7 +49195,7 @@ const char* EnumUtil::ToChars(ExtensionInstallMode value) case ExtensionInstallMode::NOT_INSTALLED: return "NOT_INSTALLED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49080,7 +49216,7 @@ ExtensionInstallMode EnumUtil::FromString(const char *valu if (StringUtil::Equals(value, "NOT_INSTALLED")) { return ExtensionInstallMode::NOT_INSTALLED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49093,7 +49229,7 @@ const char* EnumUtil::ToChars(ExtensionLoadResult value) { case ExtensionLoadResult::NOT_LOADED: return "NOT_LOADED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49108,7 +49244,7 @@ ExtensionLoadResult EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "NOT_LOADED")) { return ExtensionLoadResult::NOT_LOADED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49131,7 +49267,7 @@ const char* EnumUtil::ToChars(ExtensionUpdateResultTag case ExtensionUpdateResultTag::UPDATED: return "UPDATED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49161,7 +49297,7 @@ ExtensionUpdateResultTag EnumUtil::FromString(const ch if (StringUtil::Equals(value, "UPDATED")) { return ExtensionUpdateResultTag::UPDATED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49172,7 +49308,7 @@ const char* EnumUtil::ToChars(ExtraDropInfoType value) { case ExtraDropInfoType::SECRET_INFO: return "SECRET_INFO"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49184,7 +49320,7 @@ ExtraDropInfoType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SECRET_INFO")) { return ExtraDropInfoType::SECRET_INFO; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49215,7 +49351,7 @@ const char* EnumUtil::ToChars(ExtraTypeInfoType value) { case ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO: return "INTEGER_LITERAL_TYPE_INFO"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49257,7 +49393,7 @@ ExtraTypeInfoType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INTEGER_LITERAL_TYPE_INFO")) { return ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49270,7 +49406,7 @@ const char* EnumUtil::ToChars(FileBufferType value) { case FileBufferType::TINY_BUFFER: return "TINY_BUFFER"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49285,7 +49421,7 @@ FileBufferType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "TINY_BUFFER")) { return FileBufferType::TINY_BUFFER; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49300,7 +49436,7 @@ const char* EnumUtil::ToChars(FileCompressionType value) { case FileCompressionType::ZSTD: return "ZSTD"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49318,7 +49454,7 @@ FileCompressionType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "ZSTD")) { return FileCompressionType::ZSTD; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49331,7 +49467,7 @@ const char* EnumUtil::ToChars(FileExpandResult value) { case FileExpandResult::MULTIPLE_FILES: return "MULTIPLE_FILES"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49346,7 +49482,7 @@ FileExpandResult EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "MULTIPLE_FILES")) { return FileExpandResult::MULTIPLE_FILES; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49357,7 +49493,7 @@ const char* EnumUtil::ToChars(FileGlobOptions value) { case FileGlobOptions::ALLOW_EMPTY: return "ALLOW_EMPTY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49369,7 +49505,7 @@ FileGlobOptions EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ALLOW_EMPTY")) { return FileGlobOptions::ALLOW_EMPTY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49382,7 +49518,7 @@ const char* EnumUtil::ToChars(FileLockType value) { case FileLockType::WRITE_LOCK: return "WRITE_LOCK"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49397,7 +49533,7 @@ FileLockType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "WRITE_LOCK")) { return FileLockType::WRITE_LOCK; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49414,7 +49550,7 @@ const char* EnumUtil::ToChars(FilterPropagateResult value case FilterPropagateResult::FILTER_FALSE_OR_NULL: return "FILTER_FALSE_OR_NULL"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49435,7 +49571,7 @@ FilterPropagateResult EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "FILTER_FALSE_OR_NULL")) { return FilterPropagateResult::FILTER_FALSE_OR_NULL; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49448,7 +49584,7 @@ const char* EnumUtil::ToChars(ForeignKeyType value) { case ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE: return "FK_TYPE_SELF_REFERENCE_TABLE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49463,7 +49599,7 @@ ForeignKeyType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "FK_TYPE_SELF_REFERENCE_TABLE")) { return ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49474,7 +49610,7 @@ const char* EnumUtil::ToChars(FunctionNullHandling value) case FunctionNullHandling::SPECIAL_HANDLING: return "SPECIAL_HANDLING"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49486,7 +49622,7 @@ FunctionNullHandling EnumUtil::FromString(const char *valu if (StringUtil::Equals(value, "SPECIAL_HANDLING")) { return FunctionNullHandling::SPECIAL_HANDLING; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49499,7 +49635,7 @@ const char* EnumUtil::ToChars(FunctionStability value) { case FunctionStability::CONSISTENT_WITHIN_QUERY: return "CONSISTENT_WITHIN_QUERY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49514,7 +49650,7 @@ FunctionStability EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "CONSISTENT_WITHIN_QUERY")) { return FunctionStability::CONSISTENT_WITHIN_QUERY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49525,7 +49661,7 @@ const char* EnumUtil::ToChars(GateStatus value) { case GateStatus::GATE_SET: return "GATE_SET"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49537,7 +49673,7 @@ GateStatus EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "GATE_SET")) { return GateStatus::GATE_SET; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49548,7 +49684,7 @@ const char* EnumUtil::ToChars(HLLStorageType value) { case HLLStorageType::HLL_V2: return "HLL_V2"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49560,7 +49696,7 @@ HLLStorageType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "HLL_V2")) { return HLLStorageType::HLL_V2; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49575,7 +49711,7 @@ const char* EnumUtil::ToChars(IndexConstraintType value) { case IndexConstraintType::FOREIGN: return "FOREIGN"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49593,7 +49729,7 @@ IndexConstraintType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "FOREIGN")) { return IndexConstraintType::FOREIGN; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49604,7 +49740,7 @@ const char* EnumUtil::ToChars(InsertColumnOrder value) { case InsertColumnOrder::INSERT_BY_NAME: return "INSERT_BY_NAME"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49616,7 +49752,7 @@ InsertColumnOrder EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INSERT_BY_NAME")) { return InsertColumnOrder::INSERT_BY_NAME; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49629,7 +49765,7 @@ const char* EnumUtil::ToChars(InterruptMode value) { case InterruptMode::BLOCKING: return "BLOCKING"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49644,7 +49780,7 @@ InterruptMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BLOCKING")) { return InterruptMode::BLOCKING; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49663,7 +49799,7 @@ const char* EnumUtil::ToChars(JoinRefType value) { case JoinRefType::DEPENDENT: return "DEPENDENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49687,7 +49823,7 @@ JoinRefType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DEPENDENT")) { return JoinRefType::DEPENDENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49716,7 +49852,7 @@ const char* EnumUtil::ToChars(JoinType value) { case JoinType::RIGHT_ANTI: return "RIGHT_ANTI"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49755,7 +49891,7 @@ JoinType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "RIGHT_ANTI")) { return JoinType::RIGHT_ANTI; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49769,8 +49905,10 @@ const char* EnumUtil::ToChars(KeywordCategory value) { return "KEYWORD_TYPE_FUNC"; case KeywordCategory::KEYWORD_COL_NAME: return "KEYWORD_COL_NAME"; + case KeywordCategory::KEYWORD_NONE: + return "KEYWORD_NONE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49788,7 +49926,10 @@ KeywordCategory EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "KEYWORD_COL_NAME")) { return KeywordCategory::KEYWORD_COL_NAME; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + if (StringUtil::Equals(value, "KEYWORD_NONE")) { + return KeywordCategory::KEYWORD_NONE; + } + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49805,7 +49946,7 @@ const char* EnumUtil::ToChars(LimitNodeType value) { case LimitNodeType::EXPRESSION_PERCENTAGE: return "EXPRESSION_PERCENTAGE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49826,7 +49967,7 @@ LimitNodeType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "EXPRESSION_PERCENTAGE")) { return LimitNodeType::EXPRESSION_PERCENTAGE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49839,7 +49980,7 @@ const char* EnumUtil::ToChars(LoadType value) { case LoadType::FORCE_INSTALL: return "FORCE_INSTALL"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -49854,7 +49995,7 @@ LoadType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "FORCE_INSTALL")) { return LoadType::FORCE_INSTALL; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -49983,7 +50124,7 @@ const char* EnumUtil::ToChars(LogicalOperatorType value) { case LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR: return "LOGICAL_EXTENSION_OPERATOR"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50172,7 +50313,7 @@ LogicalOperatorType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "LOGICAL_EXTENSION_OPERATOR")) { return LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50273,7 +50414,7 @@ const char* EnumUtil::ToChars(LogicalTypeId value) { case LogicalTypeId::ARRAY: return "ARRAY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50420,7 +50561,7 @@ LogicalTypeId EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ARRAY")) { return LogicalTypeId::ARRAY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50433,7 +50574,7 @@ const char* EnumUtil::ToChars(LookupResultType value) { case LookupResultType::LOOKUP_NULL: return "LOOKUP_NULL"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50448,7 +50589,7 @@ LookupResultType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "LOOKUP_NULL")) { return LookupResultType::LOOKUP_NULL; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50461,7 +50602,7 @@ const char* EnumUtil::ToChars(MacroType value) { case MacroType::SCALAR_MACRO: return "SCALAR_MACRO"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50476,7 +50617,7 @@ MacroType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SCALAR_MACRO")) { return MacroType::SCALAR_MACRO; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50493,7 +50634,7 @@ const char* EnumUtil::ToChars(MapInvalidReason value) { case MapInvalidReason::INVALID_PARAMS: return "INVALID_PARAMS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50514,7 +50655,7 @@ MapInvalidReason EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID_PARAMS")) { return MapInvalidReason::INVALID_PARAMS; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50545,7 +50686,7 @@ const char* EnumUtil::ToChars(MemoryTag value) { case MemoryTag::EXTENSION: return "EXTENSION"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50587,7 +50728,7 @@ MemoryTag EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "EXTENSION")) { return MemoryTag::EXTENSION; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50598,7 +50739,7 @@ const char* EnumUtil::ToChars(MetaPipelineType value) { case MetaPipelineType::JOIN_BUILD: return "JOIN_BUILD"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50610,7 +50751,7 @@ MetaPipelineType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "JOIN_BUILD")) { return MetaPipelineType::JOIN_BUILD; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50701,7 +50842,7 @@ const char* EnumUtil::ToChars(MetricsType value) { case MetricsType::OPTIMIZER_MATERIALIZED_CTE: return "OPTIMIZER_MATERIALIZED_CTE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50833,7 +50974,7 @@ MetricsType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "OPTIMIZER_MATERIALIZED_CTE")) { return MetricsType::OPTIMIZER_MATERIALIZED_CTE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50860,7 +51001,7 @@ const char* EnumUtil::ToChars(NType value) { case NType::NODE_256_LEAF: return "NODE_256_LEAF"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50896,7 +51037,7 @@ NType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "NODE_256_LEAF")) { return NType::NODE_256_LEAF; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50911,7 +51052,7 @@ const char* EnumUtil::ToChars(NewLineIdentifier value) { case NewLineIdentifier::SINGLE_R: return "SINGLE_R"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50929,7 +51070,7 @@ NewLineIdentifier EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SINGLE_R")) { return NewLineIdentifier::SINGLE_R; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50944,7 +51085,7 @@ const char* EnumUtil::ToChars(OnConflictAction value) { case OnConflictAction::REPLACE: return "REPLACE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50962,7 +51103,7 @@ OnConflictAction EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "REPLACE")) { return OnConflictAction::REPLACE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -50977,7 +51118,7 @@ const char* EnumUtil::ToChars(OnCreateConflict value) { case OnCreateConflict::ALTER_ON_CONFLICT: return "ALTER_ON_CONFLICT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -50995,7 +51136,7 @@ OnCreateConflict EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ALTER_ON_CONFLICT")) { return OnCreateConflict::ALTER_ON_CONFLICT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51006,7 +51147,7 @@ const char* EnumUtil::ToChars(OnEntryNotFound value) { case OnEntryNotFound::RETURN_NULL: return "RETURN_NULL"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51018,7 +51159,7 @@ OnEntryNotFound EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "RETURN_NULL")) { return OnEntryNotFound::RETURN_NULL; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51029,7 +51170,7 @@ const char* EnumUtil::ToChars(OperatorFinalizeResult case OperatorFinalizeResultType::FINISHED: return "FINISHED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51041,7 +51182,7 @@ OperatorFinalizeResultType EnumUtil::FromString(cons if (StringUtil::Equals(value, "FINISHED")) { return OperatorFinalizeResultType::FINISHED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51056,7 +51197,7 @@ const char* EnumUtil::ToChars(OperatorResultType value) { case OperatorResultType::BLOCKED: return "BLOCKED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51074,7 +51215,7 @@ OperatorResultType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BLOCKED")) { return OperatorResultType::BLOCKED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51129,7 +51270,7 @@ const char* EnumUtil::ToChars(OptimizerType value) { case OptimizerType::MATERIALIZED_CTE: return "MATERIALIZED_CTE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51207,7 +51348,7 @@ OptimizerType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "MATERIALIZED_CTE")) { return OptimizerType::MATERIALIZED_CTE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51222,7 +51363,7 @@ const char* EnumUtil::ToChars(OrderByNullType value) { case OrderByNullType::NULLS_LAST: return "NULLS_LAST"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51240,7 +51381,7 @@ OrderByNullType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "NULLS_LAST") || StringUtil::Equals(value, "NULLS LAST")) { return OrderByNullType::NULLS_LAST; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51253,7 +51394,7 @@ const char* EnumUtil::ToChars(OrderPreservationType value case OrderPreservationType::FIXED_ORDER: return "FIXED_ORDER"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51268,7 +51409,7 @@ OrderPreservationType EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "FIXED_ORDER")) { return OrderPreservationType::FIXED_ORDER; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51283,7 +51424,7 @@ const char* EnumUtil::ToChars(OrderType value) { case OrderType::DESCENDING: return "DESCENDING"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51301,7 +51442,7 @@ OrderType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DESCENDING") || StringUtil::Equals(value, "DESC")) { return OrderType::DESCENDING; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51312,7 +51453,7 @@ const char* EnumUtil::ToChars(OutputStream value) { case OutputStream::STREAM_STDERR: return "STREAM_STDERR"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51324,7 +51465,7 @@ OutputStream EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "STREAM_STDERR")) { return OutputStream::STREAM_STDERR; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51365,7 +51506,7 @@ const char* EnumUtil::ToChars(ParseInfoType value) { case ParseInfoType::UPDATE_EXTENSIONS_INFO: return "UPDATE_EXTENSIONS_INFO"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51422,7 +51563,7 @@ ParseInfoType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "UPDATE_EXTENSIONS_INFO")) { return ParseInfoType::UPDATE_EXTENSIONS_INFO; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51435,7 +51576,7 @@ const char* EnumUtil::ToChars(ParserExtensionResultTy case ParserExtensionResultType::DISPLAY_EXTENSION_ERROR: return "DISPLAY_EXTENSION_ERROR"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51450,7 +51591,7 @@ ParserExtensionResultType EnumUtil::FromString(const if (StringUtil::Equals(value, "DISPLAY_EXTENSION_ERROR")) { return ParserExtensionResultType::DISPLAY_EXTENSION_ERROR; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51469,7 +51610,7 @@ const char* EnumUtil::ToChars(PartitionSortStage value) { case PartitionSortStage::FINISHED: return "FINISHED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51493,7 +51634,7 @@ PartitionSortStage EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "FINISHED")) { return PartitionSortStage::FINISHED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51506,7 +51647,7 @@ const char* EnumUtil::ToChars(PartitionedColumnDataTy case PartitionedColumnDataType::HIVE: return "HIVE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51521,7 +51662,7 @@ PartitionedColumnDataType EnumUtil::FromString(const if (StringUtil::Equals(value, "HIVE")) { return PartitionedColumnDataType::HIVE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51532,7 +51673,7 @@ const char* EnumUtil::ToChars(PartitionedTupleDataType case PartitionedTupleDataType::RADIX: return "RADIX"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51544,7 +51685,7 @@ PartitionedTupleDataType EnumUtil::FromString(const ch if (StringUtil::Equals(value, "RADIX")) { return PartitionedTupleDataType::RADIX; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51563,7 +51704,7 @@ const char* EnumUtil::ToChars(PendingExecutionResult val case PendingExecutionResult::EXECUTION_FINISHED: return "EXECUTION_FINISHED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51587,7 +51728,7 @@ PendingExecutionResult EnumUtil::FromString(const char * if (StringUtil::Equals(value, "EXECUTION_FINISHED")) { return PendingExecutionResult::EXECUTION_FINISHED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -51750,7 +51891,7 @@ const char* EnumUtil::ToChars(PhysicalOperatorType value) case PhysicalOperatorType::CREATE_SECRET: return "CREATE_SECRET"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -51990,7 +52131,7 @@ PhysicalOperatorType EnumUtil::FromString(const char *valu if (StringUtil::Equals(value, "CREATE_SECRET")) { return PhysicalOperatorType::CREATE_SECRET; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52039,7 +52180,7 @@ const char* EnumUtil::ToChars(PhysicalType value) { case PhysicalType::INVALID: return "INVALID"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52108,7 +52249,7 @@ PhysicalType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID")) { return PhysicalType::INVALID; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52119,7 +52260,7 @@ const char* EnumUtil::ToChars(PragmaType value) { case PragmaType::PRAGMA_CALL: return "PRAGMA_CALL"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52131,7 +52272,7 @@ PragmaType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PRAGMA_CALL")) { return PragmaType::PRAGMA_CALL; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52146,7 +52287,7 @@ const char* EnumUtil::ToChars(PreparedParamType value) { case PreparedParamType::INVALID: return "INVALID"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52164,7 +52305,7 @@ PreparedParamType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID")) { return PreparedParamType::INVALID; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52175,7 +52316,7 @@ const char* EnumUtil::ToChars(PreparedStatementMode value case PreparedStatementMode::PREPARE_AND_EXECUTE: return "PREPARE_AND_EXECUTE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52187,7 +52328,7 @@ PreparedStatementMode EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "PREPARE_AND_EXECUTE")) { return PreparedStatementMode::PREPARE_AND_EXECUTE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52202,7 +52343,7 @@ const char* EnumUtil::ToChars(ProfilerPrintFormat value) { case ProfilerPrintFormat::NO_OUTPUT: return "NO_OUTPUT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52220,7 +52361,7 @@ ProfilerPrintFormat EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "NO_OUTPUT")) { return ProfilerPrintFormat::NO_OUTPUT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52237,7 +52378,7 @@ const char* EnumUtil::ToChars(QuantileSerializationTy case QuantileSerializationType::DECIMAL_CONTINUOUS_LIST: return "DECIMAL_CONTINUOUS_LIST"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52258,7 +52399,7 @@ QuantileSerializationType EnumUtil::FromString(const if (StringUtil::Equals(value, "DECIMAL_CONTINUOUS_LIST")) { return QuantileSerializationType::DECIMAL_CONTINUOUS_LIST; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52275,7 +52416,7 @@ const char* EnumUtil::ToChars(QueryNodeType value) { case QueryNodeType::CTE_NODE: return "CTE_NODE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52296,7 +52437,7 @@ QueryNodeType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "CTE_NODE")) { return QueryNodeType::CTE_NODE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52311,7 +52452,7 @@ const char* EnumUtil::ToChars(QueryResultType value) { case QueryResultType::ARROW_RESULT: return "ARROW_RESULT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52329,7 +52470,7 @@ QueryResultType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ARROW_RESULT")) { return QueryResultType::ARROW_RESULT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52342,7 +52483,7 @@ const char* EnumUtil::ToChars(QuoteRule value) { case QuoteRule::NO_QUOTES: return "NO_QUOTES"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52357,7 +52498,7 @@ QuoteRule EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "NO_QUOTES")) { return QuoteRule::NO_QUOTES; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52420,7 +52561,7 @@ const char* EnumUtil::ToChars(RelationType value) { case RelationType::DELIM_GET_RELATION: return "DELIM_GET_RELATION"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52510,7 +52651,7 @@ RelationType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DELIM_GET_RELATION")) { return RelationType::DELIM_GET_RELATION; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52521,7 +52662,7 @@ const char* EnumUtil::ToChars(RenderMode value) { case RenderMode::COLUMNS: return "COLUMNS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52533,7 +52674,7 @@ RenderMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "COLUMNS")) { return RenderMode::COLUMNS; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52548,7 +52689,7 @@ const char* EnumUtil::ToChars(ResultModifierType value) { case ResultModifierType::LIMIT_PERCENT_MODIFIER: return "LIMIT_PERCENT_MODIFIER"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52566,7 +52707,7 @@ ResultModifierType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "LIMIT_PERCENT_MODIFIER")) { return ResultModifierType::LIMIT_PERCENT_MODIFIER; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52579,7 +52720,7 @@ const char* EnumUtil::ToChars(SampleMethod value) { case SampleMethod::RESERVOIR_SAMPLE: return "Reservoir"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52594,7 +52735,7 @@ SampleMethod EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "Reservoir")) { return SampleMethod::RESERVOIR_SAMPLE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52607,7 +52748,7 @@ const char* EnumUtil::ToChars(SampleType value) { case SampleType::RESERVOIR_PERCENTAGE_SAMPLE: return "RESERVOIR_PERCENTAGE_SAMPLE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52622,7 +52763,7 @@ SampleType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "RESERVOIR_PERCENTAGE_SAMPLE")) { return SampleType::RESERVOIR_PERCENTAGE_SAMPLE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52633,7 +52774,7 @@ const char* EnumUtil::ToChars(ScanType value) { case ScanType::PARQUET: return "PARQUET"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52645,7 +52786,7 @@ ScanType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PARQUET")) { return ScanType::PARQUET; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52656,7 +52797,7 @@ const char* EnumUtil::ToChars(SecretDisplayType value) { case SecretDisplayType::UNREDACTED: return "UNREDACTED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52668,7 +52809,7 @@ SecretDisplayType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "UNREDACTED")) { return SecretDisplayType::UNREDACTED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52681,7 +52822,7 @@ const char* EnumUtil::ToChars(SecretPersistType value) { case SecretPersistType::PERSISTENT: return "PERSISTENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52696,7 +52837,7 @@ SecretPersistType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PERSISTENT")) { return SecretPersistType::PERSISTENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52715,7 +52856,7 @@ const char* EnumUtil::ToChars(SequenceInfo value) { case SequenceInfo::SEQ_OWN: return "SEQ_OWN"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52739,7 +52880,7 @@ SequenceInfo EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SEQ_OWN")) { return SequenceInfo::SEQ_OWN; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52756,7 +52897,7 @@ const char* EnumUtil::ToChars(SetOperationType value) { case SetOperationType::UNION_BY_NAME: return "UNION_BY_NAME"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52777,7 +52918,7 @@ SetOperationType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "UNION_BY_NAME")) { return SetOperationType::UNION_BY_NAME; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52794,7 +52935,7 @@ const char* EnumUtil::ToChars(SetScope value) { case SetScope::VARIABLE: return "VARIABLE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52815,7 +52956,7 @@ SetScope EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "VARIABLE")) { return SetScope::VARIABLE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52826,7 +52967,7 @@ const char* EnumUtil::ToChars(SetType value) { case SetType::RESET: return "RESET"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52838,7 +52979,7 @@ SetType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "RESET")) { return SetType::RESET; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52853,7 +52994,7 @@ const char* EnumUtil::ToChars(SettingScope value) { case SettingScope::INVALID: return "INVALID"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52871,7 +53012,7 @@ SettingScope EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID")) { return SettingScope::INVALID; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52882,7 +53023,7 @@ const char* EnumUtil::ToChars(ShowType value) { case ShowType::DESCRIBE: return "DESCRIBE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52894,7 +53035,7 @@ ShowType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DESCRIBE")) { return ShowType::DESCRIBE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52913,7 +53054,7 @@ const char* EnumUtil::ToChars(SimplifiedTokenType value) { case SimplifiedTokenType::SIMPLIFIED_TOKEN_COMMENT: return "SIMPLIFIED_TOKEN_COMMENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52937,7 +53078,7 @@ SimplifiedTokenType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "SIMPLIFIED_TOKEN_COMMENT")) { return SimplifiedTokenType::SIMPLIFIED_TOKEN_COMMENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52948,7 +53089,7 @@ const char* EnumUtil::ToChars(SinkCombineResultType value case SinkCombineResultType::BLOCKED: return "BLOCKED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52960,7 +53101,7 @@ SinkCombineResultType EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "BLOCKED")) { return SinkCombineResultType::BLOCKED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52973,7 +53114,7 @@ const char* EnumUtil::ToChars(SinkFinalizeType value) { case SinkFinalizeType::BLOCKED: return "BLOCKED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -52988,7 +53129,7 @@ SinkFinalizeType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BLOCKED")) { return SinkFinalizeType::BLOCKED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -52999,7 +53140,7 @@ const char* EnumUtil::ToChars(SinkNextBatchType value) { case SinkNextBatchType::BLOCKED: return "BLOCKED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53011,7 +53152,7 @@ SinkNextBatchType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BLOCKED")) { return SinkNextBatchType::BLOCKED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53024,7 +53165,7 @@ const char* EnumUtil::ToChars(SinkResultType value) { case SinkResultType::BLOCKED: return "BLOCKED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53039,7 +53180,7 @@ SinkResultType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BLOCKED")) { return SinkResultType::BLOCKED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53052,7 +53193,7 @@ const char* EnumUtil::ToChars(SourceResultType value) { case SourceResultType::BLOCKED: return "BLOCKED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53067,7 +53208,7 @@ SourceResultType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "BLOCKED")) { return SourceResultType::BLOCKED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53080,7 +53221,7 @@ const char* EnumUtil::ToChars(StatementReturnType value) { case StatementReturnType::NOTHING: return "NOTHING"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53095,7 +53236,7 @@ StatementReturnType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "NOTHING")) { return StatementReturnType::NOTHING; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53162,7 +53303,7 @@ const char* EnumUtil::ToChars(StatementType value) { case StatementType::UPDATE_EXTENSIONS_STATEMENT: return "UPDATE_EXTENSIONS_STATEMENT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53258,7 +53399,7 @@ StatementType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "UPDATE_EXTENSIONS_STATEMENT")) { return StatementType::UPDATE_EXTENSIONS_STATEMENT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53277,7 +53418,7 @@ const char* EnumUtil::ToChars(StatisticsType value) { case StatisticsType::ARRAY_STATS: return "ARRAY_STATS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53301,7 +53442,7 @@ StatisticsType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ARRAY_STATS")) { return StatisticsType::ARRAY_STATS; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53318,7 +53459,7 @@ const char* EnumUtil::ToChars(StatsInfo value) { case StatsInfo::CAN_HAVE_NULL_AND_VALID_VALUES: return "CAN_HAVE_NULL_AND_VALID_VALUES"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53339,7 +53480,7 @@ StatsInfo EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "CAN_HAVE_NULL_AND_VALID_VALUES")) { return StatsInfo::CAN_HAVE_NULL_AND_VALID_VALUES; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53418,7 +53559,7 @@ const char* EnumUtil::ToChars(StrTimeSpecifier value) { case StrTimeSpecifier::WEEK_NUMBER_ISO: return "WEEK_NUMBER_ISO"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53532,7 +53673,7 @@ StrTimeSpecifier EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "WEEK_NUMBER_ISO")) { return StrTimeSpecifier::WEEK_NUMBER_ISO; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53553,7 +53694,7 @@ const char* EnumUtil::ToChars(StreamExecutionResult value case StreamExecutionResult::EXECUTION_FINISHED: return "EXECUTION_FINISHED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53580,7 +53721,7 @@ StreamExecutionResult EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "EXECUTION_FINISHED")) { return StreamExecutionResult::EXECUTION_FINISHED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53597,7 +53738,7 @@ const char* EnumUtil::ToChars(SubqueryType value) { case SubqueryType::ANY: return "ANY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53618,7 +53759,7 @@ SubqueryType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ANY")) { return SubqueryType::ANY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53629,7 +53770,7 @@ const char* EnumUtil::ToChars(TableColumnType value) { case TableColumnType::GENERATED: return "GENERATED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53641,7 +53782,7 @@ TableColumnType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "GENERATED")) { return TableColumnType::GENERATED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53660,7 +53801,7 @@ const char* EnumUtil::ToChars(TableFilterType value) { case TableFilterType::STRUCT_EXTRACT: return "STRUCT_EXTRACT"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53684,7 +53825,7 @@ TableFilterType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "STRUCT_EXTRACT")) { return TableFilterType::STRUCT_EXTRACT; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53715,7 +53856,7 @@ const char* EnumUtil::ToChars(TableReferenceType value) { case TableReferenceType::DELIM_GET: return "DELIM_GET"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53757,7 +53898,7 @@ TableReferenceType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "DELIM_GET")) { return TableReferenceType::DELIM_GET; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53774,7 +53915,7 @@ const char* EnumUtil::ToChars(TableScanType value) { case TableScanType::TABLE_SCAN_LATEST_COMMITTED_ROWS: return "TABLE_SCAN_LATEST_COMMITTED_ROWS"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53795,7 +53936,7 @@ TableScanType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "TABLE_SCAN_LATEST_COMMITTED_ROWS")) { return TableScanType::TABLE_SCAN_LATEST_COMMITTED_ROWS; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53806,7 +53947,7 @@ const char* EnumUtil::ToChars(TaskExecutionMode value) { case TaskExecutionMode::PROCESS_PARTIAL: return "PROCESS_PARTIAL"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53818,7 +53959,7 @@ TaskExecutionMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "PROCESS_PARTIAL")) { return TaskExecutionMode::PROCESS_PARTIAL; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53833,7 +53974,7 @@ const char* EnumUtil::ToChars(TaskExecutionResult value) { case TaskExecutionResult::TASK_BLOCKED: return "TASK_BLOCKED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53851,7 +53992,7 @@ TaskExecutionResult EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "TASK_BLOCKED")) { return TaskExecutionResult::TASK_BLOCKED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53864,7 +54005,7 @@ const char* EnumUtil::ToChars(TimestampCastResult value) { case TimestampCastResult::ERROR_NON_UTC_TIMEZONE: return "ERROR_NON_UTC_TIMEZONE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53879,7 +54020,7 @@ TimestampCastResult EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "ERROR_NON_UTC_TIMEZONE")) { return TimestampCastResult::ERROR_NON_UTC_TIMEZONE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53892,7 +54033,7 @@ const char* EnumUtil::ToChars(TransactionModifierType v case TransactionModifierType::TRANSACTION_READ_WRITE: return "TRANSACTION_READ_WRITE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53907,7 +54048,7 @@ TransactionModifierType EnumUtil::FromString(const char if (StringUtil::Equals(value, "TRANSACTION_READ_WRITE")) { return TransactionModifierType::TRANSACTION_READ_WRITE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53922,7 +54063,7 @@ const char* EnumUtil::ToChars(TransactionType value) { case TransactionType::ROLLBACK: return "ROLLBACK"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53940,7 +54081,7 @@ TransactionType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ROLLBACK")) { return TransactionType::ROLLBACK; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53957,7 +54098,7 @@ const char* EnumUtil::ToChars(TupleDataPinProperties val case TupleDataPinProperties::ALREADY_PINNED: return "ALREADY_PINNED"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -53978,7 +54119,7 @@ TupleDataPinProperties EnumUtil::FromString(const char * if (StringUtil::Equals(value, "ALREADY_PINNED")) { return TupleDataPinProperties::ALREADY_PINNED; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -53997,7 +54138,7 @@ const char* EnumUtil::ToChars(UndoFlags value) { case UndoFlags::SEQUENCE_VALUE: return "SEQUENCE_VALUE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54021,7 +54162,7 @@ UndoFlags EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SEQUENCE_VALUE")) { return UndoFlags::SEQUENCE_VALUE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54040,7 +54181,7 @@ const char* EnumUtil::ToChars(UnionInvalidReason value) { case UnionInvalidReason::NULL_TAG: return "NULL_TAG"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54064,7 +54205,7 @@ UnionInvalidReason EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "NULL_TAG")) { return UnionInvalidReason::NULL_TAG; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54073,7 +54214,7 @@ const char* EnumUtil::ToChars(VectorAuxiliaryDataType v case VectorAuxiliaryDataType::ARROW_AUXILIARY: return "ARROW_AUXILIARY"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54082,7 +54223,7 @@ VectorAuxiliaryDataType EnumUtil::FromString(const char if (StringUtil::Equals(value, "ARROW_AUXILIARY")) { return VectorAuxiliaryDataType::ARROW_AUXILIARY; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54109,7 +54250,7 @@ const char* EnumUtil::ToChars(VectorBufferType value) { case VectorBufferType::ARRAY_BUFFER: return "ARRAY_BUFFER"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54145,7 +54286,7 @@ VectorBufferType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "ARRAY_BUFFER")) { return VectorBufferType::ARRAY_BUFFER; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54162,7 +54303,7 @@ const char* EnumUtil::ToChars(VectorType value) { case VectorType::SEQUENCE_VECTOR: return "SEQUENCE_VECTOR"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54183,7 +54324,7 @@ VectorType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SEQUENCE_VECTOR")) { return VectorType::SEQUENCE_VECTOR; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54210,7 +54351,7 @@ const char* EnumUtil::ToChars(VerificationType value) { case VerificationType::INVALID: return "INVALID"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54246,7 +54387,7 @@ VerificationType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "INVALID")) { return VerificationType::INVALID; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54259,7 +54400,7 @@ const char* EnumUtil::ToChars(VerifyExistenceType value) { case VerifyExistenceType::DELETE_FK: return "DELETE_FK"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54274,7 +54415,7 @@ VerifyExistenceType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "DELETE_FK")) { return VerifyExistenceType::DELETE_FK; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54335,7 +54476,7 @@ const char* EnumUtil::ToChars(WALType value) { case WALType::WAL_FLUSH: return "WAL_FLUSH"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54422,7 +54563,7 @@ WALType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "WAL_FLUSH")) { return WALType::WAL_FLUSH; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54435,7 +54576,7 @@ const char* EnumUtil::ToChars(WindowAggregationMode value case WindowAggregationMode::SEPARATE: return "SEPARATE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54450,7 +54591,7 @@ WindowAggregationMode EnumUtil::FromString(const char *va if (StringUtil::Equals(value, "SEPARATE")) { return WindowAggregationMode::SEPARATE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54475,7 +54616,7 @@ const char* EnumUtil::ToChars(WindowBoundary value) { case WindowBoundary::EXPR_FOLLOWING_RANGE: return "EXPR_FOLLOWING_RANGE"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54508,7 +54649,7 @@ WindowBoundary EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "EXPR_FOLLOWING_RANGE")) { return WindowBoundary::EXPR_FOLLOWING_RANGE; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } template<> @@ -54523,7 +54664,7 @@ const char* EnumUtil::ToChars(WindowExcludeMode value) { case WindowExcludeMode::TIES: return "TIES"; default: - throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented in ToChars", value)); } } @@ -54541,7 +54682,7 @@ WindowExcludeMode EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "TIES")) { return WindowExcludeMode::TIES; } - throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented in FromString", value)); } } @@ -62741,7 +62882,11 @@ class HTTPUtil { namespace duckdb { void HTTPUtil::ParseHTTPProxyHost(string &proxy_value, string &hostname_out, idx_t &port_out, idx_t default_port) { - auto proxy_split = StringUtil::Split(proxy_value, ":"); + auto sanitized_proxy_value = proxy_value; + if (StringUtil::StartsWith(proxy_value, "http://")) { + sanitized_proxy_value = proxy_value.substr(7); + } + auto proxy_split = StringUtil::Split(sanitized_proxy_value, ":"); if (proxy_split.size() == 1) { hostname_out = proxy_split[0]; port_out = default_port; @@ -69790,68 +69935,12 @@ bool TryCast::Operation(double input, double &result, bool strict) { //===--------------------------------------------------------------------===// // Cast String -> Numeric //===--------------------------------------------------------------------===// + template <> bool TryCast::Operation(string_t input, bool &result, bool strict) { - auto input_data = reinterpret_cast(input.GetData()); + auto input_data = reinterpret_cast(input.GetData()); auto input_size = input.GetSize(); - - switch (input_size) { - case 1: { - unsigned char c = UnsafeNumericCast(std::tolower(*input_data)); - if (c == 't' || (!strict && c == 'y') || (!strict && c == '1')) { - result = true; - return true; - } else if (c == 'f' || (!strict && c == 'n') || (!strict && c == '0')) { - result = false; - return true; - } - return false; - } - case 2: { - unsigned char n = UnsafeNumericCast(std::tolower(input_data[0])); - unsigned char o = UnsafeNumericCast(std::tolower(input_data[1])); - if (n == 'n' && o == 'o') { - result = false; - return true; - } - return false; - } - case 3: { - unsigned char y = UnsafeNumericCast(std::tolower(input_data[0])); - unsigned char e = UnsafeNumericCast(std::tolower(input_data[1])); - unsigned char s = UnsafeNumericCast(std::tolower(input_data[2])); - if (y == 'y' && e == 'e' && s == 's') { - result = true; - return true; - } - return false; - } - case 4: { - unsigned char t = UnsafeNumericCast(std::tolower(input_data[0])); - unsigned char r = UnsafeNumericCast(std::tolower(input_data[1])); - unsigned char u = UnsafeNumericCast(std::tolower(input_data[2])); - unsigned char e = UnsafeNumericCast(std::tolower(input_data[3])); - if (t == 't' && r == 'r' && u == 'u' && e == 'e') { - result = true; - return true; - } - return false; - } - case 5: { - unsigned char f = UnsafeNumericCast(std::tolower(input_data[0])); - unsigned char a = UnsafeNumericCast(std::tolower(input_data[1])); - unsigned char l = UnsafeNumericCast(std::tolower(input_data[2])); - unsigned char s = UnsafeNumericCast(std::tolower(input_data[3])); - unsigned char e = UnsafeNumericCast(std::tolower(input_data[4])); - if (f == 'f' && a == 'a' && l == 'l' && s == 's' && e == 'e') { - result = false; - return true; - } - return false; - } - default: - return false; - } + return TryCastStringBool(input_data, input_size, result, strict); } template <> bool TryCast::Operation(string_t input, int8_t &result, bool strict) { @@ -71168,7 +71257,9 @@ bool TryCastToDecimal::Operation(uhugeint_t input, hugeint_t &result, CastParame template bool DoubleToDecimalCast(SRC input, DST &result, CastParameters ¶meters, uint8_t width, uint8_t scale) { double value = input * NumericHelper::DOUBLE_POWERS_OF_TEN[scale]; - if (value <= -NumericHelper::DOUBLE_POWERS_OF_TEN[width] || value >= NumericHelper::DOUBLE_POWERS_OF_TEN[width]) { + double roundedValue = round(value); + if (roundedValue <= -NumericHelper::DOUBLE_POWERS_OF_TEN[width] || + roundedValue >= NumericHelper::DOUBLE_POWERS_OF_TEN[width]) { string error = StringUtil::Format("Could not cast value %f to DECIMAL(%d,%d)", value, width, scale); HandleCastError::AssignError(error, parameters); return false; @@ -85506,7 +85597,7 @@ class BufferPool { friend class StandardBufferManager; public: - explicit BufferPool(idx_t maximum_memory, bool track_eviction_timestamps); + BufferPool(idx_t maximum_memory, bool track_eviction_timestamps, idx_t allocator_bulk_deallocation_flush_threshold); virtual ~BufferPool(); //! Set a new memory limit to the buffer pool, throws an exception if the new limit is too low and not enough @@ -85515,6 +85606,7 @@ class BufferPool { //! If bulk deallocation larger than this occurs, flush outstanding allocations void SetAllocatorBulkDeallocationFlushThreshold(idx_t threshold); + idx_t GetAllocatorBulkDeallocationFlushThreshold(); void UpdateUsedMemory(MemoryTag tag, int64_t size); @@ -97911,7 +98003,7 @@ void Bit::BitToBlob(string_t bit, string_t &output_blob) { idx_t size = output_blob.GetSize(); output[0] = UnsafeNumericCast(GetFirstByte(bit)); - if (size > 2) { + if (size >= 2) { ++output; // First byte in bitstring contains amount of padded bits, // second byte in bitstring is the padded byte, @@ -98740,6 +98832,7 @@ void DecimalToString::FormatDecimal(hugeint_t value, uint8_t width, uint8_t scal + namespace duckdb { ColumnDataAllocator::ColumnDataAllocator(Allocator &allocator) : type(ColumnDataAllocatorType::IN_MEMORY_ALLOCATOR) { @@ -98781,6 +98874,21 @@ ColumnDataAllocator::ColumnDataAllocator(ColumnDataAllocator &other) { } } +ColumnDataAllocator::~ColumnDataAllocator() { + if (type == ColumnDataAllocatorType::IN_MEMORY_ALLOCATOR) { + return; + } + for (auto &block : blocks) { + block.handle->SetDestroyBufferUpon(DestroyBufferUpon::UNPIN); + } + const auto data_size = SizeInBytes(); + blocks.clear(); + if (Allocator::SupportsFlush() && + data_size > alloc.buffer_manager->GetBufferPool().GetAllocatorBulkDeallocationFlushThreshold()) { + Allocator::FlushAll(); + } +} + BufferHandle ColumnDataAllocator::Pin(uint32_t block_id) { D_ASSERT(type == ColumnDataAllocatorType::BUFFER_MANAGER_ALLOCATOR || type == ColumnDataAllocatorType::HYBRID); shared_ptr handle; @@ -98801,7 +98909,8 @@ BufferHandle ColumnDataAllocator::AllocateBlock(idx_t size) { BlockMetaData data; data.size = 0; data.capacity = NumericCast(max_size); - auto pin = alloc.buffer_manager->Allocate(MemoryTag::COLUMN_DATA, max_size, false, &data.handle); + auto pin = alloc.buffer_manager->Allocate(MemoryTag::COLUMN_DATA, max_size, false); + data.handle = pin.GetBlockHandle(); blocks.push_back(std::move(data)); allocated_size += max_size; return pin; @@ -105899,7 +106008,8 @@ namespace duckdb { using ValidityBytes = TupleDataLayout::ValidityBytes; TupleDataBlock::TupleDataBlock(BufferManager &buffer_manager, idx_t capacity_p) : capacity(capacity_p), size(0) { - buffer_manager.Allocate(MemoryTag::HASH_TABLE, capacity, false, &handle); + auto buffer_handle = buffer_manager.Allocate(MemoryTag::HASH_TABLE, capacity, false); + handle = buffer_handle.GetBlockHandle(); } TupleDataBlock::TupleDataBlock(TupleDataBlock &&other) noexcept : capacity(0), size(0) { @@ -108908,6 +109018,7 @@ TupleDataGatherFunction TupleDataCollection::GetGatherFunction(const LogicalType + namespace duckdb { TupleDataChunkPart::TupleDataChunkPart(mutex &lock_p) : lock(lock_p) { @@ -109024,6 +109135,10 @@ TupleDataSegment::~TupleDataSegment() { } pinned_row_handles.clear(); pinned_heap_handles.clear(); + if (Allocator::SupportsFlush() && allocator && + data_size > allocator->GetBufferManager().GetBufferPool().GetAllocatorBulkDeallocationFlushThreshold()) { + Allocator::FlushAll(); + } allocator.reset(); } @@ -123605,6 +123720,13 @@ struct CreateSortKeyHelpers { + + + + + + + namespace duckdb { // For basic types @@ -123896,11 +124018,8 @@ struct MinMaxFallbackValue { static void PrepareData(Vector &input, const idx_t count, EXTRA_STATE &extra_state, UnifiedVectorFormat &format) { const OrderModifiers modifiers(OrderType::ASCENDING, OrderByNullType::NULLS_LAST); - CreateSortKeyHelpers::CreateSortKey(input, count, modifiers, extra_state); + CreateSortKeyHelpers::CreateSortKeyWithValidity(input, extra_state, modifiers, count); input.Flatten(count); - extra_state.Flatten(count); - // Ensure the validity vectors match, because we want to ignore nulls - FlatVector::Validity(extra_state).Initialize(FlatVector::Validity(input)); extra_state.ToUnifiedFormat(count, format); } }; @@ -124180,7 +124299,7 @@ struct GenericArgMinMaxState { static void PrepareData(Vector &by, idx_t count, Vector &extra_state, UnifiedVectorFormat &result) { OrderModifiers modifiers(ORDER_TYPE, OrderByNullType::NULLS_LAST); - CreateSortKeyHelpers::CreateSortKey(by, count, modifiers, extra_state); + CreateSortKeyHelpers::CreateSortKeyWithValidity(by, extra_state, modifiers, count); extra_state.ToUnifiedFormat(count, result); } }; @@ -125627,6 +125746,7 @@ AggregateFunction KurtosisPopFun::GetFunction() { + //===----------------------------------------------------------------------===// // DuckDB // @@ -126100,7 +126220,7 @@ unique_ptr BindMinMax(ClientContext &context, AggregateFunction &f vector> &arguments) { if (arguments[0]->return_type.id() == LogicalTypeId::VARCHAR) { auto str_collation = StringType::GetCollation(arguments[0]->return_type); - if (!str_collation.empty()) { + if (!str_collation.empty() || !DBConfig::GetConfig(context).options.collation.empty()) { // If aggr function is min/max and uses collations, replace bound_function with arg_min/arg_max // to make sure the result's correctness. string function_name = function.name == "min" ? "arg_min" : "arg_max"; @@ -165613,11 +165733,7 @@ bool Iterator::Next() { } void Iterator::PopNode() { - // We are popping a gate node. - if (nodes.top().node.GetGateStatus() == GateStatus::GATE_SET) { - D_ASSERT(status == GateStatus::GATE_SET); - status = GateStatus::GATE_NOT_SET; - } + auto gate_status = nodes.top().node.GetGateStatus(); // Pop the byte and the node. if (nodes.top().node.GetType() != NType::PREFIX) { @@ -165626,19 +165742,25 @@ void Iterator::PopNode() { nested_depth--; D_ASSERT(nested_depth < Prefix::ROW_ID_SIZE); } - nodes.pop(); - return; - } - // Pop all prefix bytes and the node. - Prefix prefix(art, nodes.top().node); - auto prefix_byte_count = prefix.data[Prefix::Count(art)]; - current_key.Pop(prefix_byte_count); - if (status == GateStatus::GATE_SET) { - nested_depth -= prefix_byte_count; - D_ASSERT(nested_depth < Prefix::ROW_ID_SIZE); + } else { + // Pop all prefix bytes and the node. + Prefix prefix(art, nodes.top().node); + auto prefix_byte_count = prefix.data[Prefix::Count(art)]; + current_key.Pop(prefix_byte_count); + + if (status == GateStatus::GATE_SET) { + nested_depth -= prefix_byte_count; + D_ASSERT(nested_depth < Prefix::ROW_ID_SIZE); + } } nodes.pop(); + + // We are popping a gate node. + if (gate_status == GateStatus::GATE_SET) { + D_ASSERT(status == GateStatus::GATE_SET); + status = GateStatus::GATE_NOT_SET; + } } } // namespace duckdb @@ -167330,42 +167452,15 @@ void Prefix::TransformToDeprecated(ART &art, Node &node, unsafe_unique_ptr ref(node); - while (ref.get().GetType() == PREFIX && ref.get().GetGateStatus() == GateStatus::GATE_NOT_SET) { - Prefix prefix(art, ref, true, true); - if (!prefix.in_memory) { - return; - } - - Node new_node; - new_node = allocator->New(); - new_node.SetMetadata(static_cast(PREFIX)); - - Prefix new_prefix(allocator, new_node, DEPRECATED_COUNT); - new_prefix.data[DEPRECATED_COUNT] = prefix.data[Count(art)]; - memcpy(new_prefix.data, prefix.data, new_prefix.data[DEPRECATED_COUNT]); - *new_prefix.ptr = *prefix.ptr; - - prefix.ptr->Clear(); - Node::Free(art, ref); - ref.get() = new_node; - ref = *new_prefix.ptr; - } - - return Node::TransformToDeprecated(art, ref, allocator); - } - - // Else, we need to create a new prefix chain. + // We need to create a new prefix (chain). Node new_node; new_node = allocator->New(); new_node.SetMetadata(static_cast(PREFIX)); Prefix new_prefix(allocator, new_node, DEPRECATED_COUNT); - reference ref(node); - while (ref.get().GetType() == PREFIX && ref.get().GetGateStatus() == GateStatus::GATE_NOT_SET) { - Prefix prefix(art, ref, true, true); + Node current_node = node; + while (current_node.GetType() == PREFIX && current_node.GetGateStatus() == GateStatus::GATE_NOT_SET) { + Prefix prefix(art, current_node, true, true); if (!prefix.in_memory) { return; } @@ -167375,11 +167470,13 @@ void Prefix::TransformToDeprecated(ART &art, Node &node, unsafe_unique_ptrClear(); + Node::Free(art, current_node); + current_node = *new_prefix.ptr; } - return Node::TransformToDeprecated(art, ref, allocator); + node = new_node; + return Node::TransformToDeprecated(art, *new_prefix.ptr, allocator); } Prefix Prefix::Append(ART &art, const uint8_t byte) { @@ -168003,7 +168100,8 @@ FixedSizeBuffer::FixedSizeBuffer(BlockManager &block_manager) block_handle(nullptr) { auto &buffer_manager = block_manager.buffer_manager; - buffer_handle = buffer_manager.Allocate(MemoryTag::ART_INDEX, block_manager.GetBlockSize(), false, &block_handle); + buffer_handle = buffer_manager.Allocate(MemoryTag::ART_INDEX, block_manager.GetBlockSize(), false); + block_handle = buffer_handle.GetBlockHandle(); } FixedSizeBuffer::FixedSizeBuffer(BlockManager &block_manager, const idx_t segment_count, const idx_t allocation_size, @@ -168100,8 +168198,8 @@ void FixedSizeBuffer::Pin() { // Copy the (partial) data into a new (not yet disk-backed) buffer handle. shared_ptr new_block_handle; - auto new_buffer_handle = - buffer_manager.Allocate(MemoryTag::ART_INDEX, block_manager.GetBlockSize(), false, &new_block_handle); + auto new_buffer_handle = buffer_manager.Allocate(MemoryTag::ART_INDEX, block_manager.GetBlockSize(), false); + new_block_handle = new_buffer_handle.GetBlockHandle(); memcpy(new_buffer_handle.Ptr(), buffer_handle.Ptr() + block_pointer.offset, allocation_size); buffer_handle = std::move(new_buffer_handle); @@ -173661,6 +173759,7 @@ void LocalUngroupedAggregateState::Sink(DataChunk &payload_chunk, idx_t payload_ #endif auto &aggregate = state.aggregate_expressions[aggr_idx]->Cast(); idx_t payload_cnt = aggregate.children.size(); + D_ASSERT(payload_idx + payload_cnt <= payload_chunk.data.size()); auto start_of_input = payload_cnt == 0 ? nullptr : &payload_chunk.data[payload_idx]; AggregateInputData aggr_input_data(state.bind_data[aggr_idx], allocator); aggregate.function.simple_update(start_of_input, aggr_input_data, payload_cnt, state.aggregate_data[aggr_idx].get(), @@ -175581,7 +175680,8 @@ void CSVBuffer::AllocateBuffer(idx_t buffer_size) { auto &buffer_manager = BufferManager::GetBufferManager(context); bool can_destroy = !is_pipe; handle = buffer_manager.Allocate(MemoryTag::CSV_READER, MaxValue(buffer_manager.GetBlockSize(), buffer_size), - can_destroy, &block); + can_destroy); + block = handle.GetBlockHandle(); } idx_t CSVBuffer::GetBufferSize() { @@ -176707,7 +176807,7 @@ class BaseScanner { virtual ~BaseScanner() = default; //! Returns true if the scanner is finished - bool FinishedFile(); + bool FinishedFile() const; //! Parses data into a output_chunk virtual ScannerResult &ParseChunk(); @@ -176731,7 +176831,7 @@ class BaseScanner { return iterator.pos; } - CSVStateMachine &GetStateMachine(); + CSVStateMachine &GetStateMachine() const; shared_ptr csv_file_scan; @@ -176947,6 +177047,9 @@ class BaseScanner { //! Internal function for parse chunk template void ParseChunkInternal(T &result) { + if (iterator.done) { + return; + } if (!initialized) { Initialize(); initialized = true; @@ -177345,7 +177448,8 @@ class ColumnCountResult : public ScannerResult { bool error = false; idx_t result_position = 0; bool cur_line_starts_as_comment = false; - + //! How many rows fit a given column count + map rows_per_column_count; //! Adds a Value to the result static inline void AddValue(ColumnCountResult &result, idx_t buffer_pos); //! Adds a Row to the result @@ -177361,6 +177465,9 @@ class ColumnCountResult : public ScannerResult { static inline void SetComment(ColumnCountResult &result, idx_t buffer_pos); + //! Returns the column count + idx_t GetMostFrequentColumnCount() const; + inline void InternalAddRow(); }; @@ -177434,7 +177541,7 @@ struct DialectCandidates { //! Candidates for the comment vector comment_candidates; //! Quote-Rule Candidates - vector quoterule_candidates; + vector quote_rule_candidates; //! Candidates for the quote option unordered_map> quote_candidates_map; //! Candidates for the escape option @@ -177559,7 +177666,7 @@ class CSVSniffer { void RefineCandidates(); //! Checks if candidate still produces good values for the next chunk - bool RefineCandidateNextChunk(ColumnCountScanner &candidate); + bool RefineCandidateNextChunk(ColumnCountScanner &candidate) const; //! ------------------------------------------------------// //! ------------------- Type Detection ------------------ // @@ -177576,7 +177683,7 @@ class CSVSniffer { void InitializeDateAndTimeStampDetection(CSVStateMachine &candidate, const string &separator, const LogicalType &sql_type); //! Sets user defined date and time formats (if any) - void SetUserDefinedDateTimeFormat(CSVStateMachine &candidate); + void SetUserDefinedDateTimeFormat(CSVStateMachine &candidate) const; //! Functions that performs detection for date and timestamp formats void DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const LogicalType &sql_type, const string &separator, const string_t &dummy_val); @@ -177613,10 +177720,10 @@ class CSVSniffer { //! ------------------------------------------------------// void DetectHeader(); static bool DetectHeaderWithSetColumn(ClientContext &context, vector &best_header_row, - SetColumns &set_columns, CSVReaderOptions &options); + const SetColumns &set_columns, CSVReaderOptions &options); static vector DetectHeaderInternal(ClientContext &context, vector &best_header_row, CSVStateMachine &state_machine, - SetColumns &set_columns, + const SetColumns &set_columns, unordered_map> &best_sql_types_candidates_per_column_idx, CSVReaderOptions &options, CSVErrorHandler &error_handler); vector names; @@ -177714,7 +177821,7 @@ BaseScanner::BaseScanner(shared_ptr buffer_manager_p, shared_p } } -bool BaseScanner::FinishedFile() { +bool BaseScanner::FinishedFile() const { if (!cur_buffer_handle) { return true; } @@ -177765,7 +177872,7 @@ void BaseScanner::FinalizeChunkProcess() { throw InternalException("FinalizeChunkProcess() from CSV Base Scanner is not implemented"); } -CSVStateMachine &BaseScanner::GetStateMachine() { +CSVStateMachine &BaseScanner::GetStateMachine() const { return *state_machine; } @@ -177784,10 +177891,32 @@ void ColumnCountResult::AddValue(ColumnCountResult &result, idx_t buffer_pos) { } inline void ColumnCountResult::InternalAddRow() { - column_counts[result_position].number_of_columns = current_column_count + 1; + const idx_t column_count = current_column_count + 1; + column_counts[result_position].number_of_columns = column_count; + rows_per_column_count[column_count]++; current_column_count = 0; } +idx_t ColumnCountResult::GetMostFrequentColumnCount() const { + if (rows_per_column_count.empty()) { + return 1; + } + idx_t column_count = 0; + idx_t current_max = 0; + for (auto &rpc : rows_per_column_count) { + if (rpc.second > current_max) { + current_max = rpc.second; + column_count = rpc.first; + } else if (rpc.second == current_max) { + // We pick the largest to untie + if (rpc.first > column_count) { + column_count = rpc.first; + } + } + } + return column_count; +} + bool ColumnCountResult::AddRow(ColumnCountResult &result, idx_t buffer_pos) { result.InternalAddRow(); if (!result.states.EmptyLastValue()) { @@ -178395,6 +178524,11 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m current_errors(state_machine.options.IgnoreErrors()), sniffing(sniffing_p), path(std::move(path_p)) { // Vector information D_ASSERT(number_of_columns > 0); + if (!buffer_handle) { + // It Was Over Before It Even Began + D_ASSERT(iterator.done); + return; + } buffer_handles[buffer_handle->buffer_idx] = buffer_handle; // Buffer Information buffer_ptr = buffer_handle->Ptr(); @@ -178631,6 +178765,10 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size } bool success = true; switch (parse_types[chunk_col_id].type_id) { + case LogicalTypeId::BOOLEAN: + success = + TryCastStringBool(value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows], false); + break; case LogicalTypeId::TINYINT: success = TrySimpleIntegerCast(value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows], false); @@ -179011,9 +179149,15 @@ bool LineError::HandleErrors(StringValueResult &result) { result.error_handler.Error(csv_error); } if (is_error_in_line) { - result.borked_rows.insert(result.number_of_rows); - result.cur_col_id = 0; - result.chunk_col_id = 0; + if (result.sniffing) { + // If we are sniffing we just remove the line + result.RemoveLastLine(); + } else { + // Otherwise, we add it to the borked rows to remove it later and just cleanup the column variables. + result.borked_rows.insert(result.number_of_rows); + result.cur_col_id = 0; + result.chunk_col_id = 0; + } Reset(); return true; } @@ -179804,6 +179948,7 @@ bool StringValueScanner::CanDirectlyCast(const LogicalType &type, bool icu_loade case LogicalTypeId::TIME: case LogicalTypeId::DECIMAL: case LogicalType::VARCHAR: + case LogicalType::BOOLEAN: return true; case LogicalType::TIMESTAMP_TZ: // We only try to do direct cast of timestamp tz if the ICU extension is not loaded, otherwise, it needs to go @@ -179860,7 +180005,7 @@ void StringValueScanner::SetStart() { } if (iterator.pos.buffer_pos == cur_buffer_handle->actual_size || scan_finder->iterator.GetBufferIdx() > iterator.GetBufferIdx()) { - // If things go terribly wrong, we never loop indefinetly. + // If things go terribly wrong, we never loop indefinitely. iterator.pos.buffer_idx = scan_finder->iterator.pos.buffer_idx; iterator.pos.buffer_pos = scan_finder->iterator.pos.buffer_pos; result.last_position = {iterator.pos.buffer_idx, iterator.pos.buffer_pos, result.buffer_size}; @@ -179888,8 +180033,11 @@ void StringValueScanner::FinalizeChunkProcess() { // If we are not done we have two options. // 1) If a boundary is set. if (iterator.IsBoundarySet()) { + bool has_unterminated_quotes = false; if (!result.current_errors.HasErrorType(UNTERMINATED_QUOTES)) { iterator.done = true; + } else { + has_unterminated_quotes = true; } // We read until the next line or until we have nothing else to read. // Move to next buffer @@ -179907,6 +180055,16 @@ void StringValueScanner::FinalizeChunkProcess() { MoveToNextBuffer(); } } else { + if (result.current_errors.HasErrorType(UNTERMINATED_QUOTES)) { + has_unterminated_quotes = true; + } + result.current_errors.HandleErrors(result); + } + if (states.IsQuotedCurrent() && !has_unterminated_quotes) { + // If we finish the execution of a buffer, and we end in a quoted state, it means we have unterminated + // quotes + result.current_errors.Insert(UNTERMINATED_QUOTES, result.cur_col_id, result.chunk_col_id, + result.last_position); result.current_errors.HandleErrors(result); } if (!iterator.done) { @@ -180074,7 +180232,11 @@ SnifferResult CSVSniffer::MinimalSniff() { for (idx_t col_idx = 0; col_idx < data_chunk.ColumnCount(); col_idx++) { auto &cur_vector = data_chunk.data[col_idx]; auto vector_data = FlatVector::GetData(cur_vector); - HeaderValue val(vector_data[0]); + auto &validity = FlatVector::Validity(cur_vector); + HeaderValue val; + if (validity.RowIsValid(0)) { + val = HeaderValue(vector_data[0]); + } potential_header.emplace_back(val); } } @@ -180161,13 +180323,16 @@ SnifferResult CSVSniffer::SniffCSV(bool force_match) { // If the header exists it should match string header_error = "The Column names set by the user do not match the ones found by the sniffer. \n"; auto &set_names = *set_columns.names; - for (idx_t i = 0; i < set_columns.Size(); i++) { - if (set_names[i] != names[i]) { - header_error += "Column at position: " + to_string(i) + " Set name: " + set_names[i] + - " Sniffed Name: " + names[i] + "\n"; - match = false; + if (set_names.size() == names.size()) { + for (idx_t i = 0; i < set_columns.Size(); i++) { + if (set_names[i] != names[i]) { + header_error += "Column at position: " + to_string(i) + " Set name: " + set_names[i] + + " Sniffed Name: " + names[i] + "\n"; + match = false; + } } } + if (!match) { error += header_error; } @@ -180175,15 +180340,18 @@ SnifferResult CSVSniffer::SniffCSV(bool force_match) { match = true; string type_error = "The Column types set by the user do not match the ones found by the sniffer. \n"; auto &set_types = *set_columns.types; - for (idx_t i = 0; i < set_columns.Size(); i++) { - if (set_types[i] != detected_types[i]) { - type_error += "Column at position: " + to_string(i) + " Set type: " + set_types[i].ToString() + - " Sniffed type: " + detected_types[i].ToString() + "\n"; - detected_types[i] = set_types[i]; - manually_set[i] = true; - match = false; + if (detected_types.size() == set_columns.Size()) { + for (idx_t i = 0; i < set_columns.Size(); i++) { + if (set_types[i] != detected_types[i]) { + type_error += "Column at position: " + to_string(i) + " Set type: " + set_types[i].ToString() + + " Sniffed type: " + detected_types[i].ToString() + "\n"; + detected_types[i] = set_types[i]; + manually_set[i] = true; + match = false; + } } } + if (!match) { error += type_error; } @@ -180252,7 +180420,7 @@ string DialectCandidates::Print() { } search_space << "\n"; search_space << "Quote/Escape Candidates: "; - for (uint8_t i = 0; i < static_cast(quoterule_candidates.size()); i++) { + for (uint8_t i = 0; i < static_cast(quote_rule_candidates.size()); i++) { auto quote_candidate = quote_candidates_map[i]; auto escape_candidate = escape_candidates_map[i]; for (idx_t j = 0; j < quote_candidate.size(); j++) { @@ -180266,7 +180434,7 @@ string DialectCandidates::Print() { search_space << ","; } } - if (i < quoterule_candidates.size() - 1) { + if (i < quote_rule_candidates.size() - 1) { search_space << ","; } } @@ -180317,7 +180485,7 @@ DialectCandidates::DialectCandidates(const CSVStateMachineOptions &options) { for (auto "e_rule : default_quote_rule) { quote_candidates_map[static_cast(quote_rule)] = {options.quote.GetValue()}; } - // also add it as a escape rule + // also add it as an escape rule if (!IsQuoteDefault(options.quote.GetValue())) { escape_candidates_map[static_cast(QuoteRule::QUOTES_RFC)].emplace_back(options.quote.GetValue()); } @@ -180330,14 +180498,14 @@ DialectCandidates::DialectCandidates(const CSVStateMachineOptions &options) { if (options.escape.IsSetByUser()) { // user provided escape: use that escape rule if (options.escape == '\0') { - quoterule_candidates = {QuoteRule::QUOTES_RFC}; + quote_rule_candidates = {QuoteRule::QUOTES_RFC}; } else { - quoterule_candidates = {QuoteRule::QUOTES_OTHER}; + quote_rule_candidates = {QuoteRule::QUOTES_OTHER}; } - escape_candidates_map[static_cast(quoterule_candidates[0])] = {options.escape.GetValue()}; + escape_candidates_map[static_cast(quote_rule_candidates[0])] = {options.escape.GetValue()}; } else { // no escape provided: try standard/common escapes - quoterule_candidates = default_quote_rule; + quote_rule_candidates = default_quote_rule; } } @@ -180352,12 +180520,12 @@ void CSVSniffer::GenerateStateMachineSearchSpace(vector(quoterule)); + for (const auto quote_rule : dialect_candidates.quote_rule_candidates) { + const auto "e_candidates = dialect_candidates.quote_candidates_map.at(static_cast(quote_rule)); for (const auto "e : quote_candidates) { for (const auto &delimiter : dialect_candidates.delim_candidates) { const auto &escape_candidates = - dialect_candidates.escape_candidates_map.at(static_cast(quoterule)); + dialect_candidates.escape_candidates_map.at(static_cast(quote_rule)); for (const auto &escape : escape_candidates) { for (const auto &comment : dialect_candidates.comment_candidates) { D_ASSERT(buffer_manager); @@ -180387,7 +180555,7 @@ void CSVSniffer::GenerateStateMachineSearchSpace(vector scanner, } idx_t consistent_rows = 0; idx_t num_cols = sniffed_column_counts.result_position == 0 ? 1 : sniffed_column_counts[0].number_of_columns; + const bool ignore_errors = options.ignore_errors.GetValue(); + // If we are ignoring errors and not null_padding , we pick the most frequent number of columns as the right one + bool use_most_frequent_columns = ignore_errors && !options.null_padding; + if (use_most_frequent_columns) { + num_cols = sniffed_column_counts.GetMostFrequentColumnCount(); + } idx_t padding_count = 0; idx_t comment_rows = 0; idx_t ignored_rows = 0; @@ -180440,7 +180614,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, if (sniffed_column_counts.result_position > rows_read) { rows_read = sniffed_column_counts.result_position; } - if (set_columns.IsCandidateUnacceptable(num_cols, options.null_padding, options.ignore_errors.GetValue(), + if (set_columns.IsCandidateUnacceptable(num_cols, options.null_padding, ignore_errors, sniffed_column_counts[0].last_value_always_empty)) { // Not acceptable return; @@ -180448,8 +180622,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, idx_t header_idx = 0; for (idx_t row = 0; row < sniffed_column_counts.result_position; row++) { if (set_columns.IsCandidateUnacceptable(sniffed_column_counts[row].number_of_columns, options.null_padding, - options.ignore_errors.GetValue(), - sniffed_column_counts[row].last_value_always_empty)) { + ignore_errors, sniffed_column_counts[row].last_value_always_empty)) { // Not acceptable return; } @@ -180464,7 +180637,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, consistent_rows++; } else if (num_cols < sniffed_column_counts[row].number_of_columns && (!options.dialect_options.skip_rows.IsSetByUser() || comment_rows > 0) && - (!set_columns.IsSet() || options.null_padding)) { + (!set_columns.IsSet() || options.null_padding) && (!first_valid || (!use_most_frequent_columns))) { // all rows up to this point will need padding if (!first_valid) { first_valid = true; @@ -180474,15 +180647,14 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, // we use the maximum amount of num_cols that we find num_cols = sniffed_column_counts[row].number_of_columns; dirty_notes = row; - // sniffed_column_counts.state_machine.dialect_options.rows_until_header = dirty_notes; dirty_notes_minus_comments = dirty_notes - comment_rows; header_idx = row; consistent_rows = 1; - } else if (sniffed_column_counts[row].number_of_columns == num_cols || - (options.ignore_errors.GetValue() && !options.null_padding)) { + } else if (sniffed_column_counts[row].number_of_columns == num_cols || (use_most_frequent_columns)) { if (!first_valid) { first_valid = true; sniffed_column_counts.state_machine.dialect_options.rows_until_header = row; + dirty_notes = row; } if (sniffed_column_counts[row].number_of_columns != num_cols) { ignored_rows++; @@ -180610,7 +180782,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, } } -bool CSVSniffer::RefineCandidateNextChunk(ColumnCountScanner &candidate) { +bool CSVSniffer::RefineCandidateNextChunk(ColumnCountScanner &candidate) const { auto &sniffed_column_counts = candidate.ParseChunk(); for (idx_t i = 0; i < sniffed_column_counts.result_position; i++) { if (set_columns.IsSet()) { @@ -180735,7 +180907,6 @@ void CSVSniffer::DetectDialect() { - namespace duckdb { // Helper function to generate column names static string GenerateColumnName(const idx_t total_cols, const idx_t col_number, const string &prefix = "column") { @@ -180763,8 +180934,7 @@ static string TrimWhitespace(const string &col_name) { } // Find the last character that is not right trimmed - idx_t end; - end = begin; + idx_t end = begin; for (auto next = begin; next < col_name.size();) { auto bytes = utf8proc_iterate(str + next, NumericCast(size - next), &codepoint); D_ASSERT(bytes > 0); @@ -180821,7 +180991,9 @@ static string NormalizeColumnName(const string &col_name) { } // prepend _ if name starts with a digit or is a reserved keyword - if (KeywordHelper::IsKeyword(col_name_cleaned) || (col_name_cleaned[0] >= '0' && col_name_cleaned[0] <= '9')) { + auto keyword = KeywordHelper::KeywordCategoryType(col_name_cleaned); + if (keyword == KeywordCategory::KEYWORD_TYPE_FUNC || keyword == KeywordCategory::KEYWORD_RESERVED || + (col_name_cleaned[0] >= '0' && col_name_cleaned[0] <= '9')) { col_name_cleaned = "_" + col_name_cleaned; } return col_name_cleaned; @@ -180829,10 +181001,9 @@ static string NormalizeColumnName(const string &col_name) { // If our columns were set by the user, we verify if their names match with the first row bool CSVSniffer::DetectHeaderWithSetColumn(ClientContext &context, vector &best_header_row, - SetColumns &set_columns, CSVReaderOptions &options) { + const SetColumns &set_columns, CSVReaderOptions &options) { bool has_header = true; - bool all_varchar = true; - bool first_row_consistent = true; + std::ostringstream error; // User set the names, we must check if they match the first row // We do a +1 to check for situations where the csv file has an extra all null column @@ -180856,6 +181027,8 @@ bool CSVSniffer::DetectHeaderWithSetColumn(ClientContext &context, vector
CSVSniffer::DetectHeaderInternal(ClientContext &context, vector &best_header_row, - CSVStateMachine &state_machine, SetColumns &set_columns, + CSVStateMachine &state_machine, const SetColumns &set_columns, unordered_map> &best_sql_types_candidates_per_column_idx, CSVReaderOptions &options, CSVErrorHandler &error_handler) { vector detected_names; @@ -180918,9 +181091,7 @@ CSVSniffer::DetectHeaderInternal(ClientContext &context, vector &be return detected_names; } // information for header detection - bool first_row_consistent = true; // check if header row is all null and/or consistent with detected column data types - bool first_row_nulls = true; // If null-padding is not allowed and there is a mismatch between our header candidate and the number of columns // We can't detect the dialect/type options properly if (!options.null_padding && best_sql_types_candidates_per_column_idx.size() != best_header_row.size()) { @@ -180929,12 +181100,14 @@ CSVSniffer::DetectHeaderInternal(ClientContext &context, vector &be state_machine.dialect_options.state_machine_options.delimiter.GetValue()); error_handler.Error(error); } - bool all_varchar = true; bool has_header; if (set_columns.IsSet()) { has_header = DetectHeaderWithSetColumn(context, best_header_row, set_columns, options); } else { + bool first_row_consistent = true; + bool all_varchar = true; + bool first_row_nulls = true; for (idx_t col = 0; col < best_header_row.size(); col++) { if (!best_header_row[col].IsNull()) { first_row_nulls = false; @@ -181129,6 +181302,10 @@ bool CSVSniffer::CanYouCastIt(ClientContext &context, const string_t value, cons auto value_ptr = value.GetData(); auto value_size = value.GetSize(); switch (type.id()) { + case LogicalTypeId::BOOLEAN: { + bool dummy_value; + return TryCastStringBool(value_ptr, value_size, dummy_value, true); + } case LogicalTypeId::TINYINT: { int8_t dummy_value; return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, false); @@ -181277,19 +181454,20 @@ void CSVSniffer::InitializeDateAndTimeStampDetection(CSVStateMachine &candidate, auto user_format = options.dialect_options.date_format.find(sql_type.id()); if (user_format->second.IsSetByUser()) { format_candidate.format.emplace_back(user_format->second.GetValue().format_specifier); - } - // order by preference - auto entry = format_template_candidates.find(sql_type.id()); - if (entry != format_template_candidates.end()) { - const auto &format_template_list = entry->second; - for (const auto &t : format_template_list) { - const auto format_string = GenerateDateFormat(separator, t); - // don't parse ISO 8601 - if (format_string.find("%Y-%m-%d") == string::npos) { - format_candidate.format.emplace_back(format_string); + } else { + auto entry = format_template_candidates.find(sql_type.id()); + if (entry != format_template_candidates.end()) { + const auto &format_template_list = entry->second; + for (const auto &t : format_template_list) { + const auto format_string = GenerateDateFormat(separator, t); + // don't parse ISO 8601 + if (format_string.find("%Y-%m-%d") == string::npos) { + format_candidate.format.emplace_back(format_string); + } } } } + // order by preference original_format_candidates = format_candidates; } // initialise the first candidate @@ -181316,7 +181494,8 @@ void CSVSniffer::DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const bool had_format_candidates = !save_format_candidates.empty(); bool initial_format_candidates = save_format_candidates.size() == original_format_candidates.at(sql_type.id()).format.size(); - while (!type_format_candidates.empty()) { + bool is_set_by_user = options.dialect_options.date_format.find(sql_type.id())->second.IsSetByUser(); + while (!type_format_candidates.empty() && !is_set_by_user) { // avoid using exceptions for flow control... auto ¤t_format = candidate.dialect_options.date_format[sql_type.id()].GetValue(); if (current_format.Parse(dummy_val, result, true)) { @@ -181367,7 +181546,7 @@ void CSVSniffer::SniffTypes(DataChunk &data_chunk, CSVStateMachine &state_machin // try cast from string to sql_type while (col_type_candidates.size() > 1) { const auto &sql_type = col_type_candidates.back(); - // try formatting for date types if the user did not specify one and it starts with numeric + // try formatting for date types if the user did not specify one, and it starts with numeric // values. string separator; // If Value is not Null, Has a numeric date format, and the current investigated candidate is @@ -181408,7 +181587,7 @@ void CSVSniffer::SniffTypes(DataChunk &data_chunk, CSVStateMachine &state_machin } // If we have a predefined date/timestamp format we set it -void CSVSniffer::SetUserDefinedDateTimeFormat(CSVStateMachine &candidate) { +void CSVSniffer::SetUserDefinedDateTimeFormat(CSVStateMachine &candidate) const { const vector data_time_formats {LogicalTypeId::DATE, LogicalTypeId::TIMESTAMP}; for (auto &date_time_format : data_time_formats) { auto &user_option = options.dialect_options.date_format.at(date_time_format); @@ -181449,7 +181628,7 @@ void CSVSniffer::DetectTypes() { } } } - if (break_loop) { + if (break_loop && !candidate->state_machine->options.ignore_errors.GetValue()) { continue; } } @@ -181710,7 +181889,7 @@ void CSVStateMachineCache::Insert(const CSVStateMachineOptions &state_machine_op auto &transition_array = state_machine_cache[state_machine_options]; for (uint32_t i = 0; i < StateMachine::NUM_STATES; i++) { - CSVState cur_state = CSVState(i); + CSVState cur_state = static_cast(i); switch (cur_state) { case CSVState::QUOTED: case CSVState::QUOTED_NEW_LINE: @@ -181922,11 +182101,11 @@ CSVStateMachineCache::CSVStateMachineCache() { auto default_delimiter = DialectCandidates::GetDefaultDelimiter(); auto default_comment = DialectCandidates::GetDefaultComment(); - for (auto quoterule : default_quote_rule) { - const auto "e_candidates = default_quote[static_cast(quoterule)]; + for (auto quote_rule : default_quote_rule) { + const auto "e_candidates = default_quote[static_cast(quote_rule)]; for (const auto "e : quote_candidates) { for (const auto &delimiter : default_delimiter) { - const auto &escape_candidates = default_escape[static_cast(quoterule)]; + const auto &escape_candidates = default_escape[static_cast(quote_rule)]; for (const auto &escape : escape_candidates) { for (const auto &comment : default_comment) { Insert({delimiter, quote, escape, comment, NewLineIdentifier::SINGLE_N}); @@ -183009,7 +183188,9 @@ CSVError CSVError::UnterminatedQuotesError(const CSVReaderOptions &options, idx_ std::ostringstream error; error << "Value with unterminated quote found." << '\n'; std::ostringstream how_to_fix_it; - how_to_fix_it << "Possible Solution: Enable ignore errors (ignore_errors=true) to skip this row" << '\n'; + how_to_fix_it << "Possible fixes:" << '\n'; + how_to_fix_it << "* Enable ignore errors (ignore_errors=true) to skip this row" << '\n'; + how_to_fix_it << "* Set quote do empty or to a different value (e.g., quote=\'\')" << '\n'; return CSVError(error.str(), UNTERMINATED_QUOTES, current_column, csv_row, error_info, row_byte_position, byte_position, options, how_to_fix_it.str(), current_path); } @@ -194084,7 +194265,12 @@ OperatorResultType PhysicalPiecewiseMergeJoin::ResolveComplexJoin(ExecutionConte if (tail_count < result_count) { result_count = tail_count; - chunk.Slice(*sel, result_count); + if (result_count == 0) { + // Need to reset here otherwise we may use the non-flat chunk when constructing LEFT/OUTER + chunk.Reset(); + } else { + chunk.Slice(*sel, result_count); + } } } @@ -216903,11 +217089,42 @@ struct DecimalScaleDownOperator { } }; +// This function detects if we can scale a decimal down to another. +template +bool CanScaleDownDecimal(INPUT_TYPE input, DecimalScaleInput &data) { + int64_t divisor = UnsafeNumericCast(NumericHelper::POWERS_OF_TEN[data.source_scale]); + auto value = input % divisor; + auto rounded_input = input; + if (rounded_input < 0) { + rounded_input *= -1; + value *= -1; + } + if (value >= divisor / 2) { + rounded_input += divisor; + } + return rounded_input < data.limit && rounded_input > -data.limit; +} + +template <> +bool CanScaleDownDecimal(hugeint_t input, DecimalScaleInput &data) { + auto divisor = UnsafeNumericCast(Hugeint::POWERS_OF_TEN[data.source_scale]); + hugeint_t value = input % divisor; + hugeint_t rounded_input = input; + if (rounded_input < 0) { + rounded_input *= -1; + value *= -1; + } + if (value >= divisor / 2) { + rounded_input += divisor; + } + return rounded_input < data.limit && rounded_input > -data.limit; +} + struct DecimalScaleDownCheckOperator { template static RESULT_TYPE Operation(INPUT_TYPE input, ValidityMask &mask, idx_t idx, void *dataptr) { - auto data = (DecimalScaleInput *)dataptr; - if (input >= data->limit || input <= -data->limit) { + auto data = static_cast *>(dataptr); + if (!CanScaleDownDecimal(input, *data)) { auto error = StringUtil::Format("Casting value \"%s\" to type %s failed: value is out of range!", Decimal::ToString(input, data->source_width, data->source_scale), data->result.GetType().ToString()); @@ -216934,7 +217151,6 @@ bool TemplatedDecimalScaleDown(Vector &source, Vector &result, idx_t count, Cast return true; } else { // type might not fit: check limit - auto limit = UnsafeNumericCast(POWERS_SOURCE::POWERS_OF_TEN[target_width]); DecimalScaleInput input(result, limit, divide_factor, parameters, source_width, source_scale); UnaryExecutor::GenericExecute(source, result, count, &input, @@ -231816,6 +232032,15 @@ bool ArrowType::RunEndEncoded() const { return run_end_encoded; } +void ArrowType::ThrowIfInvalid() const { + if (type.id() == LogicalTypeId::INVALID) { + if (not_implemented) { + throw NotImplementedException(error_message); + } + throw InvalidInputException(error_message); + } +} + LogicalType ArrowType::GetDuckType(bool use_dictionary) const { if (use_dictionary && dictionary_type) { return dictionary_type->GetDuckType(); @@ -232037,9 +232262,11 @@ static unique_ptr GetArrowExtensionType(const ArrowSchemaMetadata &ex // Check for arrow canonical extensions if (arrow_extension == "arrow.uuid") { if (format != "w:16") { - throw InvalidInputException( - "arrow.uuid must be a fixed-size binary of 16 bytes (i.e., \'w:16\'). It is incorrectly defined as: %s", - format); + std::ostringstream error; + error + << "arrow.uuid must be a fixed-size binary of 16 bytes (i.e., \'w:16\'). It is incorrectly defined as:" + << format; + return make_uniq(error.str()); } return make_uniq(LogicalType::UUID); } else if (arrow_extension == "arrow.json") { @@ -232051,40 +232278,47 @@ static unique_ptr GetArrowExtensionType(const ArrowSchemaMetadata &ex } else if (format == "vu") { return make_uniq(LogicalType::JSON(), make_uniq(ArrowVariableSizeType::VIEW)); } else { - throw InvalidInputException("arrow.json must be of a varchar format (i.e., \'u\',\'U\' or \'vu\'). It is " - "incorrectly defined as: %s", - format); + std::ostringstream error; + error + << "arrow.json must be of a varchar format (i.e., \'u\',\'U\' or \'vu\'). It is incorrectly defined as:" + << format; + return make_uniq(error.str()); } } // Check for DuckDB canonical extensions else if (arrow_extension == "duckdb.hugeint") { if (format != "w:16") { - throw InvalidInputException("duckdb.hugeint must be a fixed-size binary of 16 bytes (i.e., \'w:16\'). It " - "is incorrectly defined as: %s", - format); + std::ostringstream error; + error << "duckdb.hugeint must be a fixed-size binary of 16 bytes (i.e., \'w:16\'). It is incorrectly " + "defined as:" + << format; + return make_uniq(error.str()); } return make_uniq(LogicalType::HUGEINT); - } else if (arrow_extension == "duckdb.uhugeint") { if (format != "w:16") { - throw InvalidInputException("duckdb.hugeint must be a fixed-size binary of 16 bytes (i.e., \'w:16\'). It " - "is incorrectly defined as: %s", - format); + std::ostringstream error; + error << "duckdb.uhugeint must be a fixed-size binary of 16 bytes (i.e., \'w:16\'). It is incorrectly " + "defined as:" + << format; + return make_uniq(error.str()); } return make_uniq(LogicalType::UHUGEINT); } else if (arrow_extension == "duckdb.time_tz") { if (format != "w:8") { - throw InvalidInputException("duckdb.time_tz must be a fixed-size binary of 8 bytes (i.e., \'w:8\'). It " - "is incorrectly defined as: %s", - format); + std::ostringstream error; + error << "duckdb.time_tz must be a fixed-size binary of 8 bytes (i.e., \'w:8\'). It is incorrectly defined " + "as:" + << format; + return make_uniq(error.str()); } return make_uniq(LogicalType::TIME_TZ, make_uniq(ArrowDateTimeType::MICROSECONDS)); } else if (arrow_extension == "duckdb.bit") { if (format != "z" && format != "Z") { - throw InvalidInputException("duckdb.bit must be a blob (i.e., \'z\' or \'Z\'). It " - "is incorrectly defined as: %s", - format); + std::ostringstream error; + error << "duckdb.bit must be a blob (i.e., \'z\' or \'Z\'). It is incorrectly defined as:" << format; + return make_uniq(error.str()); } else if (format == "z") { auto type_info = make_uniq(ArrowVariableSizeType::NORMAL); return make_uniq(LogicalType::BIT, std::move(type_info)); @@ -232093,9 +232327,10 @@ static unique_ptr GetArrowExtensionType(const ArrowSchemaMetadata &ex return make_uniq(LogicalType::BIT, std::move(type_info)); } else { - throw NotImplementedException( - "Arrow Type with extension name: %s and format: %s, is not currently supported in DuckDB ", arrow_extension, - format); + std::ostringstream error; + error << "Arrow Type with extension name: " << arrow_extension << " and format: " << format + << ", is not currently supported in DuckDB."; + return make_uniq(error.str(), true); } } static unique_ptr GetArrowLogicalTypeNoDictionary(ArrowSchema &schema) { @@ -232386,10 +232621,12 @@ unique_ptr ProduceArrowScan(const ArrowScanFunctionData //! Generate Projection Pushdown Vector ArrowStreamParameters parameters; D_ASSERT(!column_ids.empty()); + auto &arrow_types = function.arrow_table.GetColumns(); for (idx_t idx = 0; idx < column_ids.size(); idx++) { auto col_idx = column_ids[idx]; if (col_idx != COLUMN_IDENTIFIER_ROW_ID) { auto &schema = *function.schema_root.arrow_schema.children[col_idx]; + arrow_types.at(col_idx)->ThrowIfInvalid(); parameters.projected_columns.projection_map[idx] = schema.name; parameters.projected_columns.columns.emplace_back(schema.name); parameters.projected_columns.filter_to_col[idx] = col_idx; @@ -236202,6 +236439,9 @@ string FormatOptions(char opt) { if (opt == '\'') { return "''"; } + if (opt == '\0') { + return ""; + } string result; result += opt; return result; @@ -236320,7 +236560,7 @@ static void CSVSniffFunction(ClientContext &context, TableFunctionInput &data_p, << "'" << separator; } // 11.2. Quote - if (!sniffer_options.dialect_options.header.IsSetByUser()) { + if (!sniffer_options.dialect_options.state_machine_options.quote.IsSetByUser()) { csv_read << "quote=" << "'" << FormatOptions(sniffer_options.dialect_options.state_machine_options.quote.GetValue()) << "'" << separator; @@ -242356,7 +242596,7 @@ void BaseAppender::BeginRow() { void BaseAppender::EndRow() { // check that all rows have been appended to if (column != chunk.ColumnCount()) { - throw InvalidInputException("Call to EndRow before all rows have been appended to!"); + throw InvalidInputException("Call to EndRow before all columns have been appended to!"); } column = 0; chunk.SetCardinality(chunk.size() + 1); @@ -245614,7 +245854,7 @@ idx_t duckdb_get_map_size(duckdb_value value) { } auto val = UnwrapValue(value); - if (val.type() != LogicalTypeId::MAP) { + if (val.type().id() != LogicalTypeId::MAP) { return 0; } @@ -245628,7 +245868,7 @@ duckdb_value duckdb_get_map_key(duckdb_value value, idx_t index) { } auto val = UnwrapValue(value); - if (val.type() != LogicalTypeId::MAP) { + if (val.type().id() != LogicalTypeId::MAP) { return nullptr; } @@ -245648,7 +245888,7 @@ duckdb_value duckdb_get_map_value(duckdb_value value, idx_t index) { } auto val = UnwrapValue(value); - if (val.type() != LogicalTypeId::MAP) { + if (val.type().id() != LogicalTypeId::MAP) { return nullptr; } @@ -245737,6 +245977,8 @@ LogicalTypeId ConvertCTypeToCPP(duckdb_type c_type) { return LogicalTypeId::TIMESTAMP_TZ; case DUCKDB_TYPE_ANY: return LogicalTypeId::ANY; + case DUCKDB_TYPE_SQLNULL: + return LogicalTypeId::SQLNULL; default: // LCOV_EXCL_START D_ASSERT(0); return LogicalTypeId::INVALID; @@ -245817,6 +246059,8 @@ duckdb_type ConvertCPPTypeToC(const LogicalType &sql_type) { return DUCKDB_TYPE_ARRAY; case LogicalTypeId::ANY: return DUCKDB_TYPE_ANY; + case LogicalTypeId::SQLNULL: + return DUCKDB_TYPE_SQLNULL; default: // LCOV_EXCL_START D_ASSERT(0); return DUCKDB_TYPE_INVALID; @@ -252012,16 +252256,22 @@ idx_t DBConfig::GetSystemMaxThreads(FileSystem &fs) { } idx_t DBConfig::GetSystemAvailableMemory(FileSystem &fs) { +#ifdef __linux__ // Check SLURM environment variables first const char *slurm_mem_per_node = getenv("SLURM_MEM_PER_NODE"); const char *slurm_mem_per_cpu = getenv("SLURM_MEM_PER_CPU"); if (slurm_mem_per_node) { - return ParseMemoryLimitSlurm(slurm_mem_per_node); + auto limit = ParseMemoryLimitSlurm(slurm_mem_per_node); + if (limit.IsValid()) { + return limit.GetIndex(); + } } else if (slurm_mem_per_cpu) { - idx_t mem_per_cpu = ParseMemoryLimitSlurm(slurm_mem_per_cpu); - idx_t num_threads = GetSystemMaxThreads(fs); - return mem_per_cpu * num_threads; + auto mem_per_cpu = ParseMemoryLimitSlurm(slurm_mem_per_cpu); + if (mem_per_cpu.IsValid()) { + idx_t num_threads = GetSystemMaxThreads(fs); + return mem_per_cpu.GetIndex() * num_threads; + } } // Check cgroup memory limit @@ -252029,8 +252279,9 @@ idx_t DBConfig::GetSystemAvailableMemory(FileSystem &fs) { if (cgroup_memory_limit.IsValid()) { return cgroup_memory_limit.GetIndex(); } +#endif - // Fall back to system memory detection + // System memory detection auto memory = FileSystem::GetAvailableMemory(); if (!memory.IsValid()) { return DBConfigOptions().maximum_memory; @@ -252100,9 +252351,9 @@ idx_t DBConfig::ParseMemoryLimit(const string &arg) { return LossyNumericCast(static_cast(multiplier) * limit); } -idx_t DBConfig::ParseMemoryLimitSlurm(const string &arg) { +optional_idx DBConfig::ParseMemoryLimitSlurm(const string &arg) { if (arg.empty()) { - return 0; + return optional_idx(); } string number_str = arg; @@ -252124,13 +252375,19 @@ idx_t DBConfig::ParseMemoryLimitSlurm(const string &arg) { } // Parse the number - double limit = Cast::Operation(string_t(number_str)); + double limit; + if (!TryCast::Operation(string_t(number_str), limit)) { + return optional_idx(); + } if (limit < 0) { - return NumericLimits::Maximum(); + return static_cast(NumericLimits::Maximum()); } - - return LossyNumericCast(static_cast(multiplier) * limit); + idx_t actual_limit = LossyNumericCast(static_cast(multiplier) * limit); + if (actual_limit == NumericLimits::Maximum()) { + return static_cast(NumericLimits::Maximum()); + } + return actual_limit; } // Right now we only really care about access mode when comparing DBConfigs @@ -252923,6 +253180,123 @@ vector> ConnectionManager::GetConnectionList() { +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/main/database_file_opener.hpp +// +// +//===----------------------------------------------------------------------===// + + + + + + + + +namespace duckdb { +class DatabaseInstance; + +class DatabaseFileOpener : public FileOpener { +public: + explicit DatabaseFileOpener(DatabaseInstance &db_p) : db(db_p) { + } + + SettingLookupResult TryGetCurrentSetting(const string &key, Value &result) override { + return SettingLookupResult(); + } + + optional_ptr TryGetClientContext() override { + return nullptr; + } + + optional_ptr TryGetDatabase() override { + return &db; + } + +private: + DatabaseInstance &db; +}; + +class DatabaseFileSystem : public OpenerFileSystem { +public: + explicit DatabaseFileSystem(DatabaseInstance &db_p) : db(db_p), database_opener(db_p) { + } + + FileSystem &GetFileSystem() const override { + auto &config = DBConfig::GetConfig(db); + return *config.file_system; + } + optional_ptr GetOpener() const override { + return &database_opener; + } + +private: + DatabaseInstance &db; + mutable DatabaseFileOpener database_opener; +}; + +} // namespace duckdb + + + +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/main/db_instance_cache.hpp +// +// +//===----------------------------------------------------------------------===// + + + + + + + +#include + +namespace duckdb { +class DBInstanceCache; + +struct DatabaseCacheEntry { + explicit DatabaseCacheEntry(const shared_ptr &database); + ~DatabaseCacheEntry(); + + weak_ptr database; +}; + +class DBInstanceCache { +public: + DBInstanceCache() { + } + + //! Gets a DB Instance from the cache if already exists (Fails if the configurations do not match) + shared_ptr GetInstance(const string &database, const DBConfig &config_dict); + + //! Creates and caches a new DB Instance (Fails if a cached instance already exists) + shared_ptr CreateInstance(const string &database, DBConfig &config_dict, bool cache_instance = true, + const std::function &on_create = nullptr); + + //! Either returns an existing entry, or creates and caches a new DB Instance + shared_ptr GetOrCreateInstance(const string &database, DBConfig &config_dict, bool cache_instance, + const std::function &on_create = nullptr); + +private: + //! A map with the cached instances + unordered_map> db_instances; + + //! Lock to alter cache + mutex cache_lock; + +private: + shared_ptr GetInstanceInternal(const string &database, const DBConfig &config_dict); + shared_ptr CreateInstanceInternal(const string &database, DBConfig &config_dict, bool cache_instance, + const std::function &on_create); +}; +} // namespace duckdb + @@ -252995,8 +253369,7 @@ class StandardBufferManager : public BufferManager { //! Allocate an in-memory buffer with a single pin. //! The allocated memory is released when the buffer handle is destroyed. - DUCKDB_API BufferHandle Allocate(MemoryTag tag, idx_t block_size, bool can_destroy = true, - shared_ptr *block = nullptr) final; + DUCKDB_API BufferHandle Allocate(MemoryTag tag, idx_t block_size, bool can_destroy = true) final; //! Reallocate an in-memory buffer that is pinned. void ReAllocate(shared_ptr &handle, idx_t block_size) final; @@ -253062,12 +253435,12 @@ class StandardBufferManager : public BufferManager { //! Write a temporary buffer to disk void WriteTemporaryBuffer(MemoryTag tag, block_id_t block_id, FileBuffer &buffer) final; //! Read a temporary buffer from disk - unique_ptr ReadTemporaryBuffer(MemoryTag tag, block_id_t id, + unique_ptr ReadTemporaryBuffer(MemoryTag tag, BlockHandle &block, unique_ptr buffer = nullptr) final; //! Get the path of the temporary buffer string GetTemporaryPath(block_id_t id); - void DeleteTemporaryFile(block_id_t id) final; + void DeleteTemporaryFile(BlockHandle &block) final; void RequireTemporaryDirectory(); @@ -253124,123 +253497,6 @@ class StandardBufferManager : public BufferManager { -//===----------------------------------------------------------------------===// -// DuckDB -// -// duckdb/main/database_file_opener.hpp -// -// -//===----------------------------------------------------------------------===// - - - - - - - - -namespace duckdb { -class DatabaseInstance; - -class DatabaseFileOpener : public FileOpener { -public: - explicit DatabaseFileOpener(DatabaseInstance &db_p) : db(db_p) { - } - - SettingLookupResult TryGetCurrentSetting(const string &key, Value &result) override { - return SettingLookupResult(); - } - - optional_ptr TryGetClientContext() override { - return nullptr; - } - - optional_ptr TryGetDatabase() override { - return &db; - } - -private: - DatabaseInstance &db; -}; - -class DatabaseFileSystem : public OpenerFileSystem { -public: - explicit DatabaseFileSystem(DatabaseInstance &db_p) : db(db_p), database_opener(db_p) { - } - - FileSystem &GetFileSystem() const override { - auto &config = DBConfig::GetConfig(db); - return *config.file_system; - } - optional_ptr GetOpener() const override { - return &database_opener; - } - -private: - DatabaseInstance &db; - mutable DatabaseFileOpener database_opener; -}; - -} // namespace duckdb - - -//===----------------------------------------------------------------------===// -// DuckDB -// -// duckdb/main/db_instance_cache.hpp -// -// -//===----------------------------------------------------------------------===// - - - - - - - -#include - -namespace duckdb { -class DBInstanceCache; - -struct DatabaseCacheEntry { - explicit DatabaseCacheEntry(const shared_ptr &database); - ~DatabaseCacheEntry(); - - weak_ptr database; -}; - -class DBInstanceCache { -public: - DBInstanceCache() { - } - - //! Gets a DB Instance from the cache if already exists (Fails if the configurations do not match) - shared_ptr GetInstance(const string &database, const DBConfig &config_dict); - - //! Creates and caches a new DB Instance (Fails if a cached instance already exists) - shared_ptr CreateInstance(const string &database, DBConfig &config_dict, bool cache_instance = true, - const std::function &on_create = nullptr); - - //! Either returns an existing entry, or creates and caches a new DB Instance - shared_ptr GetOrCreateInstance(const string &database, DBConfig &config_dict, bool cache_instance, - const std::function &on_create = nullptr); - -private: - //! A map with the cached instances - unordered_map> db_instances; - - //! Lock to alter cache - mutex cache_lock; - -private: - shared_ptr GetInstanceInternal(const string &database, const DBConfig &config_dict); - shared_ptr CreateInstanceInternal(const string &database, DBConfig &config_dict, bool cache_instance, - const std::function &on_create); -}; -} // namespace duckdb - - #ifndef DUCKDB_NO_THREADS #endif @@ -253651,7 +253907,8 @@ void DatabaseInstance::Configure(DBConfig &new_config, const char *database_path config.buffer_pool = std::move(new_config.buffer_pool); } else { config.buffer_pool = make_shared_ptr(config.options.maximum_memory, - config.options.buffer_manager_track_eviction_timestamps); + config.options.buffer_manager_track_eviction_timestamps, + config.options.allocator_bulk_deallocation_flush_threshold); } } @@ -264897,15 +265154,20 @@ static unique_ptr DirectInstallExtension(DatabaseInstance const string &local_extension_path, ExtensionInstallOptions &options, optional_ptr context) { - string file = fs.ConvertSeparators(path); - - // Try autoloading httpfs for loading extensions over https - if (context) { - auto &db = DatabaseInstance::GetDatabase(*context); - if (StringUtil::StartsWith(path, "https://") && !db.ExtensionIsLoaded("httpfs") && - db.config.options.autoload_known_extensions) { - ExtensionHelper::AutoLoadExtension(*context, "httpfs"); + string extension; + string file; + if (fs.IsRemoteFile(path, extension)) { + file = path; + // Try autoloading httpfs for loading extensions over https + if (context) { + auto &db = DatabaseInstance::GetDatabase(*context); + if (extension == "httpfs" && !db.ExtensionIsLoaded("httpfs") && + db.config.options.autoload_known_extensions) { + ExtensionHelper::AutoLoadExtension(*context, "httpfs"); + } } + } else { + file = fs.ConvertSeparators(path); } // Check if file exists @@ -266264,7 +266526,7 @@ static string FilterZeroAtEnd(string s) { return s; } -ParsedExtensionMetaData ExtensionHelper::ParseExtensionMetaData(const char *metadata) { +ParsedExtensionMetaData ExtensionHelper::ParseExtensionMetaData(const char *metadata) noexcept { ParsedExtensionMetaData result; vector metadata_field; @@ -266285,12 +266547,18 @@ ParsedExtensionMetaData ExtensionHelper::ParseExtensionMetaData(const char *meta result.extension_version = FilterZeroAtEnd(metadata_field[3]); - result.abi_type = EnumUtil::FromString(FilterZeroAtEnd(metadata_field[4])); + auto extension_abi_metadata = FilterZeroAtEnd(metadata_field[4]); - if (result.abi_type == ExtensionABIType::C_STRUCT) { + if (extension_abi_metadata == "C_STRUCT") { + result.abi_type = ExtensionABIType::C_STRUCT; result.duckdb_capi_version = FilterZeroAtEnd(metadata_field[2]); - } else if (result.abi_type == ExtensionABIType::CPP) { + } else if (extension_abi_metadata == "CPP" || extension_abi_metadata.empty()) { + result.abi_type = ExtensionABIType::CPP; result.duckdb_version = FilterZeroAtEnd(metadata_field[2]); + } else { + result.abi_type = ExtensionABIType::UNKNOWN; + result.duckdb_version = "unknown"; + result.extension_abi_metadata = extension_abi_metadata; } result.signature = string(metadata, ParsedExtensionMetaData::FOOTER_SIZE - ParsedExtensionMetaData::SIGNATURE_SIZE); @@ -266986,7 +267254,7 @@ string ParsedExtensionMetaData::GetInvalidMetadataError() { DUCKDB_EXTENSION_API_VERSION_MINOR, DUCKDB_EXTENSION_API_VERSION_PATCH); } } else { - throw InternalException("Unknown ABI type for extension: " + EnumUtil::ToString(abi_type)); + throw InternalException("Unknown ABI type for extension: " + extension_abi_metadata); } if (engine_platform != platform) { @@ -280447,9 +280715,14 @@ unique_ptr FilterPushdown::Rewrite(unique_ptr // we can just push directly through these operations without any rewriting op->children[0] = Rewrite(std::move(op->children[0])); return op; - case LogicalOperatorType::LOGICAL_MATERIALIZED_CTE: + case LogicalOperatorType::LOGICAL_MATERIALIZED_CTE: { + // we can't push filters into the materialized CTE (LHS), but we do want to recurse into it + FilterPushdown pushdown(optimizer, convert_mark_joins); + op->children[0] = pushdown.Rewrite(std::move(op->children[0])); + // we can push filters into the rest of the query plan (RHS) op->children[1] = Rewrite(std::move(op->children[1])); return op; + } case LogicalOperatorType::LOGICAL_GET: return PushdownGet(std::move(op)); case LogicalOperatorType::LOGICAL_LIMIT: @@ -280481,6 +280754,10 @@ unique_ptr FilterPushdown::PushdownJoin(unique_ptrtype == LogicalOperatorType::LOGICAL_ASOF_JOIN) { + return PushdownLeftJoin(std::move(op), left_bindings, right_bindings); + } return PushdownInnerJoin(std::move(op), left_bindings, right_bindings); case JoinType::LEFT: return PushdownLeftJoin(std::move(op), left_bindings, right_bindings); @@ -280882,11 +281159,6 @@ void JoinFilterPushdownOptimizer::GenerateJoinFilters(LogicalComparisonJoin &joi } } // pushdown can be performed - // set up the dynamic filters (if we don't have any yet) - if (!get.dynamic_filters) { - get.dynamic_filters = make_shared_ptr(); - } - pushdown_info->dynamic_filters = get.dynamic_filters; // set up the min/max aggregates for each of the filters vector aggr_functions; @@ -280899,9 +281171,18 @@ void JoinFilterPushdownOptimizer::GenerateJoinFilters(LogicalComparisonJoin &joi aggr_children.push_back(join.conditions[filter.join_condition].right->Copy()); auto aggr_expr = function_binder.BindAggregateFunction(aggr, std::move(aggr_children), nullptr, AggregateType::NON_DISTINCT); + if (aggr_expr->children.size() != 1) { + // min/max with collation - not supported + return; + } pushdown_info->min_max_aggregates.push_back(std::move(aggr_expr)); } } + // set up the dynamic filters (if we don't have any yet) + if (!get.dynamic_filters) { + get.dynamic_filters = make_shared_ptr(); + } + pushdown_info->dynamic_filters = get.dynamic_filters; // set up the filter pushdown in the join itself join.filter_pushdown = std::move(pushdown_info); @@ -280922,7 +281203,6 @@ void JoinFilterPushdownOptimizer::VisitOperator(LogicalOperator &op) { - //===----------------------------------------------------------------------===// // DuckDB // @@ -281043,6 +281323,7 @@ class QueryGraphManager { + namespace duckdb { // The filter was made on top of a logical sample or other projection, @@ -281325,10 +281606,18 @@ DenomInfo CardinalityEstimator::GetDenominator(JoinRelationSet &set) { // and we start to choose the filters that join relations in the set. // edges are guaranteed to be in order of largest tdom to smallest tdom. + unordered_set unused_edge_tdoms; auto edges = GetEdges(relations_to_tdoms, set); for (auto &edge : edges) { - auto subgraph_connections = SubgraphsConnectedByEdge(edge, subgraphs); + if (subgraphs.size() == 1 && subgraphs.at(0).relations->ToString() == set.ToString()) { + // the first subgraph has connected all the desired relations, just skip the rest of the edges + if (edge.has_tdom_hll) { + unused_edge_tdoms.insert(edge.tdom_hll); + } + continue; + } + auto subgraph_connections = SubgraphsConnectedByEdge(edge, subgraphs); if (subgraph_connections.empty()) { // create a subgraph out of left and right, then merge right into left and add left to subgraphs. // this helps cover a case where there are no subgraphs yet, and the only join filter is a SEMI JOIN @@ -281376,13 +281665,11 @@ DenomInfo CardinalityEstimator::GetDenominator(JoinRelationSet &set) { [](Subgraph2Denominator &s) { return !s.relations; }); subgraphs.erase(remove_start, subgraphs.end()); } - if (subgraphs.size() == 1 && subgraphs.at(0).relations->ToString() == set.ToString()) { - // the first subgraph has connected all the desired relations, no need to iterate - // through the rest of the edges. - break; - } } + // Slight penalty to cardinality for unused edges + auto denom_multiplier = 1.0 + static_cast(unused_edge_tdoms.size()); + // It's possible cross-products were added and are not present in the filters in the relation_2_tdom // structures. When that's the case, merge all remaining subgraphs. if (subgraphs.size() > 1) { @@ -281401,7 +281688,7 @@ DenomInfo CardinalityEstimator::GetDenominator(JoinRelationSet &set) { // denominator is 1 and numerators are a cross product of cardinalities. return DenomInfo(set, 1, 1); } - return DenomInfo(*subgraphs.at(0).numerator_relations, 1, subgraphs.at(0).denom); + return DenomInfo(*subgraphs.at(0).numerator_relations, 1, subgraphs.at(0).denom * denom_multiplier); } template <> @@ -282907,7 +283194,9 @@ GenerateJoinRelation QueryGraphManager::GenerateJoins(vectorright_set); if (dp_entry->second->info->filters.empty()) { // no filters, create a cross product + auto cardinality = left.op->estimated_cardinality * right.op->estimated_cardinality; result_operator = LogicalCrossProduct::Create(std::move(left.op), std::move(right.op)); + result_operator->SetEstimatedCardinality(cardinality); } else { // we have filters, create a join node auto chosen_filter = node->info->filters.at(0); @@ -283152,6 +283441,7 @@ static bool OperatorNeedsRelation(LogicalOperatorType op_type) { case LogicalOperatorType::LOGICAL_PROJECTION: case LogicalOperatorType::LOGICAL_EXPRESSION_GET: case LogicalOperatorType::LOGICAL_GET: + case LogicalOperatorType::LOGICAL_UNNEST: case LogicalOperatorType::LOGICAL_DELIM_GET: case LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY: case LogicalOperatorType::LOGICAL_WINDOW: @@ -283336,6 +283626,20 @@ bool RelationManager::ExtractJoinRelations(JoinOrderOptimizer &optimizer, Logica AddAggregateOrWindowRelation(input_op, parent, operator_stats, op->type); return true; } + case LogicalOperatorType::LOGICAL_UNNEST: { + // optimize children of unnest + RelationStats child_stats; + auto child_optimizer = optimizer.CreateChildOptimizer(); + op->children[0] = child_optimizer.Optimize(std::move(op->children[0]), &child_stats); + // the extracted cardinality should be set for window + if (!datasource_filters.empty()) { + child_stats.cardinality = LossyNumericCast(static_cast(child_stats.cardinality) * + RelationStatisticsHelper::DEFAULT_SELECTIVITY); + } + ModifyStatsIfLimit(limit_op.get(), child_stats); + AddRelation(input_op, parent, child_stats); + return true; + } case LogicalOperatorType::LOGICAL_COMPARISON_JOIN: { auto &join = op->Cast(); // Adding relations of the left side to the current join order optimizer @@ -284994,7 +285298,10 @@ void Optimizer::RunBuiltInOptimizers() { case LogicalOperatorType::LOGICAL_CREATE_SECRET: case LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR: // skip optimizing simple & often-occurring plans unaffected by rewrites - return; + if (plan->children.empty()) { + return; + } + break; default: break; } @@ -285474,9 +285781,6 @@ unique_ptr FilterPushdown::PushdownCrossProduct(unique_ptrtype) { case LogicalOperatorType::LOGICAL_CROSS_PRODUCT: break; - case LogicalOperatorType::LOGICAL_ASOF_JOIN: - join_ref_type = JoinRefType::ASOF; - break; default: throw InternalException("Unsupported join type for cross product push down"); } @@ -285493,14 +285797,7 @@ unique_ptr FilterPushdown::PushdownCrossProduct(unique_ptrfilter)); - } else { - right_pushdown.filters.push_back(std::move(f)); - } + right_pushdown.filters.push_back(std::move(f)); } else { D_ASSERT(side == JoinSide::BOTH || side == JoinSide::NONE); // bindings match both: turn into join condition @@ -285681,8 +285978,7 @@ unique_ptr FilterPushdown::PushdownInnerJoin(unique_ptrtype == LogicalOperatorType::LOGICAL_COMPARISON_JOIN || - op->type == LogicalOperatorType::LOGICAL_ASOF_JOIN); + D_ASSERT(op->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN); auto &comp_join = join.Cast(); // turn the conditions into filters for (auto &i : comp_join.conditions) { @@ -285695,11 +285991,6 @@ unique_ptr FilterPushdown::PushdownInnerJoin(unique_ptrtype == LogicalOperatorType::LOGICAL_ASOF_JOIN) { - return PushdownCrossProduct(std::move(op)); - } - // turn the inner join into a cross product auto cross_product = make_uniq(std::move(op->children[0]), std::move(op->children[1])); @@ -285808,7 +286099,7 @@ unique_ptr FilterPushdown::PushdownLeftJoin(unique_ptrtype != LogicalOperatorType::LOGICAL_ASOF_JOIN) { // bindings match right side or both sides: we cannot directly push it into the right // however, if the filter removes rows with null values from the RHS we can turn the left outer join // in an inner join, and then push down as we would push down an inner join @@ -289670,6 +289961,9 @@ static unique_ptr StatisticsNumericCastSwitch(const BaseStatisti case LogicalTypeId::TIME: { switch (input.GetType().id()) { case LogicalTypeId::TIMESTAMP: + case LogicalTypeId::TIMESTAMP_SEC: + case LogicalTypeId::TIMESTAMP_MS: + case LogicalTypeId::TIMESTAMP_NS: case LogicalTypeId::TIMESTAMP_TZ: return nullptr; default: @@ -290665,6 +290959,7 @@ void StatisticsPropagator::PropagateStatistics(LogicalComparisonJoin &join, uniq // TODO: write better CE logic for limits so that we can just look at // join.children[1].estimated_cardinality. auto limit = make_uniq(BoundLimitNode::ConstantValue(1), BoundLimitNode()); + limit->SetEstimatedCardinality(1); limit->AddChild(std::move(join.children[1])); auto cross_product = LogicalCrossProduct::Create(std::move(join.children[0]), std::move(limit)); node_ptr = std::move(cross_product); @@ -300970,6 +301265,10 @@ bool ExpressionUtil::SetEquals(const vector> &a, const ve namespace duckdb { bool KeywordHelper::IsKeyword(const string &text) { + return Parser::IsKeyword(text) != KeywordCategory::KEYWORD_NONE; +} + +KeywordCategory KeywordHelper::KeywordCategoryType(const string &text) { return Parser::IsKeyword(text); } @@ -307800,6 +308099,7 @@ typedef struct PGSelectStmt { */ PGSetOperation op; /* type of set op */ bool all; /* ALL specified? */ + bool from_first; /* FROM first or SELECT first */ struct PGNode *larg; /* left child */ struct PGNode *rarg; /* right child */ /* Eventually add fields for CORRESPONDING spec here */ @@ -309175,12 +309475,14 @@ struct PGSimplifiedToken { }; enum class PGKeywordCategory : uint8_t { - PG_KEYWORD_RESERVED, - PG_KEYWORD_UNRESERVED, - PG_KEYWORD_TYPE_FUNC, - PG_KEYWORD_COL_NAME + PG_KEYWORD_UNRESERVED = 0, + PG_KEYWORD_COL_NAME = 1, + PG_KEYWORD_TYPE_FUNC= 2, + PG_KEYWORD_RESERVED = 3, + PG_KEYWORD_NONE = 4 }; + struct PGKeyword { std::string text; PGKeywordCategory category; @@ -309192,7 +309494,6 @@ struct PGKeyword { // LICENSE_CHANGE_END #include - namespace duckdb_libpgquery { typedef enum PGBackslashQuoteType { @@ -309204,7 +309505,7 @@ typedef enum PGBackslashQuoteType { /* Primary entry point for the raw parsing functions */ PGList *raw_parser(const char *str); -bool is_keyword(const char *str); +PGKeywordCategory is_keyword(const char *str); std::vector keyword_list(); std::vector tokenize(const char *str); @@ -309253,7 +309554,7 @@ class PostgresParser { void Parse(const std::string &query); static duckdb::vector Tokenize(const std::string &query); - static bool IsKeyword(const std::string &text); + static duckdb_libpgquery::PGKeywordCategory IsKeyword(const std::string &text); static duckdb::vector KeywordList(); static void SetPreserveIdentifierCase(bool downcase); @@ -309590,8 +309891,25 @@ vector Parser::Tokenize(const string &query) { return result; } -bool Parser::IsKeyword(const string &text) { - return PostgresParser::IsKeyword(text); +KeywordCategory ToKeywordCategory(duckdb_libpgquery::PGKeywordCategory type) { + switch (type) { + case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_RESERVED: + return KeywordCategory::KEYWORD_RESERVED; + case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_UNRESERVED: + return KeywordCategory::KEYWORD_UNRESERVED; + case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_TYPE_FUNC: + return KeywordCategory::KEYWORD_TYPE_FUNC; + case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_COL_NAME: + return KeywordCategory::KEYWORD_COL_NAME; + case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_NONE: + return KeywordCategory::KEYWORD_NONE; + default: + throw InternalException("Unrecognized keyword category"); + } +} + +KeywordCategory Parser::IsKeyword(const string &text) { + return ToKeywordCategory(PostgresParser::IsKeyword(text)); } vector Parser::KeywordList() { @@ -309600,22 +309918,7 @@ vector Parser::KeywordList() { for (auto &kw : keywords) { ParserKeyword res; res.name = kw.text; - switch (kw.category) { - case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_RESERVED: - res.category = KeywordCategory::KEYWORD_RESERVED; - break; - case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_UNRESERVED: - res.category = KeywordCategory::KEYWORD_UNRESERVED; - break; - case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_TYPE_FUNC: - res.category = KeywordCategory::KEYWORD_TYPE_FUNC; - break; - case duckdb_libpgquery::PGKeywordCategory::PG_KEYWORD_COL_NAME: - res.category = KeywordCategory::KEYWORD_COL_NAME; - break; - default: - throw InternalException("Unrecognized keyword category"); - } + res.category = ToKeywordCategory(kw.category); result.push_back(res); } return result; @@ -318239,9 +318542,14 @@ unique_ptr Transformer::TransformSelectInternal(duckdb_libpgquery::PG if (!stmt.targetList) { throw ParserException("SELECT clause without selection list"); } - // select list - TransformExpressionList(*stmt.targetList, result.select_list); - result.from_table = TransformFrom(stmt.fromClause); + // transform in the specified order to ensure positional parameters are correctly set + if (stmt.from_first) { + result.from_table = TransformFrom(stmt.fromClause); + TransformExpressionList(*stmt.targetList, result.select_list); + } else { + TransformExpressionList(*stmt.targetList, result.select_list); + result.from_table = TransformFrom(stmt.fromClause); + } } // where @@ -321674,6 +321982,9 @@ BindResult ExpressionBinder::BindUnnest(FunctionExpression &expr, idx_t depth, b return BindUnsupportedExpression(expr, depth, UnsupportedUnnestMessage()); } +void ExpressionBinder::ThrowIfUnnestInLambda(const ColumnBinding &column_binding) { +} + string ExpressionBinder::UnsupportedAggregateMessage() { return "Aggregate functions are not supported here"; } @@ -321870,7 +322181,7 @@ void ExpressionBinder::CaptureLambdaColumns(BoundLambdaExpression &bound_lambda_ const LogicalType &list_child_type) { if (expr->expression_class == ExpressionClass::BOUND_SUBQUERY) { - throw InvalidInputException("Subqueries are not supported in lambda expressions!"); + throw BinderException("subqueries in lambda expressions are not supported"); } // these are bound depth-first @@ -321887,6 +322198,12 @@ void ExpressionBinder::CaptureLambdaColumns(BoundLambdaExpression &bound_lambda_ expr->expression_class == ExpressionClass::BOUND_PARAMETER || expr->expression_class == ExpressionClass::BOUND_LAMBDA_REF) { + if (expr->expression_class == ExpressionClass::BOUND_COLUMN_REF) { + // Search for UNNEST. + auto &column_binding = expr->Cast().binding; + ThrowIfUnnestInLambda(column_binding); + } + // move the expr because we are going to replace it auto original = std::move(expr); unique_ptr replacement; @@ -322805,10 +323122,12 @@ class SelectBinder : public BaseSelectBinder { SelectBinder(Binder &binder, ClientContext &context, BoundSelectNode &node, BoundGroupInformation &info); protected: + void ThrowIfUnnestInLambda(const ColumnBinding &column_binding) override; BindResult BindUnnest(FunctionExpression &function, idx_t depth, bool root_expression) override; BindResult BindColumnRef(unique_ptr &expr_ptr, idx_t depth, bool root_expression) override; bool QualifyColumnAlias(const ColumnRefExpression &colref) override; + unique_ptr GetSQLValueFunction(const string &column_name) override; protected: idx_t unnest_level = 0; @@ -322850,6 +323169,19 @@ unique_ptr CreateBoundStructExtractIndex(ClientContext &context, uni return std::move(result); } +void SelectBinder::ThrowIfUnnestInLambda(const ColumnBinding &column_binding) { + // Extract the unnests and check if any match the column index. + for (auto &node_pair : node.unnests) { + auto &unnest_node = node_pair.second; + + if (unnest_node.index == column_binding.table_index) { + if (column_binding.column_index < unnest_node.expressions.size()) { + throw BinderException("UNNEST in lambda expressions is not supported"); + } + } + } +} + BindResult SelectBinder::BindUnnest(FunctionExpression &function, idx_t depth, bool root_expression) { // bind the children of the function expression if (depth > 0) { @@ -326589,7 +326921,7 @@ unique_ptr Binder::BindCopyDatabaseData(Catalog &source_catalog ExportEntries entries; PhysicalExport::ExtractEntries(context, source_schemas, entries); - unique_ptr result; + vector> insert_nodes; for (auto &table_ref : entries.tables) { auto &table = table_ref.get().Cast(); // generate the insert statement @@ -326617,17 +326949,10 @@ unique_ptr Binder::BindCopyDatabaseData(Catalog &source_catalog insert_stmt.select_statement = std::move(select_stmt); auto bound_insert = Bind(insert_stmt); auto insert_plan = std::move(bound_insert.plan); - if (result) { - // use UNION ALL to combine the individual copy statements into a single node - auto copy_union = - make_uniq(GenerateTableIndex(), 1U, std::move(insert_plan), std::move(result), - LogicalOperatorType::LOGICAL_UNION, true, false); - result = std::move(copy_union); - } else { - result = std::move(insert_plan); - } + insert_nodes.push_back(std::move(insert_plan)); } - if (!result) { + unique_ptr result; + if (insert_nodes.empty()) { vector result_types; result_types.push_back(LogicalType::BIGINT); vector> expression_list; @@ -326636,6 +326961,9 @@ unique_ptr Binder::BindCopyDatabaseData(Catalog &source_catalog expressions.push_back(std::move(expression_list)); result = make_uniq(GenerateTableIndex(), std::move(result_types), std::move(expressions)); result->children.push_back(make_uniq(GenerateTableIndex())); + } else { + // use UNION ALL to combine the individual copy statements into a single node + result = UnionOperators(std::move(insert_nodes)); } return result; } @@ -326964,6 +327292,13 @@ SchemaCatalogEntry &Binder::BindCreateFunctionInfo(CreateInfo &info) { return BindCreateSchema(info); } +static bool IsValidUserType(optional_ptr entry) { + if (!entry) { + return false; + } + return entry->Cast().user_type.id() != LogicalTypeId::INVALID; +} + void Binder::BindLogicalType(LogicalType &type, optional_ptr catalog, const string &schema) { if (type.id() == LogicalTypeId::LIST || type.id() == LogicalTypeId::MAP) { auto child_type = ListType::GetChildType(type); @@ -327012,24 +327347,34 @@ void Binder::BindLogicalType(LogicalType &type, optional_ptr catalog, c type.SetModifiers(modifiers); } else if (type.id() == LogicalTypeId::USER) { auto user_type_name = UserType::GetTypeName(type); + auto user_type_schema = UserType::GetSchema(type); auto user_type_mods = UserType::GetTypeModifiers(type); bind_type_modifiers_function_t user_bind_modifiers_func = nullptr; if (catalog) { // The search order is: - // 1) In the same schema as the table - // 2) In the same catalog - // 3) System catalog - auto entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, *catalog, schema, user_type_name, - OnEntryNotFound::RETURN_NULL); - if (!entry || entry->Cast().user_type.id() == LogicalTypeId::INVALID) { + // 1) In the explicitly set schema (my_schema.my_type) + // 2) In the same schema as the table + // 3) In the same catalog + // 4) System catalog + + optional_ptr entry = nullptr; + if (!user_type_schema.empty()) { + entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, *catalog, user_type_schema, user_type_name, + OnEntryNotFound::RETURN_NULL); + } + if (!IsValidUserType(entry)) { + entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, *catalog, schema, user_type_name, + OnEntryNotFound::RETURN_NULL); + } + if (!IsValidUserType(entry)) { entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, *catalog, INVALID_SCHEMA, user_type_name, OnEntryNotFound::RETURN_NULL); - if (!entry || entry->Cast().user_type.id() == LogicalTypeId::INVALID) { - entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, INVALID_CATALOG, INVALID_SCHEMA, - user_type_name, OnEntryNotFound::THROW_EXCEPTION); - } + } + if (!IsValidUserType(entry)) { + entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, INVALID_CATALOG, INVALID_SCHEMA, + user_type_name, OnEntryNotFound::THROW_EXCEPTION); } auto &type_entry = entry->Cast(); type = type_entry.user_type; @@ -328406,6 +328751,27 @@ static unique_ptr CreateSelectStatement(CopyStatement &stmt, child_li return std::move(statement); } +unique_ptr Binder::UnionOperators(vector> nodes) { + if (nodes.empty()) { + return nullptr; + } + while (nodes.size() > 1) { + vector> new_nodes; + for (idx_t i = 0; i < nodes.size(); i += 2) { + if (i + 1 == nodes.size()) { + new_nodes.push_back(std::move(nodes[i])); + } else { + auto copy_union = make_uniq(GenerateTableIndex(), 1U, std::move(nodes[i]), + std::move(nodes[i + 1]), + LogicalOperatorType::LOGICAL_UNION, true, false); + new_nodes.push_back(std::move(copy_union)); + } + } + nodes = std::move(new_nodes); + } + return std::move(nodes[0]); +} + BoundStatement Binder::Bind(ExportStatement &stmt) { // COPY TO a file auto &config = DBConfig::GetConfig(context); @@ -328440,11 +328806,11 @@ BoundStatement Binder::Bind(ExportStatement &stmt) { // now generate the COPY statements for each of the tables auto &fs = FileSystem::GetFileSystem(context); - unique_ptr child_operator; BoundExportData exported_tables; unordered_set table_name_index; + vector> export_nodes; for (auto &t : tables) { auto &table = t.get().Cast(); auto info = make_uniq(); @@ -328507,15 +328873,9 @@ BoundStatement Binder::Bind(ExportStatement &stmt) { auto plan = std::move(bound_statement.plan); - if (child_operator) { - // use UNION ALL to combine the individual copy statements into a single node - auto copy_union = make_uniq(GenerateTableIndex(), 1U, std::move(child_operator), - std::move(plan), LogicalOperatorType::LOGICAL_UNION, true); - child_operator = std::move(copy_union); - } else { - child_operator = std::move(plan); - } + export_nodes.push_back(std::move(plan)); } + auto child_operator = UnionOperators(std::move(export_nodes)); // try to create the directory, if it doesn't exist yet // a bit hacky to do it here, but we need to create the directory BEFORE the copy statements run @@ -332432,9 +332792,7 @@ void LogicalComparisonJoin::ExtractJoinConditions( auto total_side = JoinSide::GetJoinSide(*expr, left_bindings, right_bindings); if (total_side != JoinSide::BOTH) { // join condition does not reference both sides, add it as filter under the join - // BUT don't push right side filters into AsOf because it is really a table lookup - // and we shouldn't remove anything from the table. - if (type == JoinType::LEFT && total_side == JoinSide::RIGHT && ref_type != JoinRefType::ASOF) { + if ((type == JoinType::LEFT || ref_type == JoinRefType::ASOF) && total_side == JoinSide::RIGHT) { // filter is on RHS and the join is a LEFT OUTER join, we can push it in the right child if (right_child->type != LogicalOperatorType::LOGICAL_FILTER) { // not a filter yet, push a new empty filter @@ -332955,10 +333313,8 @@ BoundStatement Binder::BindWithCTE(T &statement) { } MoveCorrelatedExpressions(*tail.child_binder); - // extract operator below root operation - auto plan = std::move(bound_statement.plan->children[0]); - bound_statement.plan->children.clear(); - bound_statement.plan->children.push_back(CreatePlan(*bound_cte, std::move(plan))); + auto plan = std::move(bound_statement.plan); + bound_statement.plan = CreatePlan(*bound_cte, std::move(plan)); } else { bound_statement = Bind(statement.template Cast()); } @@ -333165,7 +333521,8 @@ unique_ptr Binder::BindNode(QueryNode &node) { BoundStatement Binder::Bind(QueryNode &node) { BoundStatement result; - if (context.db->config.options.disabled_optimizers.find(OptimizerType::MATERIALIZED_CTE) == + if (node.type != QueryNodeType::CTE_NODE && // Issue #13850 - Don't auto-materialize if users materialize (for now) + context.db->config.options.disabled_optimizers.find(OptimizerType::MATERIALIZED_CTE) == context.db->config.options.disabled_optimizers.end() && context.config.enable_optimizer && OptimizeCTEs(node)) { switch (node.type) { @@ -334476,6 +334833,7 @@ bool BoundCastExpression::CastIsInvertible(const LogicalType &source_type, const break; case LogicalTypeId::VARCHAR: case LogicalTypeId::BIT: + case LogicalTypeId::TIME_TZ: return false; default: break; @@ -336725,6 +337083,15 @@ SelectBinder::SelectBinder(Binder &binder, ClientContext &context, BoundSelectNo : BaseSelectBinder(binder, context, node, info) { } +unique_ptr SelectBinder::GetSQLValueFunction(const string &column_name) { + auto alias_entry = node.bind_state.alias_map.find(column_name); + if (alias_entry != node.bind_state.alias_map.end()) { + // don't replace SQL value functions if they are in the alias map + return nullptr; + } + return ExpressionBinder::GetSQLValueFunction(column_name); +} + BindResult SelectBinder::BindColumnRef(unique_ptr &expr_ptr, idx_t depth, bool root_expression) { // first try to bind the column reference regularly auto result = BaseSelectBinder::BindColumnRef(expr_ptr, depth, root_expression); @@ -338808,7 +339175,7 @@ void LogicalCopyToFile::Serialize(Serializer &serializer) const { serializer.WriteProperty(213, "file_extension", file_extension); serializer.WriteProperty(214, "rotate", rotate); serializer.WriteProperty(215, "return_type", return_type); - serializer.WriteProperty(216, "write_partition_columns", write_partition_columns); + serializer.WritePropertyWithDefault(216, "write_partition_columns", write_partition_columns, true); } unique_ptr LogicalCopyToFile::Deserialize(Deserializer &deserializer) { @@ -338852,7 +339219,7 @@ unique_ptr LogicalCopyToFile::Deserialize(Deserializer &deseria auto rotate = deserializer.ReadPropertyWithExplicitDefault(214, "rotate", false); auto return_type = deserializer.ReadPropertyWithExplicitDefault(215, "return_type", CopyFunctionReturnType::CHANGED_ROWS); - auto write_partition_columns = deserializer.ReadProperty(216, "write_partition_columns"); + auto write_partition_columns = deserializer.ReadPropertyWithExplicitDefault(216, "write_partition_columns", true); if (!has_serialize) { // If not serialized, re-bind with the copy info @@ -339831,6 +340198,7 @@ namespace duckdb { LogicalPositionalJoin::LogicalPositionalJoin(unique_ptr left, unique_ptr right) : LogicalUnconditionalJoin(LogicalOperatorType::LOGICAL_POSITIONAL_JOIN, std::move(left), std::move(right)) { + SetEstimatedCardinality(MaxValue(children[0]->estimated_cardinality, children[1]->estimated_cardinality)); } unique_ptr LogicalPositionalJoin::Create(unique_ptr left, @@ -342302,7 +342670,7 @@ BlockHandle::~BlockHandle() { // NOLINT: allow internal exceptions D_ASSERT(memory_charge.size == 0); } - block_manager.UnregisterBlock(block_id); + block_manager.UnregisterBlock(*this); } unique_ptr AllocateBlock(BlockManager &block_manager, unique_ptr reusable_buffer, @@ -342324,39 +342692,36 @@ unique_ptr AllocateBlock(BlockManager &block_manager, unique_ptr &handle, data_ptr_t data, - unique_ptr reusable_buffer) { - D_ASSERT(handle->state != BlockState::BLOCK_LOADED); +BufferHandle BlockHandle::LoadFromBuffer(data_ptr_t data, unique_ptr reusable_buffer) { + D_ASSERT(state != BlockState::BLOCK_LOADED); // copy over the data into the block from the file buffer - auto block = AllocateBlock(handle->block_manager, std::move(reusable_buffer), handle->block_id); + auto block = AllocateBlock(block_manager, std::move(reusable_buffer), block_id); memcpy(block->InternalBuffer(), data, block->AllocSize()); - handle->buffer = std::move(block); - handle->state = BlockState::BLOCK_LOADED; - return BufferHandle(handle, handle->buffer.get()); + buffer = std::move(block); + state = BlockState::BLOCK_LOADED; + return BufferHandle(shared_from_this()); } -BufferHandle BlockHandle::Load(shared_ptr &handle, unique_ptr reusable_buffer) { - if (handle->state == BlockState::BLOCK_LOADED) { +BufferHandle BlockHandle::Load(unique_ptr reusable_buffer) { + if (state == BlockState::BLOCK_LOADED) { // already loaded - D_ASSERT(handle->buffer); - return BufferHandle(handle, handle->buffer.get()); + D_ASSERT(buffer); + return BufferHandle(shared_from_this()); } - auto &block_manager = handle->block_manager; - if (handle->block_id < MAXIMUM_BLOCK) { - auto block = AllocateBlock(block_manager, std::move(reusable_buffer), handle->block_id); + if (block_id < MAXIMUM_BLOCK) { + auto block = AllocateBlock(block_manager, std::move(reusable_buffer), block_id); block_manager.Read(*block); - handle->buffer = std::move(block); + buffer = std::move(block); } else { - if (handle->MustWriteToTemporaryFile()) { - handle->buffer = block_manager.buffer_manager.ReadTemporaryBuffer(handle->tag, handle->block_id, - std::move(reusable_buffer)); + if (MustWriteToTemporaryFile()) { + buffer = block_manager.buffer_manager.ReadTemporaryBuffer(tag, *this, std::move(reusable_buffer)); } else { return BufferHandle(); // Destroyed upon unpin/evict, so there is no temp buffer to read } } - handle->state = BlockState::BLOCK_LOADED; - return BufferHandle(handle, handle->buffer.get()); + state = BlockState::BLOCK_LOADED; + return BufferHandle(shared_from_this()); } unique_ptr BlockHandle::UnloadAndTakeBlock() { @@ -342474,14 +342839,22 @@ shared_ptr BlockManager::ConvertToPersistent(block_id_t block_id, s return new_block; } -void BlockManager::UnregisterBlock(block_id_t block_id) { - if (block_id >= MAXIMUM_BLOCK) { +void BlockManager::UnregisterBlock(block_id_t id) { + D_ASSERT(id < MAXIMUM_BLOCK); + lock_guard lock(blocks_lock); + // on-disk block: erase from list of blocks in manager + blocks.erase(id); +} + +void BlockManager::UnregisterBlock(BlockHandle &block) { + auto id = block.BlockId(); + if (id >= MAXIMUM_BLOCK) { // in-memory buffer: buffer could have been offloaded to disk: remove the file - buffer_manager.DeleteTemporaryFile(block_id); + buffer_manager.DeleteTemporaryFile(block); } else { lock_guard lock(blocks_lock); // on-disk block: erase from list of blocks in manager - blocks.erase(block_id); + blocks.erase(id); } } @@ -342502,8 +342875,8 @@ namespace duckdb { BufferHandle::BufferHandle() : handle(nullptr), node(nullptr) { } -BufferHandle::BufferHandle(shared_ptr handle_p, FileBuffer *node_p) - : handle(std::move(handle_p)), node(node_p) { +BufferHandle::BufferHandle(shared_ptr handle_p) + : handle(std::move(handle_p)), node(handle ? handle->buffer.get() : nullptr) { } BufferHandle::BufferHandle(BufferHandle &&other) noexcept : node(nullptr) { @@ -342827,8 +343200,11 @@ void EvictionQueue::PurgeIteration(const idx_t purge_size) { total_dead_nodes -= actually_dequeued - alive_nodes; } -BufferPool::BufferPool(idx_t maximum_memory, bool track_eviction_timestamps) - : maximum_memory(maximum_memory), track_eviction_timestamps(track_eviction_timestamps), +BufferPool::BufferPool(idx_t maximum_memory, bool track_eviction_timestamps, + idx_t allocator_bulk_deallocation_flush_threshold) + : maximum_memory(maximum_memory), + allocator_bulk_deallocation_flush_threshold(allocator_bulk_deallocation_flush_threshold), + track_eviction_timestamps(track_eviction_timestamps), temporary_memory_manager(make_uniq()) { queues.reserve(FILE_BUFFER_TYPE_COUNT); for (idx_t i = 0; i < FILE_BUFFER_TYPE_COUNT; i++) { @@ -342916,6 +343292,9 @@ BufferPool::EvictionResult BufferPool::EvictBlocksInternal(EvictionQueue &queue, bool found = false; if (memory_usage.GetUsedMemory(MemoryUsageCaches::NO_FLUSH) <= memory_limit) { + if (Allocator::SupportsFlush() && extra_memory > allocator_bulk_deallocation_flush_threshold) { + Allocator::FlushAll(); + } return {true, std::move(r)}; } @@ -343040,6 +343419,10 @@ void BufferPool::SetAllocatorBulkDeallocationFlushThreshold(idx_t threshold) { allocator_bulk_deallocation_flush_threshold = threshold; } +idx_t BufferPool::GetAllocatorBulkDeallocationFlushThreshold() { + return allocator_bulk_deallocation_flush_threshold; +} + BufferPool::MemoryUsage::MemoryUsage() { for (auto &v : memory_usage) { v = 0; @@ -343197,11 +343580,12 @@ void BufferManager::WriteTemporaryBuffer(MemoryTag tag, block_id_t block_id, Fil throw NotImplementedException("This type of BufferManager does not support 'WriteTemporaryBuffer"); } -unique_ptr BufferManager::ReadTemporaryBuffer(MemoryTag tag, block_id_t id, unique_ptr buffer) { +unique_ptr BufferManager::ReadTemporaryBuffer(MemoryTag tag, BlockHandle &block, + unique_ptr buffer) { throw NotImplementedException("This type of BufferManager does not support 'ReadTemporaryBuffer"); } -void BufferManager::DeleteTemporaryFile(block_id_t id) { +void BufferManager::DeleteTemporaryFile(BlockHandle &block) { throw NotImplementedException("This type of BufferManager does not support 'DeleteTemporaryFile"); } @@ -343591,7 +343975,7 @@ class ColumnData { //! Whether or not the column has any updates bool HasUpdates() const; //! Whether or not we can scan an entire vector - virtual ScanVectorType GetVectorScanType(ColumnScanState &state, idx_t scan_count); + virtual ScanVectorType GetVectorScanType(ColumnScanState &state, idx_t scan_count, Vector &result); //! Initialize prefetch state with required I/O data for the next N rows virtual void InitializePrefetch(PrefetchState &prefetch_state, ColumnScanState &scan_state, idx_t rows); @@ -354645,11 +355029,14 @@ struct RLEState { } else { // the values are different // issue the callback on the last value - Flush(); + // edge case: if a value has exactly 2^16 repeated values, we can end up here with last_seen_count = 0 + if (last_seen_count > 0) { + Flush(); + seen_count++; + } // increment the seen_count and put the new value into the RLE slot last_value = data[idx]; - seen_count++; last_seen_count = 1; } } else { @@ -355361,7 +355748,8 @@ void UncompressedStringStorage::WriteStringMemory(ColumnSegment &segment, string new_block->offset = 0; new_block->size = alloc_size; // allocate an in-memory buffer for it - handle = buffer_manager.Allocate(MemoryTag::OVERFLOW_STRINGS, alloc_size, false, &block); + handle = buffer_manager.Allocate(MemoryTag::OVERFLOW_STRINGS, alloc_size, false); + block = handle.GetBlockHandle(); state.overflow_blocks.insert(make_pair(block->BlockId(), reference(*new_block))); new_block->block = std::move(block); new_block->next = std::move(state.head); @@ -356137,7 +356525,7 @@ class StandardColumnData : public ColumnData { public: void SetStart(idx_t new_start) override; - ScanVectorType GetVectorScanType(ColumnScanState &state, idx_t scan_count) override; + ScanVectorType GetVectorScanType(ColumnScanState &state, idx_t scan_count, Vector &result) override; void InitializePrefetch(PrefetchState &prefetch_state, ColumnScanState &scan_state, idx_t rows) override; void InitializeScan(ColumnScanState &state) override; void InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx) override; @@ -358338,27 +358726,28 @@ MetadataHandle MetadataManager::Pin(MetadataPointer pointer) { return handle; } -void MetadataManager::ConvertToTransient(MetadataBlock &block) { +void MetadataManager::ConvertToTransient(MetadataBlock &metadata_block) { // pin the old block - auto old_buffer = buffer_manager.Pin(block.block); + auto old_buffer = buffer_manager.Pin(metadata_block.block); // allocate a new transient block to replace it - shared_ptr new_block; - auto new_buffer = buffer_manager.Allocate(MemoryTag::METADATA, block_manager.GetBlockSize(), false, &new_block); + auto new_buffer = buffer_manager.Allocate(MemoryTag::METADATA, block_manager.GetBlockSize(), false); + auto new_block = new_buffer.GetBlockHandle(); // copy the data to the transient block memcpy(new_buffer.Ptr(), old_buffer.Ptr(), block_manager.GetBlockSize()); - block.block = std::move(new_block); + metadata_block.block = std::move(new_block); // unregister the old block - block_manager.UnregisterBlock(block.block_id); + block_manager.UnregisterBlock(metadata_block.block_id); } block_id_t MetadataManager::AllocateNewBlock() { auto new_block_id = GetNextBlockId(); MetadataBlock new_block; - auto handle = buffer_manager.Allocate(MemoryTag::METADATA, block_manager.GetBlockSize(), false, &new_block.block); + auto handle = buffer_manager.Allocate(MemoryTag::METADATA, block_manager.GetBlockSize(), false); + new_block.block = handle.GetBlockHandle(); new_block.block_id = new_block_id; for (idx_t i = 0; i < METADATA_BLOCK_COUNT; i++) { new_block.free_blocks.push_back(NumericCast(METADATA_BLOCK_COUNT - i - 1)); @@ -364198,9 +364587,8 @@ shared_ptr StandardBufferManager::RegisterTransientMemory(const idx return RegisterSmallMemory(size); } - shared_ptr block; - Allocate(MemoryTag::IN_MEMORY_TABLE, size, false, &block); - return block; + auto buffer_handle = Allocate(MemoryTag::IN_MEMORY_TABLE, size, false); + return buffer_handle.GetBlockHandle(); } shared_ptr StandardBufferManager::RegisterSmallMemory(const idx_t size) { @@ -364236,17 +364624,14 @@ shared_ptr StandardBufferManager::RegisterMemory(MemoryTag tag, idx destroy_buffer_upon, alloc_size, std::move(res)); } -BufferHandle StandardBufferManager::Allocate(MemoryTag tag, idx_t block_size, bool can_destroy, - shared_ptr *block) { - shared_ptr local_block; - auto block_ptr = block ? block : &local_block; - *block_ptr = RegisterMemory(tag, block_size, can_destroy); +BufferHandle StandardBufferManager::Allocate(MemoryTag tag, idx_t block_size, bool can_destroy) { + auto block = RegisterMemory(tag, block_size, can_destroy); #ifdef DUCKDB_DEBUG_DESTROY_BLOCKS // Initialize the memory with garbage data - WriteGarbageIntoBuffer(*(*block_ptr)->buffer); + WriteGarbageIntoBuffer(*block->buffer); #endif - return Pin(*block_ptr); + return Pin(block); } void StandardBufferManager::ReAllocate(shared_ptr &handle, idx_t block_size) { @@ -364325,7 +364710,7 @@ void StandardBufferManager::BatchRead(vector> &handles, } auto block_ptr = intermediate_buffer.GetFileBuffer().InternalBuffer() + block_idx * block_manager.GetBlockAllocSize(); - buf = BlockHandle::LoadFromBuffer(handle, block_ptr, std::move(reusable_buffer)); + buf = handle->LoadFromBuffer(block_ptr, std::move(reusable_buffer)); handle->readers = 1; handle->memory_charge = std::move(reservation); } @@ -364386,7 +364771,7 @@ BufferHandle StandardBufferManager::Pin(shared_ptr &handle) { if (handle->state == BlockState::BLOCK_LOADED) { // the block is loaded, increment the reader count and set the BufferHandle handle->readers++; - buf = handle->Load(handle); + buf = handle->Load(); } required_memory = handle->memory_usage; } @@ -364407,11 +364792,11 @@ BufferHandle StandardBufferManager::Pin(shared_ptr &handle) { // the block is loaded, increment the reader count and return a pointer to the handle handle->readers++; reservation.Resize(0); - buf = handle->Load(handle); + buf = handle->Load(); } else { // now we can actually load the current block D_ASSERT(handle->readers == 0); - buf = handle->Load(handle, std::move(reusable_buffer)); + buf = handle->Load(std::move(reusable_buffer)); handle->readers = 1; handle->memory_charge = std::move(reservation); // in the case of a variable sized block, the buffer may be smaller than a full block. @@ -364552,33 +364937,34 @@ void StandardBufferManager::WriteTemporaryBuffer(MemoryTag tag, block_id_t block buffer.Write(*handle, sizeof(idx_t)); } -unique_ptr StandardBufferManager::ReadTemporaryBuffer(MemoryTag tag, block_id_t id, +unique_ptr StandardBufferManager::ReadTemporaryBuffer(MemoryTag tag, BlockHandle &block, unique_ptr reusable_buffer) { D_ASSERT(!temporary_directory.path.empty()); D_ASSERT(temporary_directory.handle.get()); + auto id = block.BlockId(); if (temporary_directory.handle->GetTempFile().HasTemporaryBuffer(id)) { - evicted_data_per_tag[uint8_t(tag)] -= GetBlockSize(); + // This is a block that was offloaded to a regular .tmp file, the file contains blocks of a fixed size return temporary_directory.handle->GetTempFile().ReadTemporaryBuffer(id, std::move(reusable_buffer)); } - // Open the temporary file and read its size. + // This block contains data of variable size so we need to open it and read it to get its size. idx_t block_size; auto path = GetTemporaryPath(id); auto &fs = FileSystem::GetFileSystem(db); auto handle = fs.OpenFile(path, FileFlags::FILE_FLAGS_READ); handle->Read(&block_size, sizeof(idx_t), 0); - evicted_data_per_tag[uint8_t(tag)] -= block_size; // Allocate a buffer of the file's size and read the data into that buffer. auto buffer = ReadTemporaryBufferInternal(*this, *handle, sizeof(idx_t), block_size, std::move(reusable_buffer)); handle.reset(); // Delete the file and return the buffer. - DeleteTemporaryFile(id); + DeleteTemporaryFile(block); return buffer; } -void StandardBufferManager::DeleteTemporaryFile(block_id_t id) { +void StandardBufferManager::DeleteTemporaryFile(BlockHandle &block) { + auto id = block.BlockId(); if (temporary_directory.path.empty()) { // no temporary directory specified: nothing to delete return; @@ -364592,6 +364978,7 @@ void StandardBufferManager::DeleteTemporaryFile(block_id_t id) { } // check if we should delete the file from the shared pool of files, or from the general file system if (temporary_directory.handle->GetTempFile().HasTemporaryBuffer(id)) { + evicted_data_per_tag[uint8_t(block.GetMemoryTag())] -= GetBlockSize(); temporary_directory.handle->GetTempFile().DeleteTemporaryBuffer(id); return; } @@ -364600,6 +364987,7 @@ void StandardBufferManager::DeleteTemporaryFile(block_id_t id) { auto &fs = FileSystem::GetFileSystem(db); auto path = GetTemporaryPath(id); if (fs.FileExists(path)) { + evicted_data_per_tag[uint8_t(block.GetMemoryTag())] -= block.GetMemoryUsage(); auto handle = fs.OpenFile(path, FileFlags::FILE_FLAGS_READ); auto content_size = handle->GetFileSize(); handle.reset(); @@ -365405,8 +365793,7 @@ shared_ptr ColumnStatistics::CreateEmptyStats(const LogicalTyp void ColumnStatistics::Merge(ColumnStatistics &other) { stats.Merge(other.stats); - if (distinct_stats) { - D_ASSERT(other.distinct_stats); + if (distinct_stats && other.distinct_stats) { distinct_stats->Merge(*other.distinct_stats); } } @@ -368616,7 +369003,10 @@ void ColumnData::InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx) state.last_offset = 0; } -ScanVectorType ColumnData::GetVectorScanType(ColumnScanState &state, idx_t scan_count) { +ScanVectorType ColumnData::GetVectorScanType(ColumnScanState &state, idx_t scan_count, Vector &result) { + if (result.GetVectorType() != VectorType::FLAT_VECTOR) { + return ScanVectorType::SCAN_ENTIRE_VECTOR; + } if (HasUpdates()) { // if we have updates we need to merge in the updates // always need to scan flat vectors @@ -368754,7 +369144,7 @@ void ColumnData::UpdateInternal(TransactionData transaction, idx_t column_index, template idx_t ColumnData::ScanVector(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, idx_t target_scan) { - auto scan_type = GetVectorScanType(state, target_scan); + auto scan_type = GetVectorScanType(state, target_scan, result); auto scan_count = ScanVector(state, result, target_scan, scan_type); if (scan_type != ScanVectorType::SCAN_ENTIRE_VECTOR) { // if we are scanning an entire vector we cannot have updates @@ -369841,8 +370231,8 @@ void ColumnSegment::Resize(idx_t new_size) { auto &buffer_manager = BufferManager::GetBufferManager(db); auto old_handle = buffer_manager.Pin(block); - shared_ptr new_block; - auto new_handle = buffer_manager.Allocate(MemoryTag::IN_MEMORY_TABLE, new_size, false, &new_block); + auto new_handle = buffer_manager.Allocate(MemoryTag::IN_MEMORY_TABLE, new_size); + auto new_block = new_handle.GetBlockHandle(); memcpy(new_handle.Ptr(), old_handle.Ptr(), segment_size); this->block_id = new_block->BlockId(); @@ -372698,9 +373088,10 @@ class VacuumTask : public BaseCheckpointTask { if (total_append_count != merge_rows) { throw InternalException("Mismatch in row group count vs verify count in RowGroupCollection::Checkpoint"); } - // merging is complete - schedule checkpoint tasks of the target row groups + // merging is complete - execute checkpoint tasks of the target row groups for (idx_t i = 0; i < target_count; i++) { - collection.ScheduleCheckpointTask(checkpoint_state, segment_idx + i); + auto checkpoint_task = collection.GetCheckpointTask(checkpoint_state, segment_idx + i); + checkpoint_task->ExecuteTask(); } } @@ -372736,7 +373127,7 @@ void RowGroupCollection::InitializeVacuumState(CollectionCheckpointState &checkp } bool RowGroupCollection::ScheduleVacuumTasks(CollectionCheckpointState &checkpoint_state, VacuumState &state, - idx_t segment_idx) { + idx_t segment_idx, bool schedule_vacuum) { static constexpr const idx_t MAX_MERGE_COUNT = 3; if (!state.can_vacuum_deletes) { @@ -372752,6 +373143,9 @@ bool RowGroupCollection::ScheduleVacuumTasks(CollectionCheckpointState &checkpoi D_ASSERT(!checkpoint_state.segments[segment_idx].node); return false; } + if (!schedule_vacuum) { + return false; + } idx_t merge_rows; idx_t next_idx = 0; idx_t merge_count; @@ -372802,9 +373196,9 @@ bool RowGroupCollection::ScheduleVacuumTasks(CollectionCheckpointState &checkpoi //===--------------------------------------------------------------------===// // Checkpoint //===--------------------------------------------------------------------===// -void RowGroupCollection::ScheduleCheckpointTask(CollectionCheckpointState &checkpoint_state, idx_t segment_idx) { - auto checkpoint_task = make_uniq(checkpoint_state, segment_idx); - checkpoint_state.executor.ScheduleTask(std::move(checkpoint_task)); +unique_ptr RowGroupCollection::GetCheckpointTask(CollectionCheckpointState &checkpoint_state, + idx_t segment_idx) { + return make_uniq(checkpoint_state, segment_idx); } void RowGroupCollection::Checkpoint(TableDataWriter &writer, TableStatistics &global_stats) { @@ -372820,13 +373214,12 @@ void RowGroupCollection::Checkpoint(TableDataWriter &writer, TableStatistics &gl auto &config = DBConfig::GetConfig(writer.GetDatabase()); for (idx_t segment_idx = 0; segment_idx < segments.size(); segment_idx++) { auto &entry = segments[segment_idx]; - if (total_vacuum_tasks < config.options.max_vacuum_tasks) { - auto vacuum_tasks = ScheduleVacuumTasks(checkpoint_state, vacuum_state, segment_idx); - if (vacuum_tasks) { - // vacuum tasks were scheduled - don't schedule a checkpoint task yet - total_vacuum_tasks++; - continue; - } + auto vacuum_tasks = ScheduleVacuumTasks(checkpoint_state, vacuum_state, segment_idx, + total_vacuum_tasks < config.options.max_vacuum_tasks); + if (vacuum_tasks) { + // vacuum tasks were scheduled - don't schedule a checkpoint task yet + total_vacuum_tasks++; + continue; } if (!entry.node) { // row group was vacuumed/dropped - skip @@ -372834,7 +373227,8 @@ void RowGroupCollection::Checkpoint(TableDataWriter &writer, TableStatistics &gl } // schedule a checkpoint task for this row group entry.node->MoveToCollection(*this, vacuum_state.row_start); - ScheduleCheckpointTask(checkpoint_state, segment_idx); + auto checkpoint_task = GetCheckpointTask(checkpoint_state, segment_idx); + checkpoint_state.executor.ScheduleTask(std::move(checkpoint_task)); vacuum_state.row_start += entry.node->count; } // all tasks have been scheduled - execute tasks until we are done @@ -373533,16 +373927,16 @@ void StandardColumnData::SetStart(idx_t new_start) { validity.SetStart(new_start); } -ScanVectorType StandardColumnData::GetVectorScanType(ColumnScanState &state, idx_t scan_count) { +ScanVectorType StandardColumnData::GetVectorScanType(ColumnScanState &state, idx_t scan_count, Vector &result) { // if either the current column data, or the validity column data requires flat vectors, we scan flat vectors - auto scan_type = ColumnData::GetVectorScanType(state, scan_count); + auto scan_type = ColumnData::GetVectorScanType(state, scan_count, result); if (scan_type == ScanVectorType::SCAN_FLAT_VECTOR) { return ScanVectorType::SCAN_FLAT_VECTOR; } if (state.child_states.empty()) { return scan_type; } - return validity.GetVectorScanType(state.child_states[0], scan_count); + return validity.GetVectorScanType(state.child_states[0], scan_count, result); } void StandardColumnData::InitializePrefetch(PrefetchState &prefetch_state, ColumnScanState &scan_state, idx_t rows) { @@ -377070,9 +377464,8 @@ void WriteAheadLogDeserializer::ReplayCreateIndex() { for (idx_t j = 0; j < data_info.allocation_sizes.size(); j++) { // read the data into a buffer handle - shared_ptr block_handle; - buffer_manager.Allocate(MemoryTag::ART_INDEX, block_manager->GetBlockSize(), false, &block_handle); - auto buffer_handle = buffer_manager.Pin(block_handle); + auto buffer_handle = buffer_manager.Allocate(MemoryTag::ART_INDEX, block_manager->GetBlockSize(), false); + auto block_handle = buffer_handle.GetBlockHandle(); auto data_ptr = buffer_handle.Ptr(); list.ReadElement(data_ptr, data_info.allocation_sizes[j]); @@ -436924,6 +437317,7 @@ bool get_preserve_identifier_case(); #include + /* Keyword categories --- should match lists in gram.y */ #define UNRESERVED_KEYWORD 0 #define COL_NAME_KEYWORD 1 @@ -436973,7 +437367,7 @@ PostgresParser::~PostgresParser() { duckdb_libpgquery::pg_parser_cleanup(); } -bool PostgresParser::IsKeyword(const std::string &text) { +duckdb_libpgquery::PGKeywordCategory PostgresParser::IsKeyword(const std::string &text) { return duckdb_libpgquery::is_keyword(text.c_str()); } @@ -442401,83 +442795,83 @@ static const yytype_uint16 yyrline[] = 192, 196, 200, 204, 208, 212, 216, 220, 228, 233, 234, 235, 236, 237, 243, 247, 47, 48, 52, 53, 54, 72, 73, 80, 88, 96, 104, 112, 120, 131, - 132, 159, 164, 172, 188, 205, 222, 239, 240, 259, - 263, 267, 271, 275, 285, 296, 306, 315, 326, 337, - 349, 364, 382, 382, 386, 386, 390, 390, 394, 400, - 407, 411, 412, 416, 417, 431, 438, 445, 455, 456, - 459, 472, 473, 474, 478, 489, 497, 502, 507, 512, - 517, 525, 533, 538, 543, 550, 551, 555, 556, 557, - 561, 568, 569, 573, 574, 578, 579, 580, 584, 585, - 589, 590, 606, 607, 610, 619, 630, 631, 632, 635, - 636, 637, 641, 642, 643, 644, 648, 649, 653, 655, - 671, 673, 678, 681, 689, 693, 697, 701, 705, 709, - 716, 721, 728, 729, 733, 738, 742, 746, 754, 761, - 762, 767, 768, 772, 773, 778, 780, 782, 787, 807, - 808, 810, 815, 816, 820, 821, 824, 825, 850, 851, - 856, 860, 861, 865, 866, 870, 871, 872, 873, 874, - 878, 891, 898, 905, 912, 913, 917, 918, 922, 923, - 927, 928, 932, 933, 937, 938, 942, 953, 954, 955, - 956, 960, 961, 966, 967, 968, 977, 983, 992, 993, - 1006, 1007, 1011, 1012, 1016, 1017, 1023, 1029, 1037, 1046, - 1054, 1063, 1072, 1076, 1081, 1092, 1106, 1107, 1110, 1111, - 1112, 1115, 1123, 1132, 1133, 1134, 1135, 1138, 1146, 1155, - 1159, 1166, 1167, 1171, 1180, 1184, 1209, 1213, 1226, 1240, - 1255, 1267, 1280, 1294, 1308, 1321, 1336, 1355, 1361, 1366, - 1372, 1379, 1380, 1388, 1392, 1396, 1402, 1409, 1414, 1415, - 1416, 1417, 1418, 1419, 1423, 1424, 1436, 1437, 1442, 1449, - 1456, 1463, 1495, 1506, 1519, 1524, 1525, 1528, 1529, 1532, - 1533, 1538, 1539, 1544, 1548, 1554, 1575, 1583, 1596, 1599, - 1603, 1603, 1606, 1607, 1609, 1614, 1621, 1626, 1632, 1637, - 1643, 1647, 1654, 1661, 1671, 1672, 1676, 1678, 1681, 1685, - 1686, 1687, 1688, 1689, 1690, 1695, 1715, 1716, 1717, 1718, - 1729, 1743, 1744, 1750, 1755, 1760, 1765, 1770, 1775, 1780, - 1785, 1791, 1797, 1803, 1810, 1832, 1841, 1845, 1853, 1857, - 1865, 1877, 1898, 1902, 1908, 1912, 1925, 1933, 1943, 1945, - 1947, 1949, 1951, 1953, 1958, 1959, 1966, 1975, 1983, 1992, - 2003, 2011, 2012, 2013, 2017, 2017, 2020, 2020, 2023, 2023, - 2026, 2026, 2029, 2029, 2032, 2032, 2035, 2035, 2038, 2038, - 2041, 2041, 2044, 2044, 2047, 2047, 2050, 2050, 2053, 2053, - 2056, 2058, 2060, 2062, 2064, 2066, 2068, 2070, 2072, 2074, - 2076, 2078, 2080, 2082, 2087, 2092, 2098, 2105, 2110, 2116, - 2122, 2153, 2155, 2157, 2165, 2180, 2182, 2184, 2186, 2188, - 2190, 2192, 2194, 2196, 2198, 2200, 2202, 2204, 2206, 2208, - 2210, 2213, 2215, 2217, 2220, 2222, 2224, 2226, 2228, 2233, - 2238, 2245, 2250, 2257, 2262, 2269, 2274, 2282, 2290, 2298, - 2306, 2324, 2332, 2340, 2348, 2356, 2364, 2372, 2376, 2392, - 2400, 2408, 2416, 2424, 2432, 2440, 2444, 2448, 2452, 2456, - 2464, 2472, 2480, 2488, 2508, 2530, 2541, 2548, 2562, 2571, - 2579, 2587, 2607, 2609, 2611, 2613, 2615, 2617, 2619, 2621, - 2623, 2625, 2627, 2629, 2631, 2633, 2635, 2637, 2639, 2641, - 2643, 2645, 2647, 2649, 2653, 2657, 2661, 2675, 2676, 2690, - 2691, 2692, 2703, 2727, 2738, 2748, 2752, 2756, 2763, 2767, - 2774, 2778, 2782, 2786, 2788, 2791, 2794, 2805, 2810, 2817, - 2823, 2829, 2836, 2856, 2860, 2867, 2875, 2883, 2894, 2914, - 2950, 2961, 2962, 2969, 2975, 2977, 2979, 2983, 2992, 2997, - 3004, 3019, 3026, 3030, 3034, 3038, 3042, 3052, 3060, 3069, - 3091, 3092, 3096, 3097, 3098, 3102, 3103, 3110, 3111, 3115, - 3116, 3121, 3129, 3131, 3145, 3148, 3175, 3176, 3179, 3180, - 3188, 3196, 3204, 3213, 3223, 3241, 3287, 3296, 3305, 3314, - 3323, 3335, 3336, 3337, 3338, 3339, 3353, 3354, 3357, 3358, - 3362, 3372, 3373, 3377, 3378, 3382, 3389, 3390, 3395, 3396, - 3401, 3402, 3405, 3406, 3407, 3410, 3411, 3414, 3415, 3416, - 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, - 3427, 3430, 3432, 3437, 3439, 3444, 3446, 3448, 3450, 3452, - 3454, 3456, 3458, 3472, 3474, 3479, 3483, 3490, 3495, 3501, - 3505, 3512, 3517, 3524, 3529, 3537, 3541, 3547, 3551, 3560, - 3571, 3572, 3576, 3580, 3587, 3588, 3589, 3590, 3591, 3592, - 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3611, - 3615, 3622, 3629, 3630, 3646, 3650, 3655, 3659, 3674, 3679, - 3683, 3686, 3689, 3690, 3691, 3694, 3701, 3702, 3703, 3713, - 3727, 3728, 3732, 3743, 3744, 3747, 3748, 3752, 3753, 3756, - 3762, 3766, 3773, 3781, 3789, 3797, 3807, 3808, 3813, 3814, - 3818, 3819, 3820, 3824, 3833, 3841, 3849, 3858, 3873, 3874, - 3879, 3880, 3890, 3891, 3895, 3896, 3900, 3901, 3904, 3920, - 3928, 3938, 3939, 3942, 3943, 3946, 3950, 3951, 3955, 3956, - 3959, 3960, 3961, 3971, 3972, 3976, 3978, 3984, 3985, 3989, - 3990, 3993, 4004, 4007, 4018, 4022, 4026, 4038, 4042, 4051, - 4058, 4096, 4100, 4104, 4108, 4112, 4116, 4120, 4126, 4143, - 4144, 4145, 4148, 4149, 4150, 4153, 4154, 4155, 4158, 4159, - 4162, 4164, 4169, 4170, 4173, 4177, 4178, 7, 18, 19, + 132, 159, 164, 172, 188, 205, 223, 241, 242, 261, + 265, 269, 273, 277, 287, 298, 308, 317, 328, 339, + 351, 366, 384, 384, 388, 388, 392, 392, 396, 402, + 409, 413, 414, 418, 419, 433, 440, 447, 457, 458, + 461, 474, 475, 476, 480, 491, 499, 504, 509, 514, + 519, 527, 535, 540, 545, 552, 553, 557, 558, 559, + 563, 570, 571, 575, 576, 580, 581, 582, 586, 587, + 591, 592, 608, 609, 612, 621, 632, 633, 634, 637, + 638, 639, 643, 644, 645, 646, 650, 651, 655, 657, + 673, 675, 680, 683, 691, 695, 699, 703, 707, 711, + 718, 723, 730, 731, 735, 740, 744, 748, 756, 763, + 764, 769, 770, 774, 775, 780, 782, 784, 789, 809, + 810, 812, 817, 818, 822, 823, 826, 827, 852, 853, + 858, 862, 863, 867, 868, 872, 873, 874, 875, 876, + 880, 893, 900, 907, 914, 915, 919, 920, 924, 925, + 929, 930, 934, 935, 939, 940, 944, 955, 956, 957, + 958, 962, 963, 968, 969, 970, 979, 985, 994, 995, + 1008, 1009, 1013, 1014, 1018, 1019, 1025, 1031, 1039, 1048, + 1056, 1065, 1074, 1078, 1083, 1094, 1108, 1109, 1112, 1113, + 1114, 1117, 1125, 1134, 1135, 1136, 1137, 1140, 1148, 1157, + 1161, 1168, 1169, 1173, 1182, 1186, 1211, 1215, 1228, 1242, + 1257, 1269, 1282, 1296, 1310, 1323, 1338, 1357, 1363, 1368, + 1374, 1381, 1382, 1390, 1394, 1398, 1404, 1411, 1416, 1417, + 1418, 1419, 1420, 1421, 1425, 1426, 1438, 1439, 1444, 1451, + 1458, 1465, 1497, 1508, 1521, 1526, 1527, 1530, 1531, 1534, + 1535, 1540, 1541, 1546, 1550, 1556, 1577, 1585, 1598, 1601, + 1605, 1605, 1608, 1609, 1611, 1616, 1623, 1628, 1634, 1639, + 1645, 1649, 1656, 1663, 1673, 1674, 1678, 1680, 1683, 1687, + 1688, 1689, 1690, 1691, 1692, 1697, 1717, 1718, 1719, 1720, + 1731, 1745, 1746, 1752, 1757, 1762, 1767, 1772, 1777, 1782, + 1787, 1793, 1799, 1805, 1812, 1834, 1843, 1847, 1855, 1859, + 1867, 1879, 1900, 1904, 1910, 1914, 1927, 1935, 1945, 1947, + 1949, 1951, 1953, 1955, 1960, 1961, 1968, 1977, 1985, 1994, + 2005, 2013, 2014, 2015, 2019, 2019, 2022, 2022, 2025, 2025, + 2028, 2028, 2031, 2031, 2034, 2034, 2037, 2037, 2040, 2040, + 2043, 2043, 2046, 2046, 2049, 2049, 2052, 2052, 2055, 2055, + 2058, 2060, 2062, 2064, 2066, 2068, 2070, 2072, 2074, 2076, + 2078, 2080, 2082, 2084, 2089, 2094, 2100, 2107, 2112, 2118, + 2124, 2155, 2157, 2159, 2167, 2182, 2184, 2186, 2188, 2190, + 2192, 2194, 2196, 2198, 2200, 2202, 2204, 2206, 2208, 2210, + 2212, 2215, 2217, 2219, 2222, 2224, 2226, 2228, 2230, 2235, + 2240, 2247, 2252, 2259, 2264, 2271, 2276, 2284, 2292, 2300, + 2308, 2326, 2334, 2342, 2350, 2358, 2366, 2374, 2378, 2394, + 2402, 2410, 2418, 2426, 2434, 2442, 2446, 2450, 2454, 2458, + 2466, 2474, 2482, 2490, 2510, 2532, 2543, 2550, 2564, 2573, + 2581, 2589, 2609, 2611, 2613, 2615, 2617, 2619, 2621, 2623, + 2625, 2627, 2629, 2631, 2633, 2635, 2637, 2639, 2641, 2643, + 2645, 2647, 2649, 2651, 2655, 2659, 2663, 2677, 2678, 2692, + 2693, 2694, 2705, 2729, 2740, 2750, 2754, 2758, 2765, 2769, + 2776, 2780, 2784, 2788, 2790, 2793, 2796, 2807, 2812, 2819, + 2825, 2831, 2838, 2858, 2862, 2869, 2877, 2885, 2896, 2916, + 2952, 2963, 2964, 2971, 2977, 2979, 2981, 2985, 2994, 2999, + 3006, 3021, 3028, 3032, 3036, 3040, 3044, 3054, 3062, 3071, + 3093, 3094, 3098, 3099, 3100, 3104, 3105, 3112, 3113, 3117, + 3118, 3123, 3131, 3133, 3147, 3150, 3177, 3178, 3181, 3182, + 3190, 3198, 3206, 3215, 3225, 3243, 3289, 3298, 3307, 3316, + 3325, 3337, 3338, 3339, 3340, 3341, 3355, 3356, 3359, 3360, + 3364, 3374, 3375, 3379, 3380, 3384, 3391, 3392, 3397, 3398, + 3403, 3404, 3407, 3408, 3409, 3412, 3413, 3416, 3417, 3418, + 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, + 3429, 3432, 3434, 3439, 3441, 3446, 3448, 3450, 3452, 3454, + 3456, 3458, 3460, 3474, 3476, 3481, 3485, 3492, 3497, 3503, + 3507, 3514, 3519, 3526, 3531, 3539, 3543, 3549, 3553, 3562, + 3573, 3574, 3578, 3582, 3589, 3590, 3591, 3592, 3593, 3594, + 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3613, + 3617, 3624, 3631, 3632, 3648, 3652, 3657, 3661, 3676, 3681, + 3685, 3688, 3691, 3692, 3693, 3696, 3703, 3704, 3705, 3715, + 3729, 3730, 3734, 3745, 3746, 3749, 3750, 3754, 3755, 3758, + 3764, 3768, 3775, 3783, 3791, 3799, 3809, 3810, 3815, 3816, + 3820, 3821, 3822, 3826, 3835, 3843, 3851, 3860, 3875, 3876, + 3881, 3882, 3892, 3893, 3897, 3898, 3902, 3903, 3906, 3922, + 3930, 3940, 3941, 3944, 3945, 3948, 3952, 3953, 3957, 3958, + 3961, 3962, 3963, 3973, 3974, 3978, 3980, 3986, 3987, 3991, + 3992, 3995, 4006, 4009, 4020, 4024, 4028, 4040, 4044, 4053, + 4060, 4098, 4102, 4106, 4110, 4114, 4118, 4122, 4128, 4145, + 4146, 4147, 4150, 4151, 4152, 4155, 4156, 4157, 4160, 4161, + 4164, 4166, 4171, 4172, 4175, 4179, 4180, 7, 18, 19, 23, 24, 25, 26, 27, 28, 7, 26, 50, 73, 80, 85, 86, 87, 88, 8, 33, 62, 66, 67, 72, 73, 78, 79, 83, 84, 89, 90, 7, 16, @@ -463914,12 +464308,13 @@ YYLTYPE yylloc; n->windowClause = (yyvsp[(8) - (10)].list); n->qualifyClause = (yyvsp[(9) - (10)].node); n->sampleOptions = (yyvsp[(10) - (10)].node); + n->from_first = true; (yyval.node) = (PGNode *)n; ;} break; case 546: -#line 225 "third_party/libpg_query/grammar/statements/select.y" +#line 226 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *n = makeNode(PGSelectStmt); n->targetList = (yyvsp[(5) - (12)].list); @@ -463932,17 +464327,18 @@ YYLTYPE yylloc; n->windowClause = (yyvsp[(10) - (12)].list); n->qualifyClause = (yyvsp[(11) - (12)].node); n->sampleOptions = (yyvsp[(12) - (12)].node); + n->from_first = true; (yyval.node) = (PGNode *)n; ;} break; case 547: -#line 239 "third_party/libpg_query/grammar/statements/select.y" +#line 241 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 548: -#line 241 "third_party/libpg_query/grammar/statements/select.y" +#line 243 "third_party/libpg_query/grammar/statements/select.y" { /* same as SELECT * FROM relation_expr */ PGColumnRef *cr = makeNode(PGColumnRef); @@ -463964,35 +464360,35 @@ YYLTYPE yylloc; break; case 549: -#line 260 "third_party/libpg_query/grammar/statements/select.y" +#line 262 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSetOp(PG_SETOP_UNION_BY_NAME, (yyvsp[(3) - (5)].boolean), (yyvsp[(1) - (5)].node), (yyvsp[(5) - (5)].node)); ;} break; case 550: -#line 264 "third_party/libpg_query/grammar/statements/select.y" +#line 266 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSetOp(PG_SETOP_UNION, (yyvsp[(3) - (4)].boolean), (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node)); ;} break; case 551: -#line 268 "third_party/libpg_query/grammar/statements/select.y" +#line 270 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSetOp(PG_SETOP_INTERSECT, (yyvsp[(3) - (4)].boolean), (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node)); ;} break; case 552: -#line 272 "third_party/libpg_query/grammar/statements/select.y" +#line 274 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSetOp(PG_SETOP_EXCEPT, (yyvsp[(3) - (4)].boolean), (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node)); ;} break; case 553: -#line 276 "third_party/libpg_query/grammar/statements/select.y" +#line 278 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464005,7 +464401,7 @@ YYLTYPE yylloc; break; case 554: -#line 286 "third_party/libpg_query/grammar/statements/select.y" +#line 288 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464019,7 +464415,7 @@ YYLTYPE yylloc; break; case 555: -#line 297 "third_party/libpg_query/grammar/statements/select.y" +#line 299 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464032,7 +464428,7 @@ YYLTYPE yylloc; break; case 556: -#line 307 "third_party/libpg_query/grammar/statements/select.y" +#line 309 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464044,7 +464440,7 @@ YYLTYPE yylloc; break; case 557: -#line 316 "third_party/libpg_query/grammar/statements/select.y" +#line 318 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464058,7 +464454,7 @@ YYLTYPE yylloc; break; case 558: -#line 327 "third_party/libpg_query/grammar/statements/select.y" +#line 329 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464072,7 +464468,7 @@ YYLTYPE yylloc; break; case 559: -#line 338 "third_party/libpg_query/grammar/statements/select.y" +#line 340 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464087,7 +464483,7 @@ YYLTYPE yylloc; break; case 560: -#line 350 "third_party/libpg_query/grammar/statements/select.y" +#line 352 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464105,7 +464501,7 @@ YYLTYPE yylloc; break; case 561: -#line 365 "third_party/libpg_query/grammar/statements/select.y" +#line 367 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); @@ -464123,7 +464519,7 @@ YYLTYPE yylloc; break; case 568: -#line 395 "third_party/libpg_query/grammar/statements/select.y" +#line 397 "third_party/libpg_query/grammar/statements/select.y" { PGPivot *n = makeNode(PGPivot); n->pivot_columns = list_make1((yyvsp[(1) - (1)].node)); @@ -464132,7 +464528,7 @@ YYLTYPE yylloc; break; case 569: -#line 401 "third_party/libpg_query/grammar/statements/select.y" +#line 403 "third_party/libpg_query/grammar/statements/select.y" { PGPivot *n = makeNode(PGPivot); n->pivot_columns = list_make1((yyvsp[(1) - (5)].node)); @@ -464142,32 +464538,32 @@ YYLTYPE yylloc; break; case 570: -#line 407 "third_party/libpg_query/grammar/statements/select.y" +#line 409 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 571: -#line 411 "third_party/libpg_query/grammar/statements/select.y" +#line 413 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 572: -#line 412 "third_party/libpg_query/grammar/statements/select.y" +#line 414 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 573: -#line 416 "third_party/libpg_query/grammar/statements/select.y" +#line 418 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 574: -#line 417 "third_party/libpg_query/grammar/statements/select.y" +#line 419 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 575: -#line 432 "third_party/libpg_query/grammar/statements/select.y" +#line 434 "third_party/libpg_query/grammar/statements/select.y" { (yyval.with) = makeNode(PGWithClause); (yyval.with)->ctes = (yyvsp[(2) - (2)].list); @@ -464177,7 +464573,7 @@ YYLTYPE yylloc; break; case 576: -#line 439 "third_party/libpg_query/grammar/statements/select.y" +#line 441 "third_party/libpg_query/grammar/statements/select.y" { (yyval.with) = makeNode(PGWithClause); (yyval.with)->ctes = (yyvsp[(2) - (2)].list); @@ -464187,7 +464583,7 @@ YYLTYPE yylloc; break; case 577: -#line 446 "third_party/libpg_query/grammar/statements/select.y" +#line 448 "third_party/libpg_query/grammar/statements/select.y" { (yyval.with) = makeNode(PGWithClause); (yyval.with)->ctes = (yyvsp[(3) - (3)].list); @@ -464197,17 +464593,17 @@ YYLTYPE yylloc; break; case 578: -#line 455 "third_party/libpg_query/grammar/statements/select.y" +#line 457 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 579: -#line 456 "third_party/libpg_query/grammar/statements/select.y" +#line 458 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 580: -#line 460 "third_party/libpg_query/grammar/statements/select.y" +#line 462 "third_party/libpg_query/grammar/statements/select.y" { PGCommonTableExpr *n = makeNode(PGCommonTableExpr); n->ctename = (yyvsp[(1) - (7)].str); @@ -464220,22 +464616,22 @@ YYLTYPE yylloc; break; case 581: -#line 472 "third_party/libpg_query/grammar/statements/select.y" +#line 474 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ctematerialize) = PGCTEMaterializeAlways; ;} break; case 582: -#line 473 "third_party/libpg_query/grammar/statements/select.y" +#line 475 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ctematerialize) = PGCTEMaterializeNever; ;} break; case 583: -#line 474 "third_party/libpg_query/grammar/statements/select.y" +#line 476 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ctematerialize) = PGCTEMaterializeDefault; ;} break; case 584: -#line 479 "third_party/libpg_query/grammar/statements/select.y" +#line 481 "third_party/libpg_query/grammar/statements/select.y" { (yyval.into) = makeNode(PGIntoClause); (yyval.into)->rel = (yyvsp[(2) - (2)].range); @@ -464248,12 +464644,12 @@ YYLTYPE yylloc; break; case 585: -#line 489 "third_party/libpg_query/grammar/statements/select.y" +#line 491 "third_party/libpg_query/grammar/statements/select.y" { (yyval.into) = NULL; ;} break; case 586: -#line 498 "third_party/libpg_query/grammar/statements/select.y" +#line 500 "third_party/libpg_query/grammar/statements/select.y" { (yyval.range) = (yyvsp[(3) - (3)].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; @@ -464261,7 +464657,7 @@ YYLTYPE yylloc; break; case 587: -#line 503 "third_party/libpg_query/grammar/statements/select.y" +#line 505 "third_party/libpg_query/grammar/statements/select.y" { (yyval.range) = (yyvsp[(3) - (3)].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; @@ -464269,7 +464665,7 @@ YYLTYPE yylloc; break; case 588: -#line 508 "third_party/libpg_query/grammar/statements/select.y" +#line 510 "third_party/libpg_query/grammar/statements/select.y" { (yyval.range) = (yyvsp[(4) - (4)].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; @@ -464277,7 +464673,7 @@ YYLTYPE yylloc; break; case 589: -#line 513 "third_party/libpg_query/grammar/statements/select.y" +#line 515 "third_party/libpg_query/grammar/statements/select.y" { (yyval.range) = (yyvsp[(4) - (4)].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; @@ -464285,7 +464681,7 @@ YYLTYPE yylloc; break; case 590: -#line 518 "third_party/libpg_query/grammar/statements/select.y" +#line 520 "third_party/libpg_query/grammar/statements/select.y" { ereport(PGWARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), @@ -464296,7 +464692,7 @@ YYLTYPE yylloc; break; case 591: -#line 526 "third_party/libpg_query/grammar/statements/select.y" +#line 528 "third_party/libpg_query/grammar/statements/select.y" { ereport(PGWARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), @@ -464307,7 +464703,7 @@ YYLTYPE yylloc; break; case 592: -#line 534 "third_party/libpg_query/grammar/statements/select.y" +#line 536 "third_party/libpg_query/grammar/statements/select.y" { (yyval.range) = (yyvsp[(3) - (3)].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_UNLOGGED; @@ -464315,7 +464711,7 @@ YYLTYPE yylloc; break; case 593: -#line 539 "third_party/libpg_query/grammar/statements/select.y" +#line 541 "third_party/libpg_query/grammar/statements/select.y" { (yyval.range) = (yyvsp[(2) - (2)].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; @@ -464323,7 +464719,7 @@ YYLTYPE yylloc; break; case 594: -#line 544 "third_party/libpg_query/grammar/statements/select.y" +#line 546 "third_party/libpg_query/grammar/statements/select.y" { (yyval.range) = (yyvsp[(1) - (1)].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; @@ -464331,87 +464727,87 @@ YYLTYPE yylloc; break; case 595: -#line 550 "third_party/libpg_query/grammar/statements/select.y" +#line 552 "third_party/libpg_query/grammar/statements/select.y" {;} break; case 596: -#line 551 "third_party/libpg_query/grammar/statements/select.y" +#line 553 "third_party/libpg_query/grammar/statements/select.y" {;} break; case 597: -#line 555 "third_party/libpg_query/grammar/statements/select.y" +#line 557 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = true; ;} break; case 598: -#line 556 "third_party/libpg_query/grammar/statements/select.y" +#line 558 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 599: -#line 557 "third_party/libpg_query/grammar/statements/select.y" +#line 559 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 600: -#line 561 "third_party/libpg_query/grammar/statements/select.y" +#line 563 "third_party/libpg_query/grammar/statements/select.y" { ;} break; case 601: -#line 568 "third_party/libpg_query/grammar/statements/select.y" +#line 570 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(NIL); ;} break; case 602: -#line 569 "third_party/libpg_query/grammar/statements/select.y" +#line 571 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(4) - (5)].list); ;} break; case 603: -#line 573 "third_party/libpg_query/grammar/statements/select.y" +#line 575 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL;;} break; case 604: -#line 574 "third_party/libpg_query/grammar/statements/select.y" +#line 576 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 605: -#line 578 "third_party/libpg_query/grammar/statements/select.y" +#line 580 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ignorenulls) = PG_IGNORE_NULLS;;} break; case 606: -#line 579 "third_party/libpg_query/grammar/statements/select.y" +#line 581 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ignorenulls) = PG_RESPECT_NULLS;;} break; case 607: -#line 580 "third_party/libpg_query/grammar/statements/select.y" +#line 582 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ignorenulls) = PG_DEFAULT_NULLS; ;} break; case 608: -#line 584 "third_party/libpg_query/grammar/statements/select.y" +#line 586 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list);;} break; case 609: -#line 585 "third_party/libpg_query/grammar/statements/select.y" +#line 587 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 610: -#line 589 "third_party/libpg_query/grammar/statements/select.y" +#line 591 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (3)].list); ;} break; case 611: -#line 591 "third_party/libpg_query/grammar/statements/select.y" +#line 593 "third_party/libpg_query/grammar/statements/select.y" { PGSortBy *sort = makeNode(PGSortBy); PGAStar *star = makeNode(PGAStar); @@ -464427,17 +464823,17 @@ YYLTYPE yylloc; break; case 612: -#line 606 "third_party/libpg_query/grammar/statements/select.y" +#line 608 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].sortby)); ;} break; case 613: -#line 607 "third_party/libpg_query/grammar/statements/select.y" +#line 609 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].sortby)); ;} break; case 614: -#line 611 "third_party/libpg_query/grammar/statements/select.y" +#line 613 "third_party/libpg_query/grammar/statements/select.y" { (yyval.sortby) = makeNode(PGSortBy); (yyval.sortby)->node = (yyvsp[(1) - (4)].node); @@ -464449,7 +464845,7 @@ YYLTYPE yylloc; break; case 615: -#line 620 "third_party/libpg_query/grammar/statements/select.y" +#line 622 "third_party/libpg_query/grammar/statements/select.y" { (yyval.sortby) = makeNode(PGSortBy); (yyval.sortby)->node = (yyvsp[(1) - (3)].node); @@ -464461,72 +464857,72 @@ YYLTYPE yylloc; break; case 616: -#line 630 "third_party/libpg_query/grammar/statements/select.y" +#line 632 "third_party/libpg_query/grammar/statements/select.y" { (yyval.sortorder) = PG_SORTBY_ASC; ;} break; case 617: -#line 631 "third_party/libpg_query/grammar/statements/select.y" +#line 633 "third_party/libpg_query/grammar/statements/select.y" { (yyval.sortorder) = PG_SORTBY_DESC; ;} break; case 618: -#line 632 "third_party/libpg_query/grammar/statements/select.y" +#line 634 "third_party/libpg_query/grammar/statements/select.y" { (yyval.sortorder) = PG_SORTBY_DEFAULT; ;} break; case 619: -#line 635 "third_party/libpg_query/grammar/statements/select.y" +#line 637 "third_party/libpg_query/grammar/statements/select.y" { (yyval.nullorder) = PG_SORTBY_NULLS_FIRST; ;} break; case 620: -#line 636 "third_party/libpg_query/grammar/statements/select.y" +#line 638 "third_party/libpg_query/grammar/statements/select.y" { (yyval.nullorder) = PG_SORTBY_NULLS_LAST; ;} break; case 621: -#line 637 "third_party/libpg_query/grammar/statements/select.y" +#line 639 "third_party/libpg_query/grammar/statements/select.y" { (yyval.nullorder) = PG_SORTBY_NULLS_DEFAULT; ;} break; case 622: -#line 641 "third_party/libpg_query/grammar/statements/select.y" +#line 643 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].node)); ;} break; case 623: -#line 642 "third_party/libpg_query/grammar/statements/select.y" +#line 644 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); ;} break; case 624: -#line 643 "third_party/libpg_query/grammar/statements/select.y" +#line 645 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2(NULL, (yyvsp[(1) - (1)].node)); ;} break; case 625: -#line 644 "third_party/libpg_query/grammar/statements/select.y" +#line 646 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (1)].node), NULL); ;} break; case 626: -#line 648 "third_party/libpg_query/grammar/statements/select.y" +#line 650 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 627: -#line 649 "third_party/libpg_query/grammar/statements/select.y" +#line 651 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2(NULL,NULL); ;} break; case 628: -#line 654 "third_party/libpg_query/grammar/statements/select.y" +#line 656 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 629: -#line 656 "third_party/libpg_query/grammar/statements/select.y" +#line 658 "third_party/libpg_query/grammar/statements/select.y" { /* Disabled because it was too confusing, bjm 2002-02-18 */ ereport(ERROR, @@ -464538,91 +464934,91 @@ YYLTYPE yylloc; break; case 630: -#line 672 "third_party/libpg_query/grammar/statements/select.y" +#line 674 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(3) - (5)].node); ;} break; case 631: -#line 674 "third_party/libpg_query/grammar/statements/select.y" +#line 676 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeIntConst(1, -1); ;} break; case 632: -#line 679 "third_party/libpg_query/grammar/statements/select.y" +#line 681 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 633: -#line 682 "third_party/libpg_query/grammar/statements/select.y" +#line 684 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (3)].node); ;} break; case 634: -#line 690 "third_party/libpg_query/grammar/statements/select.y" +#line 692 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleSize(makeFloat((yyvsp[(1) - (2)].str)), true); ;} break; case 635: -#line 694 "third_party/libpg_query/grammar/statements/select.y" +#line 696 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (2)].ival)), true); ;} break; case 636: -#line 698 "third_party/libpg_query/grammar/statements/select.y" +#line 700 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleSize(makeFloat((yyvsp[(1) - (2)].str)), true); ;} break; case 637: -#line 702 "third_party/libpg_query/grammar/statements/select.y" +#line 704 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (2)].ival)), true); ;} break; case 638: -#line 706 "third_party/libpg_query/grammar/statements/select.y" +#line 708 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (1)].ival)), false); ;} break; case 639: -#line 710 "third_party/libpg_query/grammar/statements/select.y" +#line 712 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (2)].ival)), false); ;} break; case 640: -#line 717 "third_party/libpg_query/grammar/statements/select.y" +#line 719 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(3) - (3)].node); ;} break; case 641: -#line 721 "third_party/libpg_query/grammar/statements/select.y" +#line 723 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 642: -#line 728 "third_party/libpg_query/grammar/statements/select.y" +#line 730 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 643: -#line 729 "third_party/libpg_query/grammar/statements/select.y" +#line 731 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = NULL; ;} break; case 644: -#line 734 "third_party/libpg_query/grammar/statements/select.y" +#line 736 "third_party/libpg_query/grammar/statements/select.y" { int seed = (yyvsp[(5) - (5)].ival); (yyval.node) = makeSampleOptions((yyvsp[(3) - (5)].node), (yyvsp[(1) - (5)].str), &seed, (yylsp[(1) - (5)])); @@ -464630,21 +465026,21 @@ YYLTYPE yylloc; break; case 645: -#line 739 "third_party/libpg_query/grammar/statements/select.y" +#line 741 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleOptions((yyvsp[(1) - (1)].node), NULL, NULL, (yylsp[(1) - (1)])); ;} break; case 646: -#line 743 "third_party/libpg_query/grammar/statements/select.y" +#line 745 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeSampleOptions((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].str), NULL, (yylsp[(1) - (4)])); ;} break; case 647: -#line 747 "third_party/libpg_query/grammar/statements/select.y" +#line 749 "third_party/libpg_query/grammar/statements/select.y" { int seed = (yyvsp[(5) - (6)].ival); (yyval.node) = makeSampleOptions((yyvsp[(1) - (6)].node), (yyvsp[(3) - (6)].str), &seed, (yylsp[(1) - (6)])); @@ -464652,39 +465048,39 @@ YYLTYPE yylloc; break; case 648: -#line 755 "third_party/libpg_query/grammar/statements/select.y" +#line 757 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 649: -#line 761 "third_party/libpg_query/grammar/statements/select.y" +#line 763 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 650: -#line 762 "third_party/libpg_query/grammar/statements/select.y" +#line 764 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 651: -#line 767 "third_party/libpg_query/grammar/statements/select.y" +#line 769 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = (yyvsp[(3) - (4)].ival); ;} break; case 652: -#line 768 "third_party/libpg_query/grammar/statements/select.y" +#line 770 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = -1; ;} break; case 653: -#line 772 "third_party/libpg_query/grammar/statements/select.y" +#line 774 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 654: -#line 774 "third_party/libpg_query/grammar/statements/select.y" +#line 776 "third_party/libpg_query/grammar/statements/select.y" { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[(1) - (1)])); @@ -464692,77 +465088,77 @@ YYLTYPE yylloc; break; case 655: -#line 779 "third_party/libpg_query/grammar/statements/select.y" +#line 781 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeLimitPercent((yyvsp[(1) - (2)].node)); ;} break; case 656: -#line 781 "third_party/libpg_query/grammar/statements/select.y" +#line 783 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeLimitPercent(makeFloatConst((yyvsp[(1) - (2)].str),(yylsp[(1) - (2)]))); ;} break; case 657: -#line 783 "third_party/libpg_query/grammar/statements/select.y" +#line 785 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeLimitPercent(makeIntConst((yyvsp[(1) - (2)].ival),(yylsp[(1) - (2)]))); ;} break; case 658: -#line 787 "third_party/libpg_query/grammar/statements/select.y" +#line 789 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 659: -#line 807 "third_party/libpg_query/grammar/statements/select.y" +#line 809 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 660: -#line 809 "third_party/libpg_query/grammar/statements/select.y" +#line 811 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 661: -#line 811 "third_party/libpg_query/grammar/statements/select.y" +#line 813 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = doNegate((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 662: -#line 815 "third_party/libpg_query/grammar/statements/select.y" +#line 817 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeIntConst((yyvsp[(1) - (1)].ival),(yylsp[(1) - (1)])); ;} break; case 663: -#line 816 "third_party/libpg_query/grammar/statements/select.y" +#line 818 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeFloatConst((yyvsp[(1) - (1)].str),(yylsp[(1) - (1)])); ;} break; case 664: -#line 820 "third_party/libpg_query/grammar/statements/select.y" +#line 822 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = 0; ;} break; case 665: -#line 821 "third_party/libpg_query/grammar/statements/select.y" +#line 823 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = 0; ;} break; case 666: -#line 824 "third_party/libpg_query/grammar/statements/select.y" +#line 826 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = 0; ;} break; case 667: -#line 825 "third_party/libpg_query/grammar/statements/select.y" +#line 827 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = 0; ;} break; case 668: -#line 850 "third_party/libpg_query/grammar/statements/select.y" +#line 852 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (3)].list); ;} break; case 669: -#line 852 "third_party/libpg_query/grammar/statements/select.y" +#line 854 "third_party/libpg_query/grammar/statements/select.y" { PGNode *node = (PGNode *) makeGroupingSet(GROUPING_SET_ALL, NIL, (yylsp[(3) - (3)])); (yyval.list) = list_make1(node); @@ -464770,145 +465166,145 @@ YYLTYPE yylloc; break; case 670: -#line 856 "third_party/libpg_query/grammar/statements/select.y" +#line 858 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 671: -#line 860 "third_party/libpg_query/grammar/statements/select.y" +#line 862 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 672: -#line 861 "third_party/libpg_query/grammar/statements/select.y" +#line 863 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list),(yyvsp[(3) - (3)].node)); ;} break; case 673: -#line 865 "third_party/libpg_query/grammar/statements/select.y" +#line 867 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 674: -#line 866 "third_party/libpg_query/grammar/statements/select.y" +#line 868 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 675: -#line 870 "third_party/libpg_query/grammar/statements/select.y" +#line 872 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 676: -#line 871 "third_party/libpg_query/grammar/statements/select.y" +#line 873 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 677: -#line 872 "third_party/libpg_query/grammar/statements/select.y" +#line 874 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 678: -#line 873 "third_party/libpg_query/grammar/statements/select.y" +#line 875 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 679: -#line 874 "third_party/libpg_query/grammar/statements/select.y" +#line 876 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 680: -#line 879 "third_party/libpg_query/grammar/statements/select.y" +#line 881 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[(1) - (2)])); ;} break; case 681: -#line 892 "third_party/libpg_query/grammar/statements/select.y" +#line 894 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); ;} break; case 682: -#line 899 "third_party/libpg_query/grammar/statements/select.y" +#line 901 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); ;} break; case 683: -#line 906 "third_party/libpg_query/grammar/statements/select.y" +#line 908 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[(4) - (5)].list), (yylsp[(1) - (5)])); ;} break; case 684: -#line 912 "third_party/libpg_query/grammar/statements/select.y" +#line 914 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 685: -#line 913 "third_party/libpg_query/grammar/statements/select.y" +#line 915 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 686: -#line 917 "third_party/libpg_query/grammar/statements/select.y" +#line 919 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 687: -#line 918 "third_party/libpg_query/grammar/statements/select.y" +#line 920 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 688: -#line 922 "third_party/libpg_query/grammar/statements/select.y" +#line 924 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 689: -#line 923 "third_party/libpg_query/grammar/statements/select.y" +#line 925 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 690: -#line 927 "third_party/libpg_query/grammar/statements/select.y" +#line 929 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 691: -#line 928 "third_party/libpg_query/grammar/statements/select.y" +#line 930 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 692: -#line 932 "third_party/libpg_query/grammar/statements/select.y" +#line 934 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 693: -#line 933 "third_party/libpg_query/grammar/statements/select.y" +#line 935 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 694: -#line 937 "third_party/libpg_query/grammar/statements/select.y" +#line 939 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 695: -#line 938 "third_party/libpg_query/grammar/statements/select.y" +#line 940 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} break; case 696: -#line 943 "third_party/libpg_query/grammar/statements/select.y" +#line 945 "third_party/libpg_query/grammar/statements/select.y" { PGLockingClause *n = makeNode(PGLockingClause); n->lockedRels = (yyvsp[(2) - (3)].list); @@ -464919,52 +465315,52 @@ YYLTYPE yylloc; break; case 697: -#line 953 "third_party/libpg_query/grammar/statements/select.y" +#line 955 "third_party/libpg_query/grammar/statements/select.y" { (yyval.lockstrength) = LCS_FORUPDATE; ;} break; case 698: -#line 954 "third_party/libpg_query/grammar/statements/select.y" +#line 956 "third_party/libpg_query/grammar/statements/select.y" { (yyval.lockstrength) = PG_LCS_FORNOKEYUPDATE; ;} break; case 699: -#line 955 "third_party/libpg_query/grammar/statements/select.y" +#line 957 "third_party/libpg_query/grammar/statements/select.y" { (yyval.lockstrength) = PG_LCS_FORSHARE; ;} break; case 700: -#line 956 "third_party/libpg_query/grammar/statements/select.y" +#line 958 "third_party/libpg_query/grammar/statements/select.y" { (yyval.lockstrength) = PG_LCS_FORKEYSHARE; ;} break; case 701: -#line 960 "third_party/libpg_query/grammar/statements/select.y" +#line 962 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (2)].list); ;} break; case 702: -#line 961 "third_party/libpg_query/grammar/statements/select.y" +#line 963 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 703: -#line 966 "third_party/libpg_query/grammar/statements/select.y" +#line 968 "third_party/libpg_query/grammar/statements/select.y" { (yyval.lockwaitpolicy) = LockWaitError; ;} break; case 704: -#line 967 "third_party/libpg_query/grammar/statements/select.y" +#line 969 "third_party/libpg_query/grammar/statements/select.y" { (yyval.lockwaitpolicy) = PGLockWaitSkip; ;} break; case 705: -#line 968 "third_party/libpg_query/grammar/statements/select.y" +#line 970 "third_party/libpg_query/grammar/statements/select.y" { (yyval.lockwaitpolicy) = PGLockWaitBlock; ;} break; case 706: -#line 978 "third_party/libpg_query/grammar/statements/select.y" +#line 980 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *n = makeNode(PGSelectStmt); n->valuesLists = list_make1((yyvsp[(3) - (4)].list)); @@ -464973,7 +465369,7 @@ YYLTYPE yylloc; break; case 707: -#line 984 "third_party/libpg_query/grammar/statements/select.y" +#line 986 "third_party/libpg_query/grammar/statements/select.y" { PGSelectStmt *n = (PGSelectStmt *) (yyvsp[(1) - (5)].node); n->valuesLists = lappend(n->valuesLists, (yyvsp[(4) - (5)].list)); @@ -464982,47 +465378,47 @@ YYLTYPE yylloc; break; case 708: -#line 992 "third_party/libpg_query/grammar/statements/select.y" +#line 994 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 709: -#line 993 "third_party/libpg_query/grammar/statements/select.y" +#line 995 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (2)].node); ;} break; case 710: -#line 1006 "third_party/libpg_query/grammar/statements/select.y" +#line 1008 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (2)].list); ;} break; case 711: -#line 1007 "third_party/libpg_query/grammar/statements/select.y" +#line 1009 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 712: -#line 1011 "third_party/libpg_query/grammar/statements/select.y" +#line 1013 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 713: -#line 1012 "third_party/libpg_query/grammar/statements/select.y" +#line 1014 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 714: -#line 1016 "third_party/libpg_query/grammar/statements/select.y" +#line 1018 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 715: -#line 1017 "third_party/libpg_query/grammar/statements/select.y" +#line 1019 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 716: -#line 1024 "third_party/libpg_query/grammar/statements/select.y" +#line 1026 "third_party/libpg_query/grammar/statements/select.y" { (yyvsp[(1) - (3)].range)->alias = (yyvsp[(2) - (3)].alias); (yyvsp[(1) - (3)].range)->sample = (yyvsp[(3) - (3)].node); @@ -465031,7 +465427,7 @@ YYLTYPE yylloc; break; case 717: -#line 1030 "third_party/libpg_query/grammar/statements/select.y" +#line 1032 "third_party/libpg_query/grammar/statements/select.y" { PGRangeFunction *n = (PGRangeFunction *) (yyvsp[(1) - (3)].node); n->alias = (PGAlias*) linitial((yyvsp[(2) - (3)].list)); @@ -465042,7 +465438,7 @@ YYLTYPE yylloc; break; case 718: -#line 1038 "third_party/libpg_query/grammar/statements/select.y" +#line 1040 "third_party/libpg_query/grammar/statements/select.y" { PGRangeSubselect *n = makeNode(PGRangeSubselect); n->lateral = false; @@ -465054,7 +465450,7 @@ YYLTYPE yylloc; break; case 719: -#line 1047 "third_party/libpg_query/grammar/statements/select.y" +#line 1049 "third_party/libpg_query/grammar/statements/select.y" { PGRangeFunction *n = (PGRangeFunction *) (yyvsp[(2) - (3)].node); n->lateral = true; @@ -465065,7 +465461,7 @@ YYLTYPE yylloc; break; case 720: -#line 1055 "third_party/libpg_query/grammar/statements/select.y" +#line 1057 "third_party/libpg_query/grammar/statements/select.y" { PGRangeSubselect *n = makeNode(PGRangeSubselect); n->lateral = false; @@ -465077,7 +465473,7 @@ YYLTYPE yylloc; break; case 721: -#line 1064 "third_party/libpg_query/grammar/statements/select.y" +#line 1066 "third_party/libpg_query/grammar/statements/select.y" { PGRangeSubselect *n = makeNode(PGRangeSubselect); n->lateral = true; @@ -465089,14 +465485,14 @@ YYLTYPE yylloc; break; case 722: -#line 1073 "third_party/libpg_query/grammar/statements/select.y" +#line 1075 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) (yyvsp[(1) - (1)].jexpr); ;} break; case 723: -#line 1077 "third_party/libpg_query/grammar/statements/select.y" +#line 1079 "third_party/libpg_query/grammar/statements/select.y" { (yyvsp[(2) - (4)].jexpr)->alias = (yyvsp[(4) - (4)].alias); (yyval.node) = (PGNode *) (yyvsp[(2) - (4)].jexpr); @@ -465104,7 +465500,7 @@ YYLTYPE yylloc; break; case 724: -#line 1082 "third_party/libpg_query/grammar/statements/select.y" +#line 1084 "third_party/libpg_query/grammar/statements/select.y" { PGPivotExpr *n = makeNode(PGPivotExpr); n->source = (yyvsp[(1) - (9)].node); @@ -465118,7 +465514,7 @@ YYLTYPE yylloc; break; case 725: -#line 1093 "third_party/libpg_query/grammar/statements/select.y" +#line 1095 "third_party/libpg_query/grammar/statements/select.y" { PGPivotExpr *n = makeNode(PGPivotExpr); n->source = (yyvsp[(1) - (9)].node); @@ -465132,32 +465528,32 @@ YYLTYPE yylloc; break; case 726: -#line 1106 "third_party/libpg_query/grammar/statements/select.y" +#line 1108 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (3)].list); ;} break; case 727: -#line 1107 "third_party/libpg_query/grammar/statements/select.y" +#line 1109 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NULL; ;} break; case 728: -#line 1110 "third_party/libpg_query/grammar/statements/select.y" +#line 1112 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = true; ;} break; case 729: -#line 1111 "third_party/libpg_query/grammar/statements/select.y" +#line 1113 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 730: -#line 1112 "third_party/libpg_query/grammar/statements/select.y" +#line 1114 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 731: -#line 1116 "third_party/libpg_query/grammar/statements/select.y" +#line 1118 "third_party/libpg_query/grammar/statements/select.y" { PGPivot *n = makeNode(PGPivot); n->pivot_columns = list_make1((yyvsp[(1) - (5)].node)); @@ -465167,7 +465563,7 @@ YYLTYPE yylloc; break; case 732: -#line 1124 "third_party/libpg_query/grammar/statements/select.y" +#line 1126 "third_party/libpg_query/grammar/statements/select.y" { PGPivot *n = makeNode(PGPivot); n->pivot_columns = list_make1((yyvsp[(1) - (3)].node)); @@ -465177,22 +465573,22 @@ YYLTYPE yylloc; break; case 734: -#line 1133 "third_party/libpg_query/grammar/statements/select.y" +#line 1135 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 735: -#line 1134 "third_party/libpg_query/grammar/statements/select.y" +#line 1136 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 736: -#line 1135 "third_party/libpg_query/grammar/statements/select.y" +#line 1137 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (3)].list); ;} break; case 737: -#line 1139 "third_party/libpg_query/grammar/statements/select.y" +#line 1141 "third_party/libpg_query/grammar/statements/select.y" { PGPivot *n = makeNode(PGPivot); n->pivot_columns = (yyvsp[(1) - (5)].list); @@ -465202,7 +465598,7 @@ YYLTYPE yylloc; break; case 738: -#line 1147 "third_party/libpg_query/grammar/statements/select.y" +#line 1149 "third_party/libpg_query/grammar/statements/select.y" { PGPivot *n = makeNode(PGPivot); n->pivot_columns = (yyvsp[(1) - (3)].list); @@ -465212,31 +465608,31 @@ YYLTYPE yylloc; break; case 739: -#line 1156 "third_party/libpg_query/grammar/statements/select.y" +#line 1158 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 740: -#line 1160 "third_party/libpg_query/grammar/statements/select.y" +#line 1162 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} break; case 741: -#line 1166 "third_party/libpg_query/grammar/statements/select.y" +#line 1168 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 742: -#line 1167 "third_party/libpg_query/grammar/statements/select.y" +#line 1169 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (3)].list); ;} break; case 743: -#line 1172 "third_party/libpg_query/grammar/statements/select.y" +#line 1174 "third_party/libpg_query/grammar/statements/select.y" { PGPivot *n = makeNode(PGPivot); n->unpivot_columns = (yyvsp[(1) - (5)].list); @@ -465246,28 +465642,28 @@ YYLTYPE yylloc; break; case 744: -#line 1181 "third_party/libpg_query/grammar/statements/select.y" +#line 1183 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 745: -#line 1185 "third_party/libpg_query/grammar/statements/select.y" +#line 1187 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} break; case 746: -#line 1210 "third_party/libpg_query/grammar/statements/select.y" +#line 1212 "third_party/libpg_query/grammar/statements/select.y" { (yyval.jexpr) = (yyvsp[(2) - (3)].jexpr); ;} break; case 747: -#line 1214 "third_party/libpg_query/grammar/statements/select.y" +#line 1216 "third_party/libpg_query/grammar/statements/select.y" { /* CROSS JOIN is same as unqualified inner join */ PGJoinExpr *n = makeNode(PGJoinExpr); @@ -465283,7 +465679,7 @@ YYLTYPE yylloc; break; case 748: -#line 1227 "third_party/libpg_query/grammar/statements/select.y" +#line 1229 "third_party/libpg_query/grammar/statements/select.y" { PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = (yyvsp[(2) - (5)].jtype); @@ -465300,7 +465696,7 @@ YYLTYPE yylloc; break; case 749: -#line 1241 "third_party/libpg_query/grammar/statements/select.y" +#line 1243 "third_party/libpg_query/grammar/statements/select.y" { /* letting join_type reduce to empty doesn't work */ PGJoinExpr *n = makeNode(PGJoinExpr); @@ -465318,7 +465714,7 @@ YYLTYPE yylloc; break; case 750: -#line 1256 "third_party/libpg_query/grammar/statements/select.y" +#line 1258 "third_party/libpg_query/grammar/statements/select.y" { PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = (yyvsp[(3) - (5)].jtype); @@ -465333,7 +465729,7 @@ YYLTYPE yylloc; break; case 751: -#line 1268 "third_party/libpg_query/grammar/statements/select.y" +#line 1270 "third_party/libpg_query/grammar/statements/select.y" { /* letting join_type reduce to empty doesn't work */ PGJoinExpr *n = makeNode(PGJoinExpr); @@ -465349,7 +465745,7 @@ YYLTYPE yylloc; break; case 752: -#line 1281 "third_party/libpg_query/grammar/statements/select.y" +#line 1283 "third_party/libpg_query/grammar/statements/select.y" { PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = (yyvsp[(3) - (6)].jtype); @@ -465366,7 +465762,7 @@ YYLTYPE yylloc; break; case 753: -#line 1295 "third_party/libpg_query/grammar/statements/select.y" +#line 1297 "third_party/libpg_query/grammar/statements/select.y" { PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_INNER; @@ -465383,7 +465779,7 @@ YYLTYPE yylloc; break; case 754: -#line 1309 "third_party/libpg_query/grammar/statements/select.y" +#line 1311 "third_party/libpg_query/grammar/statements/select.y" { /* POSITIONAL JOIN is a coordinated scan */ PGJoinExpr *n = makeNode(PGJoinExpr); @@ -465399,7 +465795,7 @@ YYLTYPE yylloc; break; case 755: -#line 1322 "third_party/libpg_query/grammar/statements/select.y" +#line 1324 "third_party/libpg_query/grammar/statements/select.y" { /* ANTI JOIN is a filter */ PGJoinExpr *n = makeNode(PGJoinExpr); @@ -465417,7 +465813,7 @@ YYLTYPE yylloc; break; case 756: -#line 1337 "third_party/libpg_query/grammar/statements/select.y" +#line 1339 "third_party/libpg_query/grammar/statements/select.y" { /* SEMI JOIN is also a filter */ PGJoinExpr *n = makeNode(PGJoinExpr); @@ -465436,7 +465832,7 @@ YYLTYPE yylloc; break; case 757: -#line 1356 "third_party/libpg_query/grammar/statements/select.y" +#line 1358 "third_party/libpg_query/grammar/statements/select.y" { (yyval.alias) = makeNode(PGAlias); (yyval.alias)->aliasname = (yyvsp[(2) - (5)].str); @@ -465445,7 +465841,7 @@ YYLTYPE yylloc; break; case 758: -#line 1362 "third_party/libpg_query/grammar/statements/select.y" +#line 1364 "third_party/libpg_query/grammar/statements/select.y" { (yyval.alias) = makeNode(PGAlias); (yyval.alias)->aliasname = (yyvsp[(2) - (2)].str); @@ -465453,7 +465849,7 @@ YYLTYPE yylloc; break; case 759: -#line 1367 "third_party/libpg_query/grammar/statements/select.y" +#line 1369 "third_party/libpg_query/grammar/statements/select.y" { (yyval.alias) = makeNode(PGAlias); (yyval.alias)->aliasname = (yyvsp[(1) - (4)].str); @@ -465462,7 +465858,7 @@ YYLTYPE yylloc; break; case 760: -#line 1373 "third_party/libpg_query/grammar/statements/select.y" +#line 1375 "third_party/libpg_query/grammar/statements/select.y" { (yyval.alias) = makeNode(PGAlias); (yyval.alias)->aliasname = (yyvsp[(1) - (1)].str); @@ -465470,31 +465866,31 @@ YYLTYPE yylloc; break; case 761: -#line 1379 "third_party/libpg_query/grammar/statements/select.y" +#line 1381 "third_party/libpg_query/grammar/statements/select.y" { (yyval.alias) = (yyvsp[(1) - (1)].alias); ;} break; case 762: -#line 1380 "third_party/libpg_query/grammar/statements/select.y" +#line 1382 "third_party/libpg_query/grammar/statements/select.y" { (yyval.alias) = NULL; ;} break; case 763: -#line 1389 "third_party/libpg_query/grammar/statements/select.y" +#line 1391 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (1)].alias), NIL); ;} break; case 764: -#line 1393 "third_party/libpg_query/grammar/statements/select.y" +#line 1395 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2(NULL, (yyvsp[(3) - (4)].list)); ;} break; case 765: -#line 1397 "third_party/libpg_query/grammar/statements/select.y" +#line 1399 "third_party/libpg_query/grammar/statements/select.y" { PGAlias *a = makeNode(PGAlias); a->aliasname = (yyvsp[(2) - (5)].str); @@ -465503,7 +465899,7 @@ YYLTYPE yylloc; break; case 766: -#line 1403 "third_party/libpg_query/grammar/statements/select.y" +#line 1405 "third_party/libpg_query/grammar/statements/select.y" { PGAlias *a = makeNode(PGAlias); a->aliasname = (yyvsp[(1) - (4)].str); @@ -465512,64 +465908,64 @@ YYLTYPE yylloc; break; case 767: -#line 1409 "third_party/libpg_query/grammar/statements/select.y" +#line 1411 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2(NULL, NIL); ;} break; case 768: -#line 1414 "third_party/libpg_query/grammar/statements/select.y" +#line 1416 "third_party/libpg_query/grammar/statements/select.y" { (yyval.jtype) = PG_JOIN_FULL; ;} break; case 769: -#line 1415 "third_party/libpg_query/grammar/statements/select.y" +#line 1417 "third_party/libpg_query/grammar/statements/select.y" { (yyval.jtype) = PG_JOIN_LEFT; ;} break; case 770: -#line 1416 "third_party/libpg_query/grammar/statements/select.y" +#line 1418 "third_party/libpg_query/grammar/statements/select.y" { (yyval.jtype) = PG_JOIN_RIGHT; ;} break; case 771: -#line 1417 "third_party/libpg_query/grammar/statements/select.y" +#line 1419 "third_party/libpg_query/grammar/statements/select.y" { (yyval.jtype) = PG_JOIN_SEMI; ;} break; case 772: -#line 1418 "third_party/libpg_query/grammar/statements/select.y" +#line 1420 "third_party/libpg_query/grammar/statements/select.y" { (yyval.jtype) = PG_JOIN_ANTI; ;} break; case 773: -#line 1419 "third_party/libpg_query/grammar/statements/select.y" +#line 1421 "third_party/libpg_query/grammar/statements/select.y" { (yyval.jtype) = PG_JOIN_INNER; ;} break; case 774: -#line 1423 "third_party/libpg_query/grammar/statements/select.y" +#line 1425 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 775: -#line 1424 "third_party/libpg_query/grammar/statements/select.y" +#line 1426 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 776: -#line 1436 "third_party/libpg_query/grammar/statements/select.y" +#line 1438 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) (yyvsp[(3) - (4)].list); ;} break; case 777: -#line 1437 "third_party/libpg_query/grammar/statements/select.y" +#line 1439 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 778: -#line 1443 "third_party/libpg_query/grammar/statements/select.y" +#line 1445 "third_party/libpg_query/grammar/statements/select.y" { /* inheritance query, implicitly */ (yyval.range) = (yyvsp[(1) - (1)].range); @@ -465579,7 +465975,7 @@ YYLTYPE yylloc; break; case 779: -#line 1450 "third_party/libpg_query/grammar/statements/select.y" +#line 1452 "third_party/libpg_query/grammar/statements/select.y" { /* inheritance query, explicitly */ (yyval.range) = (yyvsp[(1) - (2)].range); @@ -465589,7 +465985,7 @@ YYLTYPE yylloc; break; case 780: -#line 1457 "third_party/libpg_query/grammar/statements/select.y" +#line 1459 "third_party/libpg_query/grammar/statements/select.y" { /* no inheritance */ (yyval.range) = (yyvsp[(2) - (2)].range); @@ -465599,7 +465995,7 @@ YYLTYPE yylloc; break; case 781: -#line 1464 "third_party/libpg_query/grammar/statements/select.y" +#line 1466 "third_party/libpg_query/grammar/statements/select.y" { /* no inheritance, SQL99-style syntax */ (yyval.range) = (yyvsp[(3) - (4)].range); @@ -465609,7 +466005,7 @@ YYLTYPE yylloc; break; case 782: -#line 1496 "third_party/libpg_query/grammar/statements/select.y" +#line 1498 "third_party/libpg_query/grammar/statements/select.y" { PGRangeFunction *n = makeNode(PGRangeFunction); n->lateral = false; @@ -465623,7 +466019,7 @@ YYLTYPE yylloc; break; case 783: -#line 1507 "third_party/libpg_query/grammar/statements/select.y" +#line 1509 "third_party/libpg_query/grammar/statements/select.y" { PGRangeFunction *n = makeNode(PGRangeFunction); n->lateral = false; @@ -465637,66 +466033,66 @@ YYLTYPE yylloc; break; case 784: -#line 1520 "third_party/libpg_query/grammar/statements/select.y" +#line 1522 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].list)); ;} break; case 785: -#line 1524 "third_party/libpg_query/grammar/statements/select.y" +#line 1526 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].list)); ;} break; case 786: -#line 1525 "third_party/libpg_query/grammar/statements/select.y" +#line 1527 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); ;} break; case 787: -#line 1528 "third_party/libpg_query/grammar/statements/select.y" +#line 1530 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (4)].list); ;} break; case 788: -#line 1529 "third_party/libpg_query/grammar/statements/select.y" +#line 1531 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 789: -#line 1532 "third_party/libpg_query/grammar/statements/select.y" +#line 1534 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = true; ;} break; case 790: -#line 1533 "third_party/libpg_query/grammar/statements/select.y" +#line 1535 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 791: -#line 1538 "third_party/libpg_query/grammar/statements/select.y" +#line 1540 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 792: -#line 1539 "third_party/libpg_query/grammar/statements/select.y" +#line 1541 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 793: -#line 1545 "third_party/libpg_query/grammar/statements/select.y" +#line 1547 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 794: -#line 1549 "third_party/libpg_query/grammar/statements/select.y" +#line 1551 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 795: -#line 1555 "third_party/libpg_query/grammar/statements/select.y" +#line 1557 "third_party/libpg_query/grammar/statements/select.y" { PGColumnDef *n = makeNode(PGColumnDef); n->colname = (yyvsp[(1) - (3)].str); @@ -465717,7 +466113,7 @@ YYLTYPE yylloc; break; case 796: -#line 1576 "third_party/libpg_query/grammar/statements/select.y" +#line 1578 "third_party/libpg_query/grammar/statements/select.y" { PGCollateClause *n = makeNode(PGCollateClause); n->arg = NULL; @@ -465728,36 +466124,36 @@ YYLTYPE yylloc; break; case 797: -#line 1583 "third_party/libpg_query/grammar/statements/select.y" +#line 1585 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 798: -#line 1596 "third_party/libpg_query/grammar/statements/select.y" +#line 1598 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(list_make2(makeString((yyvsp[(1) - (2)].str)), (yyvsp[(2) - (2)].typnam))); ;} break; case 799: -#line 1599 "third_party/libpg_query/grammar/statements/select.y" +#line 1601 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (4)].list), list_make2(makeString((yyvsp[(3) - (4)].str)), (yyvsp[(4) - (4)].typnam))); ;} break; case 802: -#line 1606 "third_party/libpg_query/grammar/statements/select.y" +#line 1608 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 803: -#line 1607 "third_party/libpg_query/grammar/statements/select.y" +#line 1609 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = NULL; ;} break; case 804: -#line 1610 "third_party/libpg_query/grammar/statements/select.y" +#line 1612 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (2)].typnam); (yyval.typnam)->arrayBounds = (yyvsp[(2) - (2)].list); @@ -465765,7 +466161,7 @@ YYLTYPE yylloc; break; case 805: -#line 1615 "third_party/libpg_query/grammar/statements/select.y" +#line 1617 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(2) - (3)].typnam); (yyval.typnam)->arrayBounds = (yyvsp[(3) - (3)].list); @@ -465774,7 +466170,7 @@ YYLTYPE yylloc; break; case 806: -#line 1622 "third_party/libpg_query/grammar/statements/select.y" +#line 1624 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (5)].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[(4) - (5)].ival))); @@ -465782,7 +466178,7 @@ YYLTYPE yylloc; break; case 807: -#line 1627 "third_party/libpg_query/grammar/statements/select.y" +#line 1629 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(2) - (6)].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[(5) - (6)].ival))); @@ -465791,7 +466187,7 @@ YYLTYPE yylloc; break; case 808: -#line 1633 "third_party/libpg_query/grammar/statements/select.y" +#line 1635 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (2)].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); @@ -465799,7 +466195,7 @@ YYLTYPE yylloc; break; case 809: -#line 1638 "third_party/libpg_query/grammar/statements/select.y" +#line 1640 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(2) - (3)].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); @@ -465808,14 +466204,14 @@ YYLTYPE yylloc; break; case 810: -#line 1644 "third_party/libpg_query/grammar/statements/select.y" +#line 1646 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = makeTypeNameFromNameList((yyvsp[(1) - (1)].list)); ;} break; case 811: -#line 1648 "third_party/libpg_query/grammar/statements/select.y" +#line 1650 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("struct"); (yyval.typnam)->arrayBounds = (yyvsp[(5) - (5)].list); @@ -465825,7 +466221,7 @@ YYLTYPE yylloc; break; case 812: -#line 1655 "third_party/libpg_query/grammar/statements/select.y" +#line 1657 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("map"); (yyval.typnam)->arrayBounds = (yyvsp[(5) - (5)].list); @@ -465835,7 +466231,7 @@ YYLTYPE yylloc; break; case 813: -#line 1662 "third_party/libpg_query/grammar/statements/select.y" +#line 1664 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("union"); (yyval.typnam)->arrayBounds = (yyvsp[(5) - (5)].list); @@ -465845,57 +466241,57 @@ YYLTYPE yylloc; break; case 814: -#line 1671 "third_party/libpg_query/grammar/statements/select.y" +#line 1673 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2(makeString((yyvsp[(1) - (3)].str)), makeString((yyvsp[(3) - (3)].str))); ;} break; case 815: -#line 1672 "third_party/libpg_query/grammar/statements/select.y" +#line 1674 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeString((yyvsp[(3) - (3)].str))); ;} break; case 816: -#line 1677 "third_party/libpg_query/grammar/statements/select.y" +#line 1679 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeInteger(-1)); ;} break; case 817: -#line 1679 "third_party/libpg_query/grammar/statements/select.y" +#line 1681 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (4)].list), makeInteger((yyvsp[(3) - (4)].ival))); ;} break; case 818: -#line 1681 "third_party/libpg_query/grammar/statements/select.y" +#line 1683 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 819: -#line 1685 "third_party/libpg_query/grammar/statements/select.y" +#line 1687 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 820: -#line 1686 "third_party/libpg_query/grammar/statements/select.y" +#line 1688 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 821: -#line 1687 "third_party/libpg_query/grammar/statements/select.y" +#line 1689 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 822: -#line 1688 "third_party/libpg_query/grammar/statements/select.y" +#line 1690 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 823: -#line 1689 "third_party/libpg_query/grammar/statements/select.y" +#line 1691 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 824: -#line 1691 "third_party/libpg_query/grammar/statements/select.y" +#line 1693 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (2)].typnam); (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); @@ -465903,7 +466299,7 @@ YYLTYPE yylloc; break; case 825: -#line 1696 "third_party/libpg_query/grammar/statements/select.y" +#line 1698 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (4)].typnam); (yyval.typnam)->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), @@ -465912,27 +466308,27 @@ YYLTYPE yylloc; break; case 826: -#line 1715 "third_party/libpg_query/grammar/statements/select.y" +#line 1717 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 827: -#line 1716 "third_party/libpg_query/grammar/statements/select.y" +#line 1718 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 828: -#line 1717 "third_party/libpg_query/grammar/statements/select.y" +#line 1719 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 829: -#line 1718 "third_party/libpg_query/grammar/statements/select.y" +#line 1720 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 830: -#line 1730 "third_party/libpg_query/grammar/statements/select.y" +#line 1732 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = makeTypeName((yyvsp[(1) - (2)].str)); (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); @@ -465941,17 +466337,17 @@ YYLTYPE yylloc; break; case 831: -#line 1743 "third_party/libpg_query/grammar/statements/select.y" +#line 1745 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (3)].list); ;} break; case 832: -#line 1744 "third_party/libpg_query/grammar/statements/select.y" +#line 1746 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 833: -#line 1751 "third_party/libpg_query/grammar/statements/select.y" +#line 1753 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[(1) - (1)]); @@ -465959,7 +466355,7 @@ YYLTYPE yylloc; break; case 834: -#line 1756 "third_party/libpg_query/grammar/statements/select.y" +#line 1758 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[(1) - (1)]); @@ -465967,7 +466363,7 @@ YYLTYPE yylloc; break; case 835: -#line 1761 "third_party/libpg_query/grammar/statements/select.y" +#line 1763 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[(1) - (1)]); @@ -465975,7 +466371,7 @@ YYLTYPE yylloc; break; case 836: -#line 1766 "third_party/libpg_query/grammar/statements/select.y" +#line 1768 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[(1) - (1)]); @@ -465983,7 +466379,7 @@ YYLTYPE yylloc; break; case 837: -#line 1771 "third_party/libpg_query/grammar/statements/select.y" +#line 1773 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[(1) - (1)]); @@ -465991,7 +466387,7 @@ YYLTYPE yylloc; break; case 838: -#line 1776 "third_party/libpg_query/grammar/statements/select.y" +#line 1778 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(2) - (2)].typnam); (yyval.typnam)->location = (yylsp[(1) - (2)]); @@ -465999,7 +466395,7 @@ YYLTYPE yylloc; break; case 839: -#line 1781 "third_party/libpg_query/grammar/statements/select.y" +#line 1783 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[(1) - (2)]); @@ -466007,7 +466403,7 @@ YYLTYPE yylloc; break; case 840: -#line 1786 "third_party/libpg_query/grammar/statements/select.y" +#line 1788 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); @@ -466016,7 +466412,7 @@ YYLTYPE yylloc; break; case 841: -#line 1792 "third_party/libpg_query/grammar/statements/select.y" +#line 1794 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); @@ -466025,7 +466421,7 @@ YYLTYPE yylloc; break; case 842: -#line 1798 "third_party/libpg_query/grammar/statements/select.y" +#line 1800 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); @@ -466034,7 +466430,7 @@ YYLTYPE yylloc; break; case 843: -#line 1804 "third_party/libpg_query/grammar/statements/select.y" +#line 1806 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[(1) - (1)]); @@ -466042,7 +466438,7 @@ YYLTYPE yylloc; break; case 844: -#line 1811 "third_party/libpg_query/grammar/statements/select.y" +#line 1813 "third_party/libpg_query/grammar/statements/select.y" { /* * Check FLOAT() precision limits assuming IEEE floating @@ -466066,35 +466462,35 @@ YYLTYPE yylloc; break; case 845: -#line 1832 "third_party/libpg_query/grammar/statements/select.y" +#line 1834 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("float4"); ;} break; case 846: -#line 1842 "third_party/libpg_query/grammar/statements/select.y" +#line 1844 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 847: -#line 1846 "third_party/libpg_query/grammar/statements/select.y" +#line 1848 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 848: -#line 1854 "third_party/libpg_query/grammar/statements/select.y" +#line 1856 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 849: -#line 1858 "third_party/libpg_query/grammar/statements/select.y" +#line 1860 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); (yyval.typnam)->typmods = NIL; @@ -466102,7 +466498,7 @@ YYLTYPE yylloc; break; case 850: -#line 1866 "third_party/libpg_query/grammar/statements/select.y" +#line 1868 "third_party/libpg_query/grammar/statements/select.y" { const char *typname; @@ -466114,7 +466510,7 @@ YYLTYPE yylloc; break; case 851: -#line 1878 "third_party/libpg_query/grammar/statements/select.y" +#line 1880 "third_party/libpg_query/grammar/statements/select.y" { /* bit defaults to bit(1), varbit to no limit */ if ((yyvsp[(2) - (2)].boolean)) @@ -466131,28 +466527,28 @@ YYLTYPE yylloc; break; case 852: -#line 1899 "third_party/libpg_query/grammar/statements/select.y" +#line 1901 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 853: -#line 1903 "third_party/libpg_query/grammar/statements/select.y" +#line 1905 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 854: -#line 1909 "third_party/libpg_query/grammar/statements/select.y" +#line 1911 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} break; case 855: -#line 1913 "third_party/libpg_query/grammar/statements/select.y" +#line 1915 "third_party/libpg_query/grammar/statements/select.y" { /* Length was not specified so allow to be unrestricted. * This handles problems with fixed-length (bpchar) strings @@ -466166,7 +466562,7 @@ YYLTYPE yylloc; break; case 856: -#line 1926 "third_party/libpg_query/grammar/statements/select.y" +#line 1928 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName((yyvsp[(1) - (4)].conststr)); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[(3) - (4)].ival), (yylsp[(3) - (4)]))); @@ -466175,7 +466571,7 @@ YYLTYPE yylloc; break; case 857: -#line 1934 "third_party/libpg_query/grammar/statements/select.y" +#line 1936 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName((yyvsp[(1) - (1)].conststr)); /* char defaults to char(1), varchar to no limit */ @@ -466186,47 +466582,47 @@ YYLTYPE yylloc; break; case 858: -#line 1944 "third_party/libpg_query/grammar/statements/select.y" +#line 1946 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = (yyvsp[(2) - (2)].boolean) ? "varchar": "bpchar"; ;} break; case 859: -#line 1946 "third_party/libpg_query/grammar/statements/select.y" +#line 1948 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = (yyvsp[(2) - (2)].boolean) ? "varchar": "bpchar"; ;} break; case 860: -#line 1948 "third_party/libpg_query/grammar/statements/select.y" +#line 1950 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "varchar"; ;} break; case 861: -#line 1950 "third_party/libpg_query/grammar/statements/select.y" +#line 1952 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = (yyvsp[(3) - (3)].boolean) ? "varchar": "bpchar"; ;} break; case 862: -#line 1952 "third_party/libpg_query/grammar/statements/select.y" +#line 1954 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = (yyvsp[(3) - (3)].boolean) ? "varchar": "bpchar"; ;} break; case 863: -#line 1954 "third_party/libpg_query/grammar/statements/select.y" +#line 1956 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = (yyvsp[(2) - (2)].boolean) ? "varchar": "bpchar"; ;} break; case 864: -#line 1958 "third_party/libpg_query/grammar/statements/select.y" +#line 1960 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = true; ;} break; case 865: -#line 1959 "third_party/libpg_query/grammar/statements/select.y" +#line 1961 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 866: -#line 1967 "third_party/libpg_query/grammar/statements/select.y" +#line 1969 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(5) - (5)].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); @@ -466238,7 +466634,7 @@ YYLTYPE yylloc; break; case 867: -#line 1976 "third_party/libpg_query/grammar/statements/select.y" +#line 1978 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(2) - (2)].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); @@ -466249,7 +466645,7 @@ YYLTYPE yylloc; break; case 868: -#line 1984 "third_party/libpg_query/grammar/statements/select.y" +#line 1986 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(5) - (5)].boolean)) (yyval.typnam) = SystemTypeName("timetz"); @@ -466261,7 +466657,7 @@ YYLTYPE yylloc; break; case 869: -#line 1993 "third_party/libpg_query/grammar/statements/select.y" +#line 1995 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(2) - (2)].boolean)) (yyval.typnam) = SystemTypeName("timetz"); @@ -466272,7 +466668,7 @@ YYLTYPE yylloc; break; case 870: -#line 2004 "third_party/libpg_query/grammar/statements/select.y" +#line 2006 "third_party/libpg_query/grammar/statements/select.y" { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[(1) - (1)]); @@ -466280,87 +466676,87 @@ YYLTYPE yylloc; break; case 871: -#line 2011 "third_party/libpg_query/grammar/statements/select.y" +#line 2013 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = true; ;} break; case 872: -#line 2012 "third_party/libpg_query/grammar/statements/select.y" +#line 2014 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 873: -#line 2013 "third_party/libpg_query/grammar/statements/select.y" +#line 2015 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 900: -#line 2057 "third_party/libpg_query/grammar/statements/select.y" +#line 2059 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[(1) - (1)]))); ;} break; case 901: -#line 2059 "third_party/libpg_query/grammar/statements/select.y" +#line 2061 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[(1) - (1)]))); ;} break; case 902: -#line 2061 "third_party/libpg_query/grammar/statements/select.y" +#line 2063 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[(1) - (1)]))); ;} break; case 903: -#line 2063 "third_party/libpg_query/grammar/statements/select.y" +#line 2065 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[(1) - (1)]))); ;} break; case 904: -#line 2065 "third_party/libpg_query/grammar/statements/select.y" +#line 2067 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[(1) - (1)]))); ;} break; case 905: -#line 2067 "third_party/libpg_query/grammar/statements/select.y" +#line 2069 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[(1) - (1)]))); ;} break; case 906: -#line 2069 "third_party/libpg_query/grammar/statements/select.y" +#line 2071 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MILLISECOND), (yylsp[(1) - (1)]))); ;} break; case 907: -#line 2071 "third_party/libpg_query/grammar/statements/select.y" +#line 2073 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MICROSECOND), (yylsp[(1) - (1)]))); ;} break; case 908: -#line 2073 "third_party/libpg_query/grammar/statements/select.y" +#line 2075 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(WEEK), (yylsp[(1) - (1)]))); ;} break; case 909: -#line 2075 "third_party/libpg_query/grammar/statements/select.y" +#line 2077 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(QUARTER), (yylsp[(1) - (1)]))); ;} break; case 910: -#line 2077 "third_party/libpg_query/grammar/statements/select.y" +#line 2079 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DECADE), (yylsp[(1) - (1)]))); ;} break; case 911: -#line 2079 "third_party/libpg_query/grammar/statements/select.y" +#line 2081 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(CENTURY), (yylsp[(1) - (1)]))); ;} break; case 912: -#line 2081 "third_party/libpg_query/grammar/statements/select.y" +#line 2083 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MILLENNIUM), (yylsp[(1) - (1)]))); ;} break; case 913: -#line 2083 "third_party/libpg_query/grammar/statements/select.y" +#line 2085 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[(1) - (3)]))); @@ -466368,7 +466764,7 @@ YYLTYPE yylloc; break; case 914: -#line 2088 "third_party/libpg_query/grammar/statements/select.y" +#line 2090 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[(1) - (3)]))); @@ -466376,7 +466772,7 @@ YYLTYPE yylloc; break; case 915: -#line 2093 "third_party/libpg_query/grammar/statements/select.y" +#line 2095 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | @@ -466385,7 +466781,7 @@ YYLTYPE yylloc; break; case 916: -#line 2099 "third_party/libpg_query/grammar/statements/select.y" +#line 2101 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | @@ -466395,7 +466791,7 @@ YYLTYPE yylloc; break; case 917: -#line 2106 "third_party/libpg_query/grammar/statements/select.y" +#line 2108 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[(1) - (3)]))); @@ -466403,7 +466799,7 @@ YYLTYPE yylloc; break; case 918: -#line 2111 "third_party/libpg_query/grammar/statements/select.y" +#line 2113 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | @@ -466412,7 +466808,7 @@ YYLTYPE yylloc; break; case 919: -#line 2117 "third_party/libpg_query/grammar/statements/select.y" +#line 2119 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[(1) - (3)]))); @@ -466420,22 +466816,22 @@ YYLTYPE yylloc; break; case 920: -#line 2122 "third_party/libpg_query/grammar/statements/select.y" +#line 2124 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 921: -#line 2153 "third_party/libpg_query/grammar/statements/select.y" +#line 2155 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 922: -#line 2156 "third_party/libpg_query/grammar/statements/select.y" +#line 2158 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeTypeCast((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].typnam), 0, (yylsp[(2) - (3)])); ;} break; case 923: -#line 2158 "third_party/libpg_query/grammar/statements/select.y" +#line 2160 "third_party/libpg_query/grammar/statements/select.y" { PGCollateClause *n = makeNode(PGCollateClause); n->arg = (yyvsp[(1) - (3)].node); @@ -466446,7 +466842,7 @@ YYLTYPE yylloc; break; case 924: -#line 2166 "third_party/libpg_query/grammar/statements/select.y" +#line 2168 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[(5) - (5)].node), (yyvsp[(1) - (5)].node)), @@ -466455,122 +466851,122 @@ YYLTYPE yylloc; break; case 925: -#line 2181 "third_party/libpg_query/grammar/statements/select.y" +#line 2183 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 926: -#line 2183 "third_party/libpg_query/grammar/statements/select.y" +#line 2185 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = doNegate((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 927: -#line 2185 "third_party/libpg_query/grammar/statements/select.y" +#line 2187 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 928: -#line 2187 "third_party/libpg_query/grammar/statements/select.y" +#line 2189 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "-", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 929: -#line 2189 "third_party/libpg_query/grammar/statements/select.y" +#line 2191 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "*", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 930: -#line 2191 "third_party/libpg_query/grammar/statements/select.y" +#line 2193 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "/", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 931: -#line 2193 "third_party/libpg_query/grammar/statements/select.y" +#line 2195 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "//", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 932: -#line 2195 "third_party/libpg_query/grammar/statements/select.y" +#line 2197 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "%", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 933: -#line 2197 "third_party/libpg_query/grammar/statements/select.y" +#line 2199 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "^", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 934: -#line 2199 "third_party/libpg_query/grammar/statements/select.y" +#line 2201 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "**", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 935: -#line 2201 "third_party/libpg_query/grammar/statements/select.y" +#line 2203 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 936: -#line 2203 "third_party/libpg_query/grammar/statements/select.y" +#line 2205 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 937: -#line 2205 "third_party/libpg_query/grammar/statements/select.y" +#line 2207 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 938: -#line 2207 "third_party/libpg_query/grammar/statements/select.y" +#line 2209 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 939: -#line 2209 "third_party/libpg_query/grammar/statements/select.y" +#line 2211 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 940: -#line 2211 "third_party/libpg_query/grammar/statements/select.y" +#line 2213 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<>", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 941: -#line 2214 "third_party/libpg_query/grammar/statements/select.y" +#line 2216 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (3)].list), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 942: -#line 2216 "third_party/libpg_query/grammar/statements/select.y" +#line 2218 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(1) - (2)].list), NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 943: -#line 2218 "third_party/libpg_query/grammar/statements/select.y" +#line 2220 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (2)].list), (yyvsp[(1) - (2)].node), NULL, (yylsp[(2) - (2)])); ;} break; case 944: -#line 2221 "third_party/libpg_query/grammar/statements/select.y" +#line 2223 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeAndExpr((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 945: -#line 2223 "third_party/libpg_query/grammar/statements/select.y" +#line 2225 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeOrExpr((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 946: -#line 2225 "third_party/libpg_query/grammar/statements/select.y" +#line 2227 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeNotExpr((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 947: -#line 2227 "third_party/libpg_query/grammar/statements/select.y" +#line 2229 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeNotExpr((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 948: -#line 2229 "third_party/libpg_query/grammar/statements/select.y" +#line 2231 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_GLOB, "~~~", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); @@ -466578,7 +466974,7 @@ YYLTYPE yylloc; break; case 949: -#line 2234 "third_party/libpg_query/grammar/statements/select.y" +#line 2236 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_LIKE, "~~", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); @@ -466586,7 +466982,7 @@ YYLTYPE yylloc; break; case 950: -#line 2239 "third_party/libpg_query/grammar/statements/select.y" +#line 2241 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make3((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)), @@ -466596,7 +466992,7 @@ YYLTYPE yylloc; break; case 951: -#line 2246 "third_party/libpg_query/grammar/statements/select.y" +#line 2248 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_LIKE, "!~~", (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node), (yylsp[(2) - (4)])); @@ -466604,7 +467000,7 @@ YYLTYPE yylloc; break; case 952: -#line 2251 "third_party/libpg_query/grammar/statements/select.y" +#line 2253 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("not_like_escape"), list_make3((yyvsp[(1) - (6)].node), (yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), @@ -466614,7 +467010,7 @@ YYLTYPE yylloc; break; case 953: -#line 2258 "third_party/libpg_query/grammar/statements/select.y" +#line 2260 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_ILIKE, "~~*", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); @@ -466622,7 +467018,7 @@ YYLTYPE yylloc; break; case 954: -#line 2263 "third_party/libpg_query/grammar/statements/select.y" +#line 2265 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("ilike_escape"), list_make3((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)), @@ -466632,7 +467028,7 @@ YYLTYPE yylloc; break; case 955: -#line 2270 "third_party/libpg_query/grammar/statements/select.y" +#line 2272 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_ILIKE, "!~~*", (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node), (yylsp[(2) - (4)])); @@ -466640,7 +467036,7 @@ YYLTYPE yylloc; break; case 956: -#line 2275 "third_party/libpg_query/grammar/statements/select.y" +#line 2277 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("not_ilike_escape"), list_make3((yyvsp[(1) - (6)].node), (yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), @@ -466650,7 +467046,7 @@ YYLTYPE yylloc; break; case 957: -#line 2283 "third_party/libpg_query/grammar/statements/select.y" +#line 2285 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[(4) - (4)].node), makeNullAConst(-1)), @@ -466661,7 +467057,7 @@ YYLTYPE yylloc; break; case 958: -#line 2291 "third_party/libpg_query/grammar/statements/select.y" +#line 2293 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), @@ -466672,7 +467068,7 @@ YYLTYPE yylloc; break; case 959: -#line 2299 "third_party/libpg_query/grammar/statements/select.y" +#line 2301 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[(5) - (5)].node), makeNullAConst(-1)), @@ -466683,7 +467079,7 @@ YYLTYPE yylloc; break; case 960: -#line 2307 "third_party/libpg_query/grammar/statements/select.y" +#line 2309 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[(5) - (7)].node), (yyvsp[(7) - (7)].node)), @@ -466694,7 +467090,7 @@ YYLTYPE yylloc; break; case 961: -#line 2325 "third_party/libpg_query/grammar/statements/select.y" +#line 2327 "third_party/libpg_query/grammar/statements/select.y" { PGNullTest *n = makeNode(PGNullTest); n->arg = (PGExpr *) (yyvsp[(1) - (3)].node); @@ -466705,7 +467101,7 @@ YYLTYPE yylloc; break; case 962: -#line 2333 "third_party/libpg_query/grammar/statements/select.y" +#line 2335 "third_party/libpg_query/grammar/statements/select.y" { PGNullTest *n = makeNode(PGNullTest); n->arg = (PGExpr *) (yyvsp[(1) - (2)].node); @@ -466716,7 +467112,7 @@ YYLTYPE yylloc; break; case 963: -#line 2341 "third_party/libpg_query/grammar/statements/select.y" +#line 2343 "third_party/libpg_query/grammar/statements/select.y" { PGNullTest *n = makeNode(PGNullTest); n->arg = (PGExpr *) (yyvsp[(1) - (4)].node); @@ -466727,7 +467123,7 @@ YYLTYPE yylloc; break; case 964: -#line 2349 "third_party/libpg_query/grammar/statements/select.y" +#line 2351 "third_party/libpg_query/grammar/statements/select.y" { PGNullTest *n = makeNode(PGNullTest); n->arg = (PGExpr *) (yyvsp[(1) - (3)].node); @@ -466738,7 +467134,7 @@ YYLTYPE yylloc; break; case 965: -#line 2357 "third_party/libpg_query/grammar/statements/select.y" +#line 2359 "third_party/libpg_query/grammar/statements/select.y" { PGNullTest *n = makeNode(PGNullTest); n->arg = (PGExpr *) (yyvsp[(1) - (2)].node); @@ -466749,7 +467145,7 @@ YYLTYPE yylloc; break; case 966: -#line 2365 "third_party/libpg_query/grammar/statements/select.y" +#line 2367 "third_party/libpg_query/grammar/statements/select.y" { PGLambdaFunction *n = makeNode(PGLambdaFunction); n->lhs = (yyvsp[(1) - (3)].node); @@ -466760,14 +467156,14 @@ YYLTYPE yylloc; break; case 967: -#line 2373 "third_party/libpg_query/grammar/statements/select.y" +#line 2375 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "->>", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 968: -#line 2377 "third_party/libpg_query/grammar/statements/select.y" +#line 2379 "third_party/libpg_query/grammar/statements/select.y" { if (list_length((yyvsp[(1) - (3)].list)) != 2) ereport(ERROR, @@ -466786,7 +467182,7 @@ YYLTYPE yylloc; break; case 969: -#line 2393 "third_party/libpg_query/grammar/statements/select.y" +#line 2395 "third_party/libpg_query/grammar/statements/select.y" { PGBooleanTest *b = makeNode(PGBooleanTest); b->arg = (PGExpr *) (yyvsp[(1) - (3)].node); @@ -466797,7 +467193,7 @@ YYLTYPE yylloc; break; case 970: -#line 2401 "third_party/libpg_query/grammar/statements/select.y" +#line 2403 "third_party/libpg_query/grammar/statements/select.y" { PGBooleanTest *b = makeNode(PGBooleanTest); b->arg = (PGExpr *) (yyvsp[(1) - (4)].node); @@ -466808,7 +467204,7 @@ YYLTYPE yylloc; break; case 971: -#line 2409 "third_party/libpg_query/grammar/statements/select.y" +#line 2411 "third_party/libpg_query/grammar/statements/select.y" { PGBooleanTest *b = makeNode(PGBooleanTest); b->arg = (PGExpr *) (yyvsp[(1) - (3)].node); @@ -466819,7 +467215,7 @@ YYLTYPE yylloc; break; case 972: -#line 2417 "third_party/libpg_query/grammar/statements/select.y" +#line 2419 "third_party/libpg_query/grammar/statements/select.y" { PGBooleanTest *b = makeNode(PGBooleanTest); b->arg = (PGExpr *) (yyvsp[(1) - (4)].node); @@ -466830,7 +467226,7 @@ YYLTYPE yylloc; break; case 973: -#line 2425 "third_party/libpg_query/grammar/statements/select.y" +#line 2427 "third_party/libpg_query/grammar/statements/select.y" { PGBooleanTest *b = makeNode(PGBooleanTest); b->arg = (PGExpr *) (yyvsp[(1) - (3)].node); @@ -466841,7 +467237,7 @@ YYLTYPE yylloc; break; case 974: -#line 2433 "third_party/libpg_query/grammar/statements/select.y" +#line 2435 "third_party/libpg_query/grammar/statements/select.y" { PGBooleanTest *b = makeNode(PGBooleanTest); b->arg = (PGExpr *) (yyvsp[(1) - (4)].node); @@ -466852,35 +467248,35 @@ YYLTYPE yylloc; break; case 975: -#line 2441 "third_party/libpg_query/grammar/statements/select.y" +#line 2443 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_DISTINCT, "=", (yyvsp[(1) - (5)].node), (yyvsp[(5) - (5)].node), (yylsp[(2) - (5)])); ;} break; case 976: -#line 2445 "third_party/libpg_query/grammar/statements/select.y" +#line 2447 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_DISTINCT, "=", (yyvsp[(1) - (6)].node), (yyvsp[(6) - (6)].node), (yylsp[(2) - (6)])); ;} break; case 977: -#line 2449 "third_party/libpg_query/grammar/statements/select.y" +#line 2451 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "=", (yyvsp[(1) - (6)].node), (PGNode *) (yyvsp[(5) - (6)].list), (yylsp[(2) - (6)])); ;} break; case 978: -#line 2453 "third_party/libpg_query/grammar/statements/select.y" +#line 2455 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "<>", (yyvsp[(1) - (7)].node), (PGNode *) (yyvsp[(6) - (7)].list), (yylsp[(2) - (7)])); ;} break; case 979: -#line 2457 "third_party/libpg_query/grammar/statements/select.y" +#line 2459 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_BETWEEN, "BETWEEN", @@ -466891,7 +467287,7 @@ YYLTYPE yylloc; break; case 980: -#line 2465 "third_party/libpg_query/grammar/statements/select.y" +#line 2467 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_BETWEEN, "NOT BETWEEN", @@ -466902,7 +467298,7 @@ YYLTYPE yylloc; break; case 981: -#line 2473 "third_party/libpg_query/grammar/statements/select.y" +#line 2475 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_BETWEEN_SYM, "BETWEEN SYMMETRIC", @@ -466913,7 +467309,7 @@ YYLTYPE yylloc; break; case 982: -#line 2481 "third_party/libpg_query/grammar/statements/select.y" +#line 2483 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_BETWEEN_SYM, "NOT BETWEEN SYMMETRIC", @@ -466924,7 +467320,7 @@ YYLTYPE yylloc; break; case 983: -#line 2489 "third_party/libpg_query/grammar/statements/select.y" +#line 2491 "third_party/libpg_query/grammar/statements/select.y" { /* in_expr returns a PGSubLink or a list of a_exprs */ if (IsA((yyvsp[(3) - (3)].node), PGSubLink)) @@ -466947,7 +467343,7 @@ YYLTYPE yylloc; break; case 984: -#line 2509 "third_party/libpg_query/grammar/statements/select.y" +#line 2511 "third_party/libpg_query/grammar/statements/select.y" { /* in_expr returns a PGSubLink or a list of a_exprs */ if (IsA((yyvsp[(4) - (4)].node), PGSubLink)) @@ -466972,7 +467368,7 @@ YYLTYPE yylloc; break; case 985: -#line 2531 "third_party/libpg_query/grammar/statements/select.y" +#line 2533 "third_party/libpg_query/grammar/statements/select.y" { PGSubLink *n = makeNode(PGSubLink); n->subLinkType = (yyvsp[(3) - (4)].subquerytype); @@ -466986,7 +467382,7 @@ YYLTYPE yylloc; break; case 986: -#line 2542 "third_party/libpg_query/grammar/statements/select.y" +#line 2544 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(3) - (6)].subquerytype) == PG_ANY_SUBLINK) (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP_ANY, (yyvsp[(2) - (6)].list), (yyvsp[(1) - (6)].node), (yyvsp[(5) - (6)].node), (yylsp[(2) - (6)])); @@ -466996,7 +467392,7 @@ YYLTYPE yylloc; break; case 987: -#line 2549 "third_party/libpg_query/grammar/statements/select.y" +#line 2551 "third_party/libpg_query/grammar/statements/select.y" { /* * The SQL spec only allows DEFAULT in "contextually typed @@ -467013,7 +467409,7 @@ YYLTYPE yylloc; break; case 988: -#line 2563 "third_party/libpg_query/grammar/statements/select.y" +#line 2565 "third_party/libpg_query/grammar/statements/select.y" { PGAStar *star = makeNode(PGAStar); star->expr = (yyvsp[(4) - (5)].node); @@ -467025,7 +467421,7 @@ YYLTYPE yylloc; break; case 989: -#line 2572 "third_party/libpg_query/grammar/statements/select.y" +#line 2574 "third_party/libpg_query/grammar/statements/select.y" { PGAStar *star = makeNode(PGAStar); star->expr = (yyvsp[(3) - (4)].node); @@ -467036,7 +467432,7 @@ YYLTYPE yylloc; break; case 990: -#line 2580 "third_party/libpg_query/grammar/statements/select.y" +#line 2582 "third_party/libpg_query/grammar/statements/select.y" { PGAStar *star = makeNode(PGAStar); star->except_list = (yyvsp[(2) - (3)].list); @@ -467047,7 +467443,7 @@ YYLTYPE yylloc; break; case 991: -#line 2588 "third_party/libpg_query/grammar/statements/select.y" +#line 2590 "third_party/libpg_query/grammar/statements/select.y" { PGAStar *star = makeNode(PGAStar); star->relation = (yyvsp[(1) - (5)].str); @@ -467059,140 +467455,140 @@ YYLTYPE yylloc; break; case 992: -#line 2608 "third_party/libpg_query/grammar/statements/select.y" +#line 2610 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 993: -#line 2610 "third_party/libpg_query/grammar/statements/select.y" +#line 2612 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeTypeCast((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].typnam), 0, (yylsp[(2) - (3)])); ;} break; case 994: -#line 2612 "third_party/libpg_query/grammar/statements/select.y" +#line 2614 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 995: -#line 2614 "third_party/libpg_query/grammar/statements/select.y" +#line 2616 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = doNegate((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 996: -#line 2616 "third_party/libpg_query/grammar/statements/select.y" +#line 2618 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 997: -#line 2618 "third_party/libpg_query/grammar/statements/select.y" +#line 2620 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "-", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 998: -#line 2620 "third_party/libpg_query/grammar/statements/select.y" +#line 2622 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "*", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 999: -#line 2622 "third_party/libpg_query/grammar/statements/select.y" +#line 2624 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "/", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1000: -#line 2624 "third_party/libpg_query/grammar/statements/select.y" +#line 2626 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "//", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1001: -#line 2626 "third_party/libpg_query/grammar/statements/select.y" +#line 2628 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "%", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1002: -#line 2628 "third_party/libpg_query/grammar/statements/select.y" +#line 2630 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "^", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1003: -#line 2630 "third_party/libpg_query/grammar/statements/select.y" +#line 2632 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "**", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1004: -#line 2632 "third_party/libpg_query/grammar/statements/select.y" +#line 2634 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1005: -#line 2634 "third_party/libpg_query/grammar/statements/select.y" +#line 2636 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1006: -#line 2636 "third_party/libpg_query/grammar/statements/select.y" +#line 2638 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1007: -#line 2638 "third_party/libpg_query/grammar/statements/select.y" +#line 2640 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1008: -#line 2640 "third_party/libpg_query/grammar/statements/select.y" +#line 2642 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1009: -#line 2642 "third_party/libpg_query/grammar/statements/select.y" +#line 2644 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<>", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1010: -#line 2644 "third_party/libpg_query/grammar/statements/select.y" +#line 2646 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (3)].list), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} break; case 1011: -#line 2646 "third_party/libpg_query/grammar/statements/select.y" +#line 2648 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(1) - (2)].list), NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} break; case 1012: -#line 2648 "third_party/libpg_query/grammar/statements/select.y" +#line 2650 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (2)].list), (yyvsp[(1) - (2)].node), NULL, (yylsp[(2) - (2)])); ;} break; case 1013: -#line 2650 "third_party/libpg_query/grammar/statements/select.y" +#line 2652 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_DISTINCT, "=", (yyvsp[(1) - (5)].node), (yyvsp[(5) - (5)].node), (yylsp[(2) - (5)])); ;} break; case 1014: -#line 2654 "third_party/libpg_query/grammar/statements/select.y" +#line 2656 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_DISTINCT, "=", (yyvsp[(1) - (6)].node), (yyvsp[(6) - (6)].node), (yylsp[(2) - (6)])); ;} break; case 1015: -#line 2658 "third_party/libpg_query/grammar/statements/select.y" +#line 2660 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "=", (yyvsp[(1) - (6)].node), (PGNode *) (yyvsp[(5) - (6)].list), (yylsp[(2) - (6)])); ;} break; case 1016: -#line 2662 "third_party/libpg_query/grammar/statements/select.y" +#line 2664 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "<>", (yyvsp[(1) - (7)].node), (PGNode *) (yyvsp[(6) - (7)].list), (yylsp[(2) - (7)])); ;} break; case 1018: -#line 2677 "third_party/libpg_query/grammar/statements/select.y" +#line 2679 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(2) - (2)].list)) { @@ -467207,17 +467603,17 @@ YYLTYPE yylloc; break; case 1019: -#line 2690 "third_party/libpg_query/grammar/statements/select.y" +#line 2692 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1020: -#line 2691 "third_party/libpg_query/grammar/statements/select.y" +#line 2693 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1021: -#line 2693 "third_party/libpg_query/grammar/statements/select.y" +#line 2695 "third_party/libpg_query/grammar/statements/select.y" { PGSubLink *n = makeNode(PGSubLink); n->subLinkType = PG_EXPR_SUBLINK; @@ -467231,7 +467627,7 @@ YYLTYPE yylloc; break; case 1022: -#line 2704 "third_party/libpg_query/grammar/statements/select.y" +#line 2706 "third_party/libpg_query/grammar/statements/select.y" { /* * Because the select_with_parens nonterminal is designed @@ -467258,7 +467654,7 @@ YYLTYPE yylloc; break; case 1023: -#line 2728 "third_party/libpg_query/grammar/statements/select.y" +#line 2730 "third_party/libpg_query/grammar/statements/select.y" { PGSubLink *n = makeNode(PGSubLink); n->subLinkType = PG_EXISTS_SUBLINK; @@ -467272,7 +467668,7 @@ YYLTYPE yylloc; break; case 1024: -#line 2739 "third_party/libpg_query/grammar/statements/select.y" +#line 2741 "third_party/libpg_query/grammar/statements/select.y" { PGGroupingFunc *g = makeNode(PGGroupingFunc); g->args = (yyvsp[(3) - (4)].list); @@ -467282,21 +467678,21 @@ YYLTYPE yylloc; break; case 1025: -#line 2749 "third_party/libpg_query/grammar/statements/select.y" +#line 2751 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (3)].node); ;} break; case 1026: -#line 2753 "third_party/libpg_query/grammar/statements/select.y" +#line 2755 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1027: -#line 2756 "third_party/libpg_query/grammar/statements/select.y" +#line 2758 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("row"), (yyvsp[(1) - (1)].list), (yylsp[(1) - (1)])); (yyval.node) = (PGNode *) n; @@ -467304,14 +467700,14 @@ YYLTYPE yylloc; break; case 1028: -#line 2764 "third_party/libpg_query/grammar/statements/select.y" +#line 2766 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeParamRef(0, (yylsp[(1) - (1)])); ;} break; case 1029: -#line 2768 "third_party/libpg_query/grammar/statements/select.y" +#line 2770 "third_party/libpg_query/grammar/statements/select.y" { PGParamRef *p = makeNode(PGParamRef); p->number = (yyvsp[(1) - (1)].ival); @@ -467321,47 +467717,47 @@ YYLTYPE yylloc; break; case 1030: -#line 2775 "third_party/libpg_query/grammar/statements/select.y" +#line 2777 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1031: -#line 2779 "third_party/libpg_query/grammar/statements/select.y" +#line 2781 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1032: -#line 2783 "third_party/libpg_query/grammar/statements/select.y" +#line 2785 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1033: -#line 2787 "third_party/libpg_query/grammar/statements/select.y" +#line 2789 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1034: -#line 2788 "third_party/libpg_query/grammar/statements/select.y" +#line 2790 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1035: -#line 2791 "third_party/libpg_query/grammar/statements/select.y" +#line 2793 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1036: -#line 2795 "third_party/libpg_query/grammar/statements/select.y" +#line 2797 "third_party/libpg_query/grammar/statements/select.y" { PGSubLink *n = makeNode(PGSubLink); n->subLinkType = PG_ARRAY_SUBLINK; @@ -467375,7 +467771,7 @@ YYLTYPE yylloc; break; case 1037: -#line 2805 "third_party/libpg_query/grammar/statements/select.y" +#line 2807 "third_party/libpg_query/grammar/statements/select.y" { PGList *func_name = list_make1(makeString("construct_array")); PGFuncCall *n = makeFuncCall(func_name, (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); @@ -467384,7 +467780,7 @@ YYLTYPE yylloc; break; case 1038: -#line 2811 "third_party/libpg_query/grammar/statements/select.y" +#line 2813 "third_party/libpg_query/grammar/statements/select.y" { PGPositionalReference *n = makeNode(PGPositionalReference); n->position = (yyvsp[(2) - (2)].ival); @@ -467394,14 +467790,14 @@ YYLTYPE yylloc; break; case 1039: -#line 2818 "third_party/libpg_query/grammar/statements/select.y" +#line 2820 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeNamedParamRef((yyvsp[(2) - (2)].str), (yylsp[(1) - (2)])); ;} break; case 1040: -#line 2823 "third_party/libpg_query/grammar/statements/select.y" +#line 2825 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("list_value"), (yyvsp[(2) - (3)].list), (yylsp[(2) - (3)])); (yyval.node) = (PGNode *) n; @@ -467409,7 +467805,7 @@ YYLTYPE yylloc; break; case 1041: -#line 2830 "third_party/libpg_query/grammar/statements/select.y" +#line 2832 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *f = makeFuncCall(SystemFuncName("struct_pack"), (yyvsp[(2) - (3)].list), (yylsp[(2) - (3)])); (yyval.node) = (PGNode *) f; @@ -467417,7 +467813,7 @@ YYLTYPE yylloc; break; case 1042: -#line 2837 "third_party/libpg_query/grammar/statements/select.y" +#line 2839 "third_party/libpg_query/grammar/statements/select.y" { PGList *key_list = NULL; PGList *value_list = NULL; @@ -467437,14 +467833,14 @@ YYLTYPE yylloc; break; case 1043: -#line 2857 "third_party/libpg_query/grammar/statements/select.y" +#line 2859 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeFuncCall((yyvsp[(1) - (3)].list), NIL, (yylsp[(1) - (3)])); ;} break; case 1044: -#line 2861 "third_party/libpg_query/grammar/statements/select.y" +#line 2863 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall((yyvsp[(1) - (6)].list), (yyvsp[(3) - (6)].list), (yylsp[(1) - (6)])); n->agg_order = (yyvsp[(4) - (6)].list); @@ -467454,7 +467850,7 @@ YYLTYPE yylloc; break; case 1045: -#line 2868 "third_party/libpg_query/grammar/statements/select.y" +#line 2870 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall((yyvsp[(1) - (7)].list), list_make1((yyvsp[(4) - (7)].node)), (yylsp[(1) - (7)])); n->func_variadic = true; @@ -467465,7 +467861,7 @@ YYLTYPE yylloc; break; case 1046: -#line 2876 "third_party/libpg_query/grammar/statements/select.y" +#line 2878 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall((yyvsp[(1) - (9)].list), lappend((yyvsp[(3) - (9)].list), (yyvsp[(6) - (9)].node)), (yylsp[(1) - (9)])); n->func_variadic = true; @@ -467476,7 +467872,7 @@ YYLTYPE yylloc; break; case 1047: -#line 2884 "third_party/libpg_query/grammar/statements/select.y" +#line 2886 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall((yyvsp[(1) - (7)].list), (yyvsp[(4) - (7)].list), (yylsp[(1) - (7)])); n->agg_order = (yyvsp[(5) - (7)].list); @@ -467490,7 +467886,7 @@ YYLTYPE yylloc; break; case 1048: -#line 2895 "third_party/libpg_query/grammar/statements/select.y" +#line 2897 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall((yyvsp[(1) - (7)].list), (yyvsp[(4) - (7)].list), (yylsp[(1) - (7)])); n->agg_order = (yyvsp[(5) - (7)].list); @@ -467501,7 +467897,7 @@ YYLTYPE yylloc; break; case 1049: -#line 2915 "third_party/libpg_query/grammar/statements/select.y" +#line 2917 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = (PGFuncCall *) (yyvsp[(1) - (5)].node); /* @@ -467540,22 +467936,22 @@ YYLTYPE yylloc; break; case 1050: -#line 2951 "third_party/libpg_query/grammar/statements/select.y" +#line 2953 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1051: -#line 2961 "third_party/libpg_query/grammar/statements/select.y" +#line 2963 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1052: -#line 2962 "third_party/libpg_query/grammar/statements/select.y" +#line 2964 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1053: -#line 2970 "third_party/libpg_query/grammar/statements/select.y" +#line 2972 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[(4) - (5)].node)), @@ -467564,24 +467960,24 @@ YYLTYPE yylloc; break; case 1054: -#line 2976 "third_party/libpg_query/grammar/statements/select.y" +#line 2978 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeTypeCast((yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].typnam), 0, (yylsp[(1) - (6)])); ;} break; case 1055: -#line 2978 "third_party/libpg_query/grammar/statements/select.y" +#line 2980 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeTypeCast((yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].typnam), 1, (yylsp[(1) - (6)])); ;} break; case 1056: -#line 2980 "third_party/libpg_query/grammar/statements/select.y" +#line 2982 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("date_part"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); ;} break; case 1057: -#line 2984 "third_party/libpg_query/grammar/statements/select.y" +#line 2986 "third_party/libpg_query/grammar/statements/select.y" { /* overlay(A PLACING B FROM C FOR D) is converted to * overlay(A, B, C, D) @@ -467593,7 +467989,7 @@ YYLTYPE yylloc; break; case 1058: -#line 2993 "third_party/libpg_query/grammar/statements/select.y" +#line 2995 "third_party/libpg_query/grammar/statements/select.y" { /* position(A in B) is converted to position_inverse(A, B) */ (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("__internal_position_operator"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); @@ -467601,7 +467997,7 @@ YYLTYPE yylloc; break; case 1059: -#line 2998 "third_party/libpg_query/grammar/statements/select.y" +#line 3000 "third_party/libpg_query/grammar/statements/select.y" { /* substring(A from B for C) is converted to * substring(A, B, C) - thomas 2000-11-28 @@ -467611,7 +468007,7 @@ YYLTYPE yylloc; break; case 1060: -#line 3005 "third_party/libpg_query/grammar/statements/select.y" +#line 3007 "third_party/libpg_query/grammar/statements/select.y" { /* TREAT(expr AS target) converts expr of a particular type to target, * which is defined to be a subtype of the original expression. @@ -467629,7 +468025,7 @@ YYLTYPE yylloc; break; case 1061: -#line 3020 "third_party/libpg_query/grammar/statements/select.y" +#line 3022 "third_party/libpg_query/grammar/statements/select.y" { /* various trim expressions are defined in SQL * - thomas 1997-07-19 @@ -467639,35 +468035,35 @@ YYLTYPE yylloc; break; case 1062: -#line 3027 "third_party/libpg_query/grammar/statements/select.y" +#line 3029 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[(4) - (5)].list), (yylsp[(1) - (5)])); ;} break; case 1063: -#line 3031 "third_party/libpg_query/grammar/statements/select.y" +#line 3033 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[(4) - (5)].list), (yylsp[(1) - (5)])); ;} break; case 1064: -#line 3035 "third_party/libpg_query/grammar/statements/select.y" +#line 3037 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("trim"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); ;} break; case 1065: -#line 3039 "third_party/libpg_query/grammar/statements/select.y" +#line 3041 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NULLIF, "=", (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node), (yylsp[(1) - (6)])); ;} break; case 1066: -#line 3043 "third_party/libpg_query/grammar/statements/select.y" +#line 3045 "third_party/libpg_query/grammar/statements/select.y" { PGCoalesceExpr *c = makeNode(PGCoalesceExpr); c->args = (yyvsp[(3) - (4)].list); @@ -467677,7 +468073,7 @@ YYLTYPE yylloc; break; case 1067: -#line 3053 "third_party/libpg_query/grammar/statements/select.y" +#line 3055 "third_party/libpg_query/grammar/statements/select.y" { PGFuncCall *n = makeFuncCall(SystemFuncName("row"), (yyvsp[(1) - (1)].list), (yylsp[(1) - (1)])); (yyval.node) = (PGNode *) n; @@ -467685,7 +468081,7 @@ YYLTYPE yylloc; break; case 1068: -#line 3061 "third_party/libpg_query/grammar/statements/select.y" +#line 3063 "third_party/libpg_query/grammar/statements/select.y" { PGLambdaFunction *lambda = makeNode(PGLambdaFunction); lambda->lhs = (yyvsp[(4) - (7)].node); @@ -467697,7 +468093,7 @@ YYLTYPE yylloc; break; case 1069: -#line 3070 "third_party/libpg_query/grammar/statements/select.y" +#line 3072 "third_party/libpg_query/grammar/statements/select.y" { PGLambdaFunction *lambda = makeNode(PGLambdaFunction); lambda->lhs = (yyvsp[(4) - (9)].node); @@ -467715,62 +468111,62 @@ YYLTYPE yylloc; break; case 1070: -#line 3091 "third_party/libpg_query/grammar/statements/select.y" +#line 3093 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(4) - (5)].list); ;} break; case 1071: -#line 3092 "third_party/libpg_query/grammar/statements/select.y" +#line 3094 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1072: -#line 3096 "third_party/libpg_query/grammar/statements/select.y" +#line 3098 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(4) - (5)].node); ;} break; case 1073: -#line 3097 "third_party/libpg_query/grammar/statements/select.y" +#line 3099 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(3) - (4)].node); ;} break; case 1074: -#line 3098 "third_party/libpg_query/grammar/statements/select.y" +#line 3100 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 1075: -#line 3102 "third_party/libpg_query/grammar/statements/select.y" +#line 3104 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = true; ;} break; case 1076: -#line 3103 "third_party/libpg_query/grammar/statements/select.y" +#line 3105 "third_party/libpg_query/grammar/statements/select.y" { (yyval.boolean) = false; ;} break; case 1077: -#line 3110 "third_party/libpg_query/grammar/statements/select.y" +#line 3112 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (2)].list); ;} break; case 1078: -#line 3111 "third_party/libpg_query/grammar/statements/select.y" +#line 3113 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1079: -#line 3115 "third_party/libpg_query/grammar/statements/select.y" +#line 3117 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].windef)); ;} break; case 1080: -#line 3117 "third_party/libpg_query/grammar/statements/select.y" +#line 3119 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].windef)); ;} break; case 1081: -#line 3122 "third_party/libpg_query/grammar/statements/select.y" +#line 3124 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = (yyvsp[(3) - (3)].windef); n->name = (yyvsp[(1) - (3)].str); @@ -467779,12 +468175,12 @@ YYLTYPE yylloc; break; case 1082: -#line 3130 "third_party/libpg_query/grammar/statements/select.y" +#line 3132 "third_party/libpg_query/grammar/statements/select.y" { (yyval.windef) = (yyvsp[(2) - (2)].windef); ;} break; case 1083: -#line 3132 "third_party/libpg_query/grammar/statements/select.y" +#line 3134 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); n->name = (yyvsp[(2) - (2)].str); @@ -467800,12 +468196,12 @@ YYLTYPE yylloc; break; case 1084: -#line 3145 "third_party/libpg_query/grammar/statements/select.y" +#line 3147 "third_party/libpg_query/grammar/statements/select.y" { (yyval.windef) = NULL; ;} break; case 1085: -#line 3150 "third_party/libpg_query/grammar/statements/select.y" +#line 3152 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); n->name = NULL; @@ -467822,27 +468218,27 @@ YYLTYPE yylloc; break; case 1086: -#line 3175 "third_party/libpg_query/grammar/statements/select.y" +#line 3177 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1087: -#line 3176 "third_party/libpg_query/grammar/statements/select.y" +#line 3178 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = NULL; ;} break; case 1088: -#line 3179 "third_party/libpg_query/grammar/statements/select.y" +#line 3181 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (3)].list); ;} break; case 1089: -#line 3180 "third_party/libpg_query/grammar/statements/select.y" +#line 3182 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1090: -#line 3189 "third_party/libpg_query/grammar/statements/select.y" +#line 3191 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = (yyvsp[(2) - (3)].windef); @@ -467853,7 +468249,7 @@ YYLTYPE yylloc; break; case 1091: -#line 3197 "third_party/libpg_query/grammar/statements/select.y" +#line 3199 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = (yyvsp[(2) - (3)].windef); @@ -467864,7 +468260,7 @@ YYLTYPE yylloc; break; case 1092: -#line 3205 "third_party/libpg_query/grammar/statements/select.y" +#line 3207 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = (yyvsp[(2) - (3)].windef); @@ -467875,7 +468271,7 @@ YYLTYPE yylloc; break; case 1093: -#line 3213 "third_party/libpg_query/grammar/statements/select.y" +#line 3215 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); @@ -467887,7 +468283,7 @@ YYLTYPE yylloc; break; case 1094: -#line 3224 "third_party/libpg_query/grammar/statements/select.y" +#line 3226 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = (yyvsp[(1) - (1)].windef); @@ -467908,7 +468304,7 @@ YYLTYPE yylloc; break; case 1095: -#line 3242 "third_party/libpg_query/grammar/statements/select.y" +#line 3244 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n1 = (yyvsp[(2) - (4)].windef); PGWindowDef *n2 = (yyvsp[(4) - (4)].windef); @@ -467949,7 +468345,7 @@ YYLTYPE yylloc; break; case 1096: -#line 3288 "third_party/libpg_query/grammar/statements/select.y" +#line 3290 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); @@ -467961,7 +468357,7 @@ YYLTYPE yylloc; break; case 1097: -#line 3297 "third_party/libpg_query/grammar/statements/select.y" +#line 3299 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); @@ -467973,7 +468369,7 @@ YYLTYPE yylloc; break; case 1098: -#line 3306 "third_party/libpg_query/grammar/statements/select.y" +#line 3308 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); @@ -467985,7 +468381,7 @@ YYLTYPE yylloc; break; case 1099: -#line 3315 "third_party/libpg_query/grammar/statements/select.y" +#line 3317 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); @@ -467997,7 +468393,7 @@ YYLTYPE yylloc; break; case 1100: -#line 3324 "third_party/libpg_query/grammar/statements/select.y" +#line 3326 "third_party/libpg_query/grammar/statements/select.y" { PGWindowDef *n = makeNode(PGWindowDef); @@ -468009,52 +468405,52 @@ YYLTYPE yylloc; break; case 1101: -#line 3335 "third_party/libpg_query/grammar/statements/select.y" +#line 3337 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; ;} break; case 1102: -#line 3336 "third_party/libpg_query/grammar/statements/select.y" +#line 3338 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; ;} break; case 1103: -#line 3337 "third_party/libpg_query/grammar/statements/select.y" +#line 3339 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; ;} break; case 1104: -#line 3338 "third_party/libpg_query/grammar/statements/select.y" +#line 3340 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = 0; ;} break; case 1105: -#line 3339 "third_party/libpg_query/grammar/statements/select.y" +#line 3341 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = 0; ;} break; case 1106: -#line 3353 "third_party/libpg_query/grammar/statements/select.y" +#line 3355 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (4)].list); ;} break; case 1107: -#line 3354 "third_party/libpg_query/grammar/statements/select.y" +#line 3356 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1108: -#line 3357 "third_party/libpg_query/grammar/statements/select.y" +#line 3359 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list);;} break; case 1109: -#line 3358 "third_party/libpg_query/grammar/statements/select.y" +#line 3360 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(2) - (5)].list), (yyvsp[(4) - (5)].node)); ;} break; case 1110: -#line 3362 "third_party/libpg_query/grammar/statements/select.y" +#line 3364 "third_party/libpg_query/grammar/statements/select.y" { PGNamedArgExpr *na = makeNode(PGNamedArgExpr); na->name = (yyvsp[(1) - (3)].str); @@ -468066,320 +468462,320 @@ YYLTYPE yylloc; break; case 1111: -#line 3372 "third_party/libpg_query/grammar/statements/select.y" +#line 3374 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 1112: -#line 3373 "third_party/libpg_query/grammar/statements/select.y" +#line 3375 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 1113: -#line 3377 "third_party/libpg_query/grammar/statements/select.y" +#line 3379 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1114: -#line 3378 "third_party/libpg_query/grammar/statements/select.y" +#line 3380 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 1115: -#line 3383 "third_party/libpg_query/grammar/statements/select.y" +#line 3385 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); ;} break; case 1116: -#line 3389 "third_party/libpg_query/grammar/statements/select.y" +#line 3391 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].list)); ;} break; case 1117: -#line 3390 "third_party/libpg_query/grammar/statements/select.y" +#line 3392 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); ;} break; case 1118: -#line 3395 "third_party/libpg_query/grammar/statements/select.y" +#line 3397 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1119: -#line 3396 "third_party/libpg_query/grammar/statements/select.y" +#line 3398 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 1120: -#line 3401 "third_party/libpg_query/grammar/statements/select.y" +#line 3403 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1121: -#line 3402 "third_party/libpg_query/grammar/statements/select.y" +#line 3404 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NULL; ;} break; case 1122: -#line 3405 "third_party/libpg_query/grammar/statements/select.y" +#line 3407 "third_party/libpg_query/grammar/statements/select.y" { (yyval.subquerytype) = PG_ANY_SUBLINK; ;} break; case 1123: -#line 3406 "third_party/libpg_query/grammar/statements/select.y" +#line 3408 "third_party/libpg_query/grammar/statements/select.y" { (yyval.subquerytype) = PG_ANY_SUBLINK; ;} break; case 1124: -#line 3407 "third_party/libpg_query/grammar/statements/select.y" +#line 3409 "third_party/libpg_query/grammar/statements/select.y" { (yyval.subquerytype) = PG_ALL_SUBLINK; ;} break; case 1125: -#line 3410 "third_party/libpg_query/grammar/statements/select.y" +#line 3412 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1126: -#line 3411 "third_party/libpg_query/grammar/statements/select.y" +#line 3413 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) (yyvsp[(1) - (1)].conststr); ;} break; case 1127: -#line 3414 "third_party/libpg_query/grammar/statements/select.y" +#line 3416 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "+"; ;} break; case 1128: -#line 3415 "third_party/libpg_query/grammar/statements/select.y" +#line 3417 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "-"; ;} break; case 1129: -#line 3416 "third_party/libpg_query/grammar/statements/select.y" +#line 3418 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "*"; ;} break; case 1130: -#line 3417 "third_party/libpg_query/grammar/statements/select.y" +#line 3419 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "/"; ;} break; case 1131: -#line 3418 "third_party/libpg_query/grammar/statements/select.y" +#line 3420 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "//"; ;} break; case 1132: -#line 3419 "third_party/libpg_query/grammar/statements/select.y" +#line 3421 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "%"; ;} break; case 1133: -#line 3420 "third_party/libpg_query/grammar/statements/select.y" +#line 3422 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "^"; ;} break; case 1134: -#line 3421 "third_party/libpg_query/grammar/statements/select.y" +#line 3423 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "**"; ;} break; case 1135: -#line 3422 "third_party/libpg_query/grammar/statements/select.y" +#line 3424 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "<"; ;} break; case 1136: -#line 3423 "third_party/libpg_query/grammar/statements/select.y" +#line 3425 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = ">"; ;} break; case 1137: -#line 3424 "third_party/libpg_query/grammar/statements/select.y" +#line 3426 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "="; ;} break; case 1138: -#line 3425 "third_party/libpg_query/grammar/statements/select.y" +#line 3427 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "<="; ;} break; case 1139: -#line 3426 "third_party/libpg_query/grammar/statements/select.y" +#line 3428 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = ">="; ;} break; case 1140: -#line 3427 "third_party/libpg_query/grammar/statements/select.y" +#line 3429 "third_party/libpg_query/grammar/statements/select.y" { (yyval.conststr) = "<>"; ;} break; case 1141: -#line 3431 "third_party/libpg_query/grammar/statements/select.y" +#line 3433 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 1142: -#line 3433 "third_party/libpg_query/grammar/statements/select.y" +#line 3435 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (4)].list); ;} break; case 1143: -#line 3438 "third_party/libpg_query/grammar/statements/select.y" +#line 3440 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 1144: -#line 3440 "third_party/libpg_query/grammar/statements/select.y" +#line 3442 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (4)].list); ;} break; case 1145: -#line 3445 "third_party/libpg_query/grammar/statements/select.y" +#line 3447 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 1146: -#line 3447 "third_party/libpg_query/grammar/statements/select.y" +#line 3449 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (4)].list); ;} break; case 1147: -#line 3449 "third_party/libpg_query/grammar/statements/select.y" +#line 3451 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString("~~")); ;} break; case 1148: -#line 3451 "third_party/libpg_query/grammar/statements/select.y" +#line 3453 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString("!~~")); ;} break; case 1149: -#line 3453 "third_party/libpg_query/grammar/statements/select.y" +#line 3455 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString("~~~")); ;} break; case 1150: -#line 3455 "third_party/libpg_query/grammar/statements/select.y" +#line 3457 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString("!~~~")); ;} break; case 1151: -#line 3457 "third_party/libpg_query/grammar/statements/select.y" +#line 3459 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString("~~*")); ;} break; case 1152: -#line 3459 "third_party/libpg_query/grammar/statements/select.y" +#line 3461 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString("!~~*")); ;} break; case 1153: -#line 3473 "third_party/libpg_query/grammar/statements/select.y" +#line 3475 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 1154: -#line 3475 "third_party/libpg_query/grammar/statements/select.y" +#line 3477 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lcons(makeString((yyvsp[(1) - (3)].str)), (yyvsp[(3) - (3)].list)); ;} break; case 1155: -#line 3480 "third_party/libpg_query/grammar/statements/select.y" +#line 3482 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 1156: -#line 3484 "third_party/libpg_query/grammar/statements/select.y" +#line 3486 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 1157: -#line 3491 "third_party/libpg_query/grammar/statements/select.y" +#line 3493 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1158: -#line 3496 "third_party/libpg_query/grammar/statements/select.y" +#line 3498 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 1159: -#line 3502 "third_party/libpg_query/grammar/statements/select.y" +#line 3504 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 1160: -#line 3506 "third_party/libpg_query/grammar/statements/select.y" +#line 3508 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 1161: -#line 3513 "third_party/libpg_query/grammar/statements/select.y" +#line 3515 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1162: -#line 3518 "third_party/libpg_query/grammar/statements/select.y" +#line 3520 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 1163: -#line 3525 "third_party/libpg_query/grammar/statements/select.y" +#line 3527 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1164: -#line 3529 "third_party/libpg_query/grammar/statements/select.y" +#line 3531 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NULL; ;} break; case 1165: -#line 3538 "third_party/libpg_query/grammar/statements/select.y" +#line 3540 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 1166: -#line 3542 "third_party/libpg_query/grammar/statements/select.y" +#line 3544 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 1167: -#line 3548 "third_party/libpg_query/grammar/statements/select.y" +#line 3550 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1168: -#line 3552 "third_party/libpg_query/grammar/statements/select.y" +#line 3554 "third_party/libpg_query/grammar/statements/select.y" { PGNamedArgExpr *na = makeNode(PGNamedArgExpr); na->name = (yyvsp[(1) - (3)].str); @@ -468391,7 +468787,7 @@ YYLTYPE yylloc; break; case 1169: -#line 3561 "third_party/libpg_query/grammar/statements/select.y" +#line 3563 "third_party/libpg_query/grammar/statements/select.y" { PGNamedArgExpr *na = makeNode(PGNamedArgExpr); na->name = (yyvsp[(1) - (3)].str); @@ -468403,140 +468799,140 @@ YYLTYPE yylloc; break; case 1170: -#line 3571 "third_party/libpg_query/grammar/statements/select.y" +#line 3573 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].typnam)); ;} break; case 1171: -#line 3572 "third_party/libpg_query/grammar/statements/select.y" +#line 3574 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].typnam)); ;} break; case 1172: -#line 3577 "third_party/libpg_query/grammar/statements/select.y" +#line 3579 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2(makeStringConst((yyvsp[(1) - (3)].str), (yylsp[(1) - (3)])), (yyvsp[(3) - (3)].node)); ;} break; case 1173: -#line 3580 "third_party/libpg_query/grammar/statements/select.y" +#line 3582 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1174: -#line 3587 "third_party/libpg_query/grammar/statements/select.y" +#line 3589 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1175: -#line 3588 "third_party/libpg_query/grammar/statements/select.y" +#line 3590 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "year"; ;} break; case 1176: -#line 3589 "third_party/libpg_query/grammar/statements/select.y" +#line 3591 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "month"; ;} break; case 1177: -#line 3590 "third_party/libpg_query/grammar/statements/select.y" +#line 3592 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "day"; ;} break; case 1178: -#line 3591 "third_party/libpg_query/grammar/statements/select.y" +#line 3593 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "hour"; ;} break; case 1179: -#line 3592 "third_party/libpg_query/grammar/statements/select.y" +#line 3594 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "minute"; ;} break; case 1180: -#line 3593 "third_party/libpg_query/grammar/statements/select.y" +#line 3595 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "second"; ;} break; case 1181: -#line 3594 "third_party/libpg_query/grammar/statements/select.y" +#line 3596 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "millisecond"; ;} break; case 1182: -#line 3595 "third_party/libpg_query/grammar/statements/select.y" +#line 3597 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "microsecond"; ;} break; case 1183: -#line 3596 "third_party/libpg_query/grammar/statements/select.y" +#line 3598 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "week"; ;} break; case 1184: -#line 3597 "third_party/libpg_query/grammar/statements/select.y" +#line 3599 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "quarter"; ;} break; case 1185: -#line 3598 "third_party/libpg_query/grammar/statements/select.y" +#line 3600 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "decade"; ;} break; case 1186: -#line 3599 "third_party/libpg_query/grammar/statements/select.y" +#line 3601 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "century"; ;} break; case 1187: -#line 3600 "third_party/libpg_query/grammar/statements/select.y" +#line 3602 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (char*) "millennium"; ;} break; case 1188: -#line 3601 "third_party/libpg_query/grammar/statements/select.y" +#line 3603 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1189: -#line 3612 "third_party/libpg_query/grammar/statements/select.y" +#line 3614 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make4((yyvsp[(1) - (4)].node), (yyvsp[(2) - (4)].node), (yyvsp[(3) - (4)].node), (yyvsp[(4) - (4)].node)); ;} break; case 1190: -#line 3616 "third_party/libpg_query/grammar/statements/select.y" +#line 3618 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make3((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].node), (yyvsp[(3) - (3)].node)); ;} break; case 1191: -#line 3623 "third_party/libpg_query/grammar/statements/select.y" +#line 3625 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 1192: -#line 3629 "third_party/libpg_query/grammar/statements/select.y" +#line 3631 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); ;} break; case 1193: -#line 3630 "third_party/libpg_query/grammar/statements/select.y" +#line 3632 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1194: -#line 3647 "third_party/libpg_query/grammar/statements/select.y" +#line 3649 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make3((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].node), (yyvsp[(3) - (3)].node)); ;} break; case 1195: -#line 3651 "third_party/libpg_query/grammar/statements/select.y" +#line 3653 "third_party/libpg_query/grammar/statements/select.y" { /* not legal per SQL99, but might as well allow it */ (yyval.list) = list_make3((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].node)); @@ -468544,14 +468940,14 @@ YYLTYPE yylloc; break; case 1196: -#line 3656 "third_party/libpg_query/grammar/statements/select.y" +#line 3658 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); ;} break; case 1197: -#line 3660 "third_party/libpg_query/grammar/statements/select.y" +#line 3662 "third_party/libpg_query/grammar/statements/select.y" { /* * Since there are no cases where this syntax allows @@ -468569,44 +468965,44 @@ YYLTYPE yylloc; break; case 1198: -#line 3675 "third_party/libpg_query/grammar/statements/select.y" +#line 3677 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1199: -#line 3679 "third_party/libpg_query/grammar/statements/select.y" +#line 3681 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1200: -#line 3683 "third_party/libpg_query/grammar/statements/select.y" +#line 3685 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 1201: -#line 3686 "third_party/libpg_query/grammar/statements/select.y" +#line 3688 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 1202: -#line 3689 "third_party/libpg_query/grammar/statements/select.y" +#line 3691 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(3) - (3)].list), (yyvsp[(1) - (3)].node)); ;} break; case 1203: -#line 3690 "third_party/libpg_query/grammar/statements/select.y" +#line 3692 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (2)].list); ;} break; case 1204: -#line 3691 "third_party/libpg_query/grammar/statements/select.y" +#line 3693 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1205: -#line 3695 "third_party/libpg_query/grammar/statements/select.y" +#line 3697 "third_party/libpg_query/grammar/statements/select.y" { PGSubLink *n = makeNode(PGSubLink); n->subselect = (yyvsp[(1) - (1)].node); @@ -468616,17 +469012,17 @@ YYLTYPE yylloc; break; case 1206: -#line 3701 "third_party/libpg_query/grammar/statements/select.y" +#line 3703 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *)(yyvsp[(2) - (3)].list); ;} break; case 1208: -#line 3703 "third_party/libpg_query/grammar/statements/select.y" +#line 3705 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (PGNode *)(yyvsp[(1) - (1)].node); ;} break; case 1209: -#line 3714 "third_party/libpg_query/grammar/statements/select.y" +#line 3716 "third_party/libpg_query/grammar/statements/select.y" { PGCaseExpr *c = makeNode(PGCaseExpr); c->casetype = InvalidOid; /* not analyzed yet */ @@ -468639,17 +469035,17 @@ YYLTYPE yylloc; break; case 1210: -#line 3727 "third_party/libpg_query/grammar/statements/select.y" +#line 3729 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 1211: -#line 3728 "third_party/libpg_query/grammar/statements/select.y" +#line 3730 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} break; case 1212: -#line 3733 "third_party/libpg_query/grammar/statements/select.y" +#line 3735 "third_party/libpg_query/grammar/statements/select.y" { PGCaseWhen *w = makeNode(PGCaseWhen); w->expr = (PGExpr *) (yyvsp[(2) - (4)].node); @@ -468660,58 +469056,58 @@ YYLTYPE yylloc; break; case 1213: -#line 3743 "third_party/libpg_query/grammar/statements/select.y" +#line 3745 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(2) - (2)].node); ;} break; case 1214: -#line 3744 "third_party/libpg_query/grammar/statements/select.y" +#line 3746 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 1215: -#line 3747 "third_party/libpg_query/grammar/statements/select.y" +#line 3749 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1216: -#line 3748 "third_party/libpg_query/grammar/statements/select.y" +#line 3750 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 1217: -#line 3752 "third_party/libpg_query/grammar/statements/select.y" +#line 3754 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} break; case 1218: -#line 3753 "third_party/libpg_query/grammar/statements/select.y" +#line 3755 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} break; case 1219: -#line 3757 "third_party/libpg_query/grammar/statements/select.y" +#line 3759 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeColumnRef((yyvsp[(1) - (1)].str), NIL, (yylsp[(1) - (1)]), yyscanner); ;} break; case 1220: -#line 3763 "third_party/libpg_query/grammar/statements/select.y" +#line 3765 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeColumnRef((yyvsp[(1) - (1)].str), NIL, (yylsp[(1) - (1)]), yyscanner); ;} break; case 1221: -#line 3767 "third_party/libpg_query/grammar/statements/select.y" +#line 3769 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeColumnRef((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].list), (yylsp[(1) - (2)]), yyscanner); ;} break; case 1222: -#line 3774 "third_party/libpg_query/grammar/statements/select.y" +#line 3776 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = false; @@ -468722,7 +469118,7 @@ YYLTYPE yylloc; break; case 1223: -#line 3782 "third_party/libpg_query/grammar/statements/select.y" +#line 3784 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; @@ -468733,7 +469129,7 @@ YYLTYPE yylloc; break; case 1224: -#line 3789 "third_party/libpg_query/grammar/statements/select.y" +#line 3791 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; @@ -468745,7 +469141,7 @@ YYLTYPE yylloc; break; case 1225: -#line 3797 "third_party/libpg_query/grammar/statements/select.y" +#line 3799 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; @@ -468756,42 +469152,42 @@ YYLTYPE yylloc; break; case 1226: -#line 3807 "third_party/libpg_query/grammar/statements/select.y" +#line 3809 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 1227: -#line 3808 "third_party/libpg_query/grammar/statements/select.y" +#line 3810 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = NULL; ;} break; case 1228: -#line 3813 "third_party/libpg_query/grammar/statements/select.y" +#line 3815 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1229: -#line 3814 "third_party/libpg_query/grammar/statements/select.y" +#line 3816 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} break; case 1230: -#line 3818 "third_party/libpg_query/grammar/statements/select.y" +#line 3820 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NULL; ;} break; case 1231: -#line 3819 "third_party/libpg_query/grammar/statements/select.y" +#line 3821 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(NULL); ;} break; case 1232: -#line 3820 "third_party/libpg_query/grammar/statements/select.y" +#line 3822 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (3)].list); ;} break; case 1233: -#line 3825 "third_party/libpg_query/grammar/statements/select.y" +#line 3827 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(3) - (3)].list)) { PGFuncCall *n = makeFuncCall(list_make1(makeString((yyvsp[(2) - (3)].str))), (yyvsp[(3) - (3)].list)->head->data.ptr_value ? (yyvsp[(3) - (3)].list) : NULL, (yylsp[(2) - (3)])); @@ -468803,7 +469199,7 @@ YYLTYPE yylloc; break; case 1234: -#line 3834 "third_party/libpg_query/grammar/statements/select.y" +#line 3836 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = false; @@ -468814,7 +469210,7 @@ YYLTYPE yylloc; break; case 1235: -#line 3842 "third_party/libpg_query/grammar/statements/select.y" +#line 3844 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; @@ -468825,7 +469221,7 @@ YYLTYPE yylloc; break; case 1236: -#line 3849 "third_party/libpg_query/grammar/statements/select.y" +#line 3851 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; @@ -468837,7 +469233,7 @@ YYLTYPE yylloc; break; case 1237: -#line 3858 "third_party/libpg_query/grammar/statements/select.y" +#line 3860 "third_party/libpg_query/grammar/statements/select.y" { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; @@ -468848,47 +469244,47 @@ YYLTYPE yylloc; break; case 1238: -#line 3873 "third_party/libpg_query/grammar/statements/select.y" +#line 3875 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1239: -#line 3874 "third_party/libpg_query/grammar/statements/select.y" +#line 3876 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} break; case 1242: -#line 3890 "third_party/libpg_query/grammar/statements/select.y" +#line 3892 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1243: -#line 3891 "third_party/libpg_query/grammar/statements/select.y" +#line 3893 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1244: -#line 3895 "third_party/libpg_query/grammar/statements/select.y" +#line 3897 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].target)); ;} break; case 1245: -#line 3896 "third_party/libpg_query/grammar/statements/select.y" +#line 3898 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].target)); ;} break; case 1246: -#line 3900 "third_party/libpg_query/grammar/statements/select.y" +#line 3902 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1247: -#line 3901 "third_party/libpg_query/grammar/statements/select.y" +#line 3903 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 1248: -#line 3905 "third_party/libpg_query/grammar/statements/select.y" +#line 3907 "third_party/libpg_query/grammar/statements/select.y" { (yyval.target) = makeNode(PGResTarget); (yyval.target)->name = (yyvsp[(3) - (3)].str); @@ -468899,7 +469295,7 @@ YYLTYPE yylloc; break; case 1249: -#line 3921 "third_party/libpg_query/grammar/statements/select.y" +#line 3923 "third_party/libpg_query/grammar/statements/select.y" { (yyval.target) = makeNode(PGResTarget); (yyval.target)->name = (yyvsp[(2) - (2)].str); @@ -468910,7 +469306,7 @@ YYLTYPE yylloc; break; case 1250: -#line 3929 "third_party/libpg_query/grammar/statements/select.y" +#line 3931 "third_party/libpg_query/grammar/statements/select.y" { (yyval.target) = makeNode(PGResTarget); (yyval.target)->name = NULL; @@ -468921,117 +469317,117 @@ YYLTYPE yylloc; break; case 1251: -#line 3938 "third_party/libpg_query/grammar/statements/select.y" +#line 3940 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (4)].list); ;} break; case 1252: -#line 3939 "third_party/libpg_query/grammar/statements/select.y" +#line 3941 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(2) - (2)].str))); ;} break; case 1253: -#line 3942 "third_party/libpg_query/grammar/statements/select.y" +#line 3944 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1254: -#line 3943 "third_party/libpg_query/grammar/statements/select.y" +#line 3945 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NULL; ;} break; case 1255: -#line 3946 "third_party/libpg_query/grammar/statements/select.y" +#line 3948 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make2((yyvsp[(1) - (3)].node), makeString((yyvsp[(3) - (3)].str))); ;} break; case 1256: -#line 3950 "third_party/libpg_query/grammar/statements/select.y" +#line 3952 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].list)); ;} break; case 1257: -#line 3951 "third_party/libpg_query/grammar/statements/select.y" +#line 3953 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); ;} break; case 1258: -#line 3955 "third_party/libpg_query/grammar/statements/select.y" +#line 3957 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1259: -#line 3956 "third_party/libpg_query/grammar/statements/select.y" +#line 3958 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 1260: -#line 3959 "third_party/libpg_query/grammar/statements/select.y" +#line 3961 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(3) - (4)].list); ;} break; case 1261: -#line 3960 "third_party/libpg_query/grammar/statements/select.y" +#line 3962 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(2) - (2)].list)); ;} break; case 1262: -#line 3961 "third_party/libpg_query/grammar/statements/select.y" +#line 3963 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NULL; ;} break; case 1263: -#line 3971 "third_party/libpg_query/grammar/statements/select.y" +#line 3973 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1((yyvsp[(1) - (1)].range)); ;} break; case 1264: -#line 3972 "third_party/libpg_query/grammar/statements/select.y" +#line 3974 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].range)); ;} break; case 1265: -#line 3977 "third_party/libpg_query/grammar/statements/select.y" +#line 3979 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 1266: -#line 3979 "third_party/libpg_query/grammar/statements/select.y" +#line 3981 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeString((yyvsp[(3) - (3)].str))); ;} break; case 1267: -#line 3984 "third_party/libpg_query/grammar/statements/select.y" +#line 3986 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1268: -#line 3985 "third_party/libpg_query/grammar/statements/select.y" +#line 3987 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (2)].list); ;} break; case 1269: -#line 3989 "third_party/libpg_query/grammar/statements/select.y" +#line 3991 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(1) - (1)].list); ;} break; case 1270: -#line 3990 "third_party/libpg_query/grammar/statements/select.y" +#line 3992 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (3)].list); ;} break; case 1271: -#line 3993 "third_party/libpg_query/grammar/statements/select.y" +#line 3995 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1272: -#line 4005 "third_party/libpg_query/grammar/statements/select.y" +#line 4007 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 1273: -#line 4008 "third_party/libpg_query/grammar/statements/select.y" +#line 4010 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = check_func_name(lcons(makeString((yyvsp[(1) - (2)].str)), (yyvsp[(2) - (2)].list)), yyscanner); @@ -469039,21 +469435,21 @@ YYLTYPE yylloc; break; case 1274: -#line 4019 "third_party/libpg_query/grammar/statements/select.y" +#line 4021 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeIntConst((yyvsp[(1) - (1)].ival), (yylsp[(1) - (1)])); ;} break; case 1275: -#line 4023 "third_party/libpg_query/grammar/statements/select.y" +#line 4025 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeFloatConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); ;} break; case 1276: -#line 4027 "third_party/libpg_query/grammar/statements/select.y" +#line 4029 "third_party/libpg_query/grammar/statements/select.y" { if ((yyvsp[(2) - (2)].list)) { @@ -469068,14 +469464,14 @@ YYLTYPE yylloc; break; case 1277: -#line 4039 "third_party/libpg_query/grammar/statements/select.y" +#line 4041 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeBitStringConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); ;} break; case 1278: -#line 4043 "third_party/libpg_query/grammar/statements/select.y" +#line 4045 "third_party/libpg_query/grammar/statements/select.y" { /* This is a bit constant per SQL99: * Without Feature F511, "BIT data type", @@ -469087,7 +469483,7 @@ YYLTYPE yylloc; break; case 1279: -#line 4052 "third_party/libpg_query/grammar/statements/select.y" +#line 4054 "third_party/libpg_query/grammar/statements/select.y" { /* generic type 'literal' syntax */ PGTypeName *t = makeTypeNameFromNameList((yyvsp[(1) - (2)].list)); @@ -469097,7 +469493,7 @@ YYLTYPE yylloc; break; case 1280: -#line 4059 "third_party/libpg_query/grammar/statements/select.y" +#line 4061 "third_party/libpg_query/grammar/statements/select.y" { /* generic syntax with a type modifier */ PGTypeName *t = makeTypeNameFromNameList((yyvsp[(1) - (7)].list)); @@ -469138,141 +469534,141 @@ YYLTYPE yylloc; break; case 1281: -#line 4097 "third_party/libpg_query/grammar/statements/select.y" +#line 4099 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeStringConstCast((yyvsp[(2) - (2)].str), (yylsp[(2) - (2)]), (yyvsp[(1) - (2)].typnam)); ;} break; case 1282: -#line 4101 "third_party/libpg_query/grammar/statements/select.y" +#line 4103 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeIntervalNode((yyvsp[(3) - (5)].node), (yylsp[(3) - (5)]), (yyvsp[(5) - (5)].list)); ;} break; case 1283: -#line 4105 "third_party/libpg_query/grammar/statements/select.y" +#line 4107 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeIntervalNode((yyvsp[(2) - (3)].ival), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].list)); ;} break; case 1284: -#line 4109 "third_party/libpg_query/grammar/statements/select.y" +#line 4111 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeIntervalNode((yyvsp[(2) - (3)].str), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].list)); ;} break; case 1285: -#line 4113 "third_party/libpg_query/grammar/statements/select.y" +#line 4115 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeBoolAConst(true, (yylsp[(1) - (1)])); ;} break; case 1286: -#line 4117 "third_party/libpg_query/grammar/statements/select.y" +#line 4119 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeBoolAConst(false, (yylsp[(1) - (1)])); ;} break; case 1287: -#line 4121 "third_party/libpg_query/grammar/statements/select.y" +#line 4123 "third_party/libpg_query/grammar/statements/select.y" { (yyval.node) = makeNullAConst((yylsp[(1) - (1)])); ;} break; case 1288: -#line 4126 "third_party/libpg_query/grammar/statements/select.y" +#line 4128 "third_party/libpg_query/grammar/statements/select.y" { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;} break; case 1289: -#line 4143 "third_party/libpg_query/grammar/statements/select.y" +#line 4145 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1290: -#line 4144 "third_party/libpg_query/grammar/statements/select.y" +#line 4146 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} break; case 1291: -#line 4145 "third_party/libpg_query/grammar/statements/select.y" +#line 4147 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} break; case 1292: -#line 4148 "third_party/libpg_query/grammar/statements/select.y" +#line 4150 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1293: -#line 4149 "third_party/libpg_query/grammar/statements/select.y" +#line 4151 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} break; case 1294: -#line 4150 "third_party/libpg_query/grammar/statements/select.y" +#line 4152 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} break; case 1295: -#line 4153 "third_party/libpg_query/grammar/statements/select.y" +#line 4155 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1296: -#line 4154 "third_party/libpg_query/grammar/statements/select.y" +#line 4156 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} break; case 1297: -#line 4155 "third_party/libpg_query/grammar/statements/select.y" +#line 4157 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} break; case 1298: -#line 4158 "third_party/libpg_query/grammar/statements/select.y" +#line 4160 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} break; case 1299: -#line 4159 "third_party/libpg_query/grammar/statements/select.y" +#line 4161 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lcons(makeString((yyvsp[(1) - (2)].str)), (yyvsp[(2) - (2)].list)); ;} break; case 1300: -#line 4163 "third_party/libpg_query/grammar/statements/select.y" +#line 4165 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = list_make1(makeString((yyvsp[(2) - (2)].str))); ;} break; case 1301: -#line 4165 "third_party/libpg_query/grammar/statements/select.y" +#line 4167 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeString((yyvsp[(3) - (3)].str))); ;} break; case 1302: -#line 4169 "third_party/libpg_query/grammar/statements/select.y" +#line 4171 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = (yyvsp[(2) - (3)].list); ;} break; case 1303: -#line 4170 "third_party/libpg_query/grammar/statements/select.y" +#line 4172 "third_party/libpg_query/grammar/statements/select.y" { (yyval.list) = NIL; ;} break; case 1305: -#line 4177 "third_party/libpg_query/grammar/statements/select.y" +#line 4179 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; case 1306: -#line 4178 "third_party/libpg_query/grammar/statements/select.y" +#line 4180 "third_party/libpg_query/grammar/statements/select.y" { (yyval.str) = (yyvsp[(1) - (1)].str); ;} break; @@ -470817,7 +471213,7 @@ YYLTYPE yylloc; /* Line 1267 of yacc.c. */ -#line 31078 "third_party/libpg_query/grammar/grammar_out.cpp" +#line 31080 "third_party/libpg_query/grammar/grammar_out.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -472373,8 +472769,12 @@ PGList *raw_parser(const char *str) { return yyextra.parsetree; } -bool is_keyword(const char *text) { - return ScanKeywordLookup(text, ScanKeywords, NumScanKeywords) != NULL; +PGKeywordCategory is_keyword(const char *text) { + auto keyword = ScanKeywordLookup(text, ScanKeywords, NumScanKeywords); + if (keyword) { + return static_cast(keyword->category); + } + return PGKeywordCategory::PG_KEYWORD_NONE; } std::vector keyword_list() { @@ -477199,7 +477599,6 @@ bool scanner_isspace(char ch) { - namespace duckdb_libpgquery { /* diff --git a/c_src/duckdb/duckdb.hpp b/c_src/duckdb/duckdb.hpp index ff4dfc2..bfeb111 100644 --- a/c_src/duckdb/duckdb.hpp +++ b/c_src/duckdb/duckdb.hpp @@ -10,11 +10,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #pragma once #define DUCKDB_AMALGAMATION 1 -#define DUCKDB_SOURCE_ID "fa5c2fe15f" -#define DUCKDB_VERSION "v1.1.0" +#define DUCKDB_SOURCE_ID "af39bd0dcf" +#define DUCKDB_VERSION "v1.1.1" #define DUCKDB_MAJOR_VERSION 1 #define DUCKDB_MINOR_VERSION 1 -#define DUCKDB_PATCH_VERSION "0" +#define DUCKDB_PATCH_VERSION "1" //===----------------------------------------------------------------------===// // DuckDB // @@ -7700,7 +7700,7 @@ class FileBuffer; class BufferHandle { public: DUCKDB_API BufferHandle(); - DUCKDB_API BufferHandle(shared_ptr handle, FileBuffer *node); + DUCKDB_API explicit BufferHandle(shared_ptr handle); DUCKDB_API ~BufferHandle(); // disable copy constructors BufferHandle(const BufferHandle &other) = delete; @@ -7735,7 +7735,7 @@ class BufferHandle { //! The block handle shared_ptr handle; //! The managed buffer node - FileBuffer *node; + optional_ptr node; }; } // namespace duckdb @@ -8745,88 +8745,8 @@ struct ArrowArrayStream { - - - - - - -namespace duckdb { - -class DataChunk; - -//! Abstract chunk fetcher -class ChunkScanState { -public: - explicit ChunkScanState(); - virtual ~ChunkScanState(); - -public: - ChunkScanState(const ChunkScanState &other) = delete; - ChunkScanState(ChunkScanState &&other) = default; - ChunkScanState &operator=(const ChunkScanState &other) = delete; - ChunkScanState &operator=(ChunkScanState &&other) = default; - -public: - virtual bool LoadNextChunk(ErrorData &error) = 0; - virtual bool HasError() const = 0; - virtual ErrorData &GetError() = 0; - virtual const vector &Types() const = 0; - virtual const vector &Names() const = 0; - idx_t CurrentOffset() const; - idx_t RemainingInChunk() const; - DataChunk &CurrentChunk(); - bool ChunkIsEmpty() const; - bool Finished() const; - bool ScanStarted() const; - void IncreaseOffset(idx_t increment, bool unsafe = false); - -protected: - idx_t offset = 0; - bool finished = false; - unique_ptr current_chunk; -}; - -} // namespace duckdb - -//===----------------------------------------------------------------------===// -// DuckDB -// -// duckdb/main/client_properties.hpp -// -// -//===----------------------------------------------------------------------===// - - - - - - -namespace duckdb { - -enum class ArrowOffsetSize : uint8_t { REGULAR, LARGE }; - -//! A set of properties from the client context that can be used to interpret the query result -struct ClientProperties { - ClientProperties(string time_zone_p, ArrowOffsetSize arrow_offset_size_p, bool arrow_use_list_view_p, - bool produce_arrow_string_view_p, bool lossless_conversion) - : time_zone(std::move(time_zone_p)), arrow_offset_size(arrow_offset_size_p), - arrow_use_list_view(arrow_use_list_view_p), arrow_lossless_conversion(lossless_conversion) { - } - ClientProperties() {}; - string time_zone = "UTC"; - ArrowOffsetSize arrow_offset_size = ArrowOffsetSize::REGULAR; - bool arrow_use_list_view = false; - bool produce_arrow_string_view = false; - bool arrow_lossless_conversion = false; -}; -} // namespace duckdb - - //! Here we have the internal duckdb classes that interact with Arrow's Internal Header (i.e., duckdb/commons/arrow.hpp) namespace duckdb { -class QueryResult; -class DataChunk; class ArrowSchemaWrapper { public: @@ -8859,25 +8779,16 @@ class ArrowArrayStreamWrapper { public: void GetSchema(ArrowSchemaWrapper &schema); - shared_ptr GetNextChunk(); + virtual shared_ptr GetNextChunk(); const char *GetError(); - ~ArrowArrayStreamWrapper(); + virtual ~ArrowArrayStreamWrapper(); ArrowArrayStreamWrapper() { arrow_array_stream.release = nullptr; } }; -class ArrowUtil { -public: - static bool TryFetchChunk(ChunkScanState &scan_state, ClientProperties options, idx_t chunk_size, ArrowArray *out, - idx_t &result_count, ErrorData &error); - static idx_t FetchChunk(ChunkScanState &scan_state, ClientProperties options, idx_t chunk_size, ArrowArray *out); - -private: - static bool TryFetchNext(QueryResult &result, unique_ptr &out, ErrorData &error); -}; } // namespace duckdb @@ -10730,6 +10641,51 @@ class ParserException : public Exception { +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/parser/simplified_token.hpp +// +// +//===----------------------------------------------------------------------===// + + + + + +namespace duckdb { + +//! Simplified tokens are a simplified (dense) representation of the lexer +//! Used for simple syntax highlighting in the tests +enum class SimplifiedTokenType : uint8_t { + SIMPLIFIED_TOKEN_IDENTIFIER, + SIMPLIFIED_TOKEN_NUMERIC_CONSTANT, + SIMPLIFIED_TOKEN_STRING_CONSTANT, + SIMPLIFIED_TOKEN_OPERATOR, + SIMPLIFIED_TOKEN_KEYWORD, + SIMPLIFIED_TOKEN_COMMENT +}; + +struct SimplifiedToken { + SimplifiedTokenType type; + idx_t start; +}; + +enum class KeywordCategory : uint8_t { + KEYWORD_RESERVED, + KEYWORD_UNRESERVED, + KEYWORD_TYPE_FUNC, + KEYWORD_COL_NAME, + KEYWORD_NONE +}; + +struct ParserKeyword { + string name; + KeywordCategory category; +}; + +} // namespace duckdb + namespace duckdb { @@ -10738,6 +10694,8 @@ class KeywordHelper { //! Returns true if the given text matches a keyword of the parser static bool IsKeyword(const string &text); + static KeywordCategory KeywordCategoryType(const string &text); + static string EscapeQuotes(const string &text, char quote = '"'); //! Returns true if the given string needs to be quoted when written as an identifier @@ -11526,7 +11484,6 @@ class Hugeint { static int Sign(hugeint_t n); static hugeint_t Abs(hugeint_t n); - // comparison operators // note that everywhere here we intentionally use bitwise ops // this is because they seem to be consistently much faster (benchmarked on a Macbook Pro) @@ -14872,6 +14829,38 @@ struct StatementProperties { +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/main/client_properties.hpp +// +// +//===----------------------------------------------------------------------===// + + + + + + +namespace duckdb { + +enum class ArrowOffsetSize : uint8_t { REGULAR, LARGE }; + +//! A set of properties from the client context that can be used to interpret the query result +struct ClientProperties { + ClientProperties(string time_zone_p, ArrowOffsetSize arrow_offset_size_p, bool arrow_use_list_view_p, + bool produce_arrow_string_view_p, bool lossless_conversion) + : time_zone(std::move(time_zone_p)), arrow_offset_size(arrow_offset_size_p), + arrow_use_list_view(arrow_use_list_view_p), arrow_lossless_conversion(lossless_conversion) { + } + ClientProperties() {}; + string time_zone = "UTC"; + ArrowOffsetSize arrow_offset_size = ArrowOffsetSize::REGULAR; + bool arrow_use_list_view = false; + bool produce_arrow_string_view = false; + bool arrow_lossless_conversion = false; +}; +} // namespace duckdb namespace duckdb { @@ -15173,6 +15162,7 @@ enum class PendingExecutionResult : uint8_t { + //===----------------------------------------------------------------------===// // DuckDB // @@ -21144,6 +21134,7 @@ class BoundLambdaExpression : public Expression { + namespace duckdb { class Binder; @@ -21308,7 +21299,7 @@ class ExpressionBinder { const optional_ptr bind_lambda_function, const LogicalType &list_child_type); - static unique_ptr GetSQLValueFunction(const string &column_name); + virtual unique_ptr GetSQLValueFunction(const string &column_name); LogicalType ResolveOperatorType(OperatorExpression &op, vector> &children); LogicalType ResolveCoalesceType(OperatorExpression &op, vector> &children); @@ -21341,6 +21332,7 @@ class ExpressionBinder { //! Returns true if the function name is an alias for the UNNEST function static bool IsUnnestFunction(const string &function_name); BindResult TryBindLambdaOrJson(FunctionExpression &function, idx_t depth, CatalogEntry &func); + virtual void ThrowIfUnnestInLambda(const ColumnBinding &column_binding); }; } // namespace duckdb @@ -23168,6 +23160,8 @@ typedef enum DUCKDB_TYPE { DUCKDB_TYPE_ANY = 34, // duckdb_varint DUCKDB_TYPE_VARINT = 35, + // SQLNULL type + DUCKDB_TYPE_SQLNULL = 36, } duckdb_type; //! An enum over the returned state of different functions. typedef enum duckdb_state { DuckDBSuccess = 0, DuckDBError = 1 } duckdb_state; @@ -23901,8 +23895,8 @@ Returns the number of rows present in the result object. * @return The number of rows present in the result object. */ DUCKDB_API idx_t duckdb_row_count(duckdb_result *result); -#endif +#endif /*! Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0. @@ -23933,9 +23927,7 @@ printf("Data for row %d: %d\n", row, data[row]); * @return The column data of the specified column. */ DUCKDB_API void *duckdb_column_data(duckdb_result *result, idx_t col); -#endif -#ifndef DUCKDB_API_NO_DEPRECATED /*! **DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead. @@ -23958,8 +23950,8 @@ if (nullmask[row]) { * @return The nullmask of the specified column. */ DUCKDB_API bool *duckdb_nullmask_data(duckdb_result *result, idx_t col); -#endif +#endif /*! Returns the error message contained within the result. The error is only set if `duckdb_query` returns `DuckDBError`. @@ -24025,6 +24017,7 @@ Returns the number of data chunks present in the result. */ DUCKDB_API idx_t duckdb_result_chunk_count(duckdb_result result); +#endif /*! Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error @@ -24033,7 +24026,6 @@ Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on er */ DUCKDB_API duckdb_result_type duckdb_result_return_type(duckdb_result result); -#endif //===--------------------------------------------------------------------===// // Safe Fetch Functions //===--------------------------------------------------------------------===// @@ -24698,8 +24690,8 @@ Note that the result must be freed with `duckdb_destroy_result`. */ DUCKDB_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statement prepared_statement, duckdb_result *out_result); -#endif +#endif //===--------------------------------------------------------------------===// // Extract Statements //===--------------------------------------------------------------------===// @@ -24789,8 +24781,8 @@ Note that after calling `duckdb_pending_prepared_streaming`, the pending result */ DUCKDB_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement, duckdb_pending_result *out_result); -#endif +#endif /*! Closes the pending result and de-allocates all memory allocated for the result. @@ -27073,8 +27065,8 @@ It is not known beforehand how many chunks will be returned by this result. * @return The resulting data chunk. Returns `NULL` if the result has an error. */ DUCKDB_API duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result); -#endif +#endif /*! Fetches a data chunk from a duckdb_result. This function should be called repeatedly until the result is exhausted. @@ -29610,6 +29602,8 @@ class Binder : public enable_shared_from_this { unique_ptr BindShowTable(ShowRef &ref); unique_ptr BindSummarize(ShowRef &ref); + unique_ptr UnionOperators(vector> nodes); + private: Binder(ClientContext &context, shared_ptr parent, BinderType binder_type); }; @@ -29968,7 +29962,7 @@ struct DBConfigOptions { //! The peak allocation threshold at which to flush the allocator after completing a task (1 << 27, ~128MB) idx_t allocator_flush_threshold = 134217728ULL; //! If bulk deallocation larger than this occurs, flush outstanding allocations (1 << 30, ~1GB) - idx_t allocator_bulk_deallocation_flush_threshold = 1073741824ULL; + idx_t allocator_bulk_deallocation_flush_threshold = 536870912ULL; //! Whether the allocator background thread is enabled bool allocator_background_threads = false; //! DuckDB API surface @@ -30088,7 +30082,7 @@ struct DBConfig { DUCKDB_API IndexTypeSet &GetIndexTypes(); static idx_t GetSystemMaxThreads(FileSystem &fs); static idx_t GetSystemAvailableMemory(FileSystem &fs); - static idx_t ParseMemoryLimitSlurm(const string &arg); + static optional_idx ParseMemoryLimitSlurm(const string &arg); void SetDefaultMaxMemory(); void SetDefaultTempDirectory(); @@ -31097,7 +31091,7 @@ struct HTTPProxyUsername { }; struct HTTPProxyPassword { - static constexpr const char *Name = "http_proxy"; + static constexpr const char *Name = "http_proxy_password"; static constexpr const char *Description = "Password for HTTP proxy"; static constexpr const LogicalTypeId InputType = LogicalTypeId::VARCHAR; static void SetGlobal(DatabaseInstance *db, DBConfig &config, const Value ¶meter); @@ -31187,7 +31181,9 @@ struct StreamingBufferSize { struct MaximumTempDirectorySize { static constexpr const char *Name = "max_temp_directory_size"; static constexpr const char *Description = - "The maximum amount of data stored inside the 'temp_directory' (when set) (e.g. 1GB)"; + "The maximum amount of data stored inside the 'temp_directory' (when set). If the `temp_directory` is set to " + "an existing directory, this option defaults to the available disk space on " + "that drive. Otherwise, it defaults to 0 (implying that the temporary directory is not used)."; static constexpr const LogicalTypeId InputType = LogicalTypeId::VARCHAR; static void SetGlobal(DatabaseInstance *db, DBConfig &config, const Value ¶meter); static void ResetGlobal(DatabaseInstance *db, DBConfig &config); @@ -32756,6 +32752,7 @@ struct ParsedExtensionMetaData { string duckdb_capi_version; string extension_version; string signature; + string extension_abi_metadata; bool AppearsValid() { return magic_value == EXPECTED_MAGIC_VALUE; diff --git a/mix.exs b/mix.exs index ff75fc3..a085d62 100644 --- a/mix.exs +++ b/mix.exs @@ -1,8 +1,8 @@ defmodule Duckdbex.MixProject do use Mix.Project - @version "0.3.3" - @duckdb_version "1.1.0" + @version "0.3.4" + @duckdb_version "1.1.1" def project do [