// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. namespace cpp doris namespace java org.apache.doris.thrift include "Exprs.thrift" include "Types.thrift" include "Opcodes.thrift" include "Partitions.thrift" include "Descriptors.thrift" include "ExternalTableSchema.thrift" enum TPlanNodeType { OLAP_SCAN_NODE = 0, MYSQL_SCAN_NODE = 1, CSV_SCAN_NODE = 2, // deprecated SCHEMA_SCAN_NODE = 3, HASH_JOIN_NODE = 4, MERGE_JOIN_NODE = 5, // deprecated AGGREGATION_NODE = 6, PRE_AGGREGATION_NODE = 7, SORT_NODE = 8, EXCHANGE_NODE = 9, MERGE_NODE = 10, SELECT_NODE = 11, CROSS_JOIN_NODE = 12, META_SCAN_NODE = 13, ANALYTIC_EVAL_NODE = 14, OLAP_REWRITE_NODE = 15, // deprecated KUDU_SCAN_NODE = 16, // Deprecated BROKER_SCAN_NODE = 17, EMPTY_SET_NODE = 18, UNION_NODE = 19, ES_SCAN_NODE = 20, ES_HTTP_SCAN_NODE = 21, REPEAT_NODE = 22, ASSERT_NUM_ROWS_NODE = 23, INTERSECT_NODE = 24, EXCEPT_NODE = 25, ODBC_SCAN_NODE = 26, TABLE_FUNCTION_NODE = 27, DATA_GEN_SCAN_NODE = 28, FILE_SCAN_NODE = 29, JDBC_SCAN_NODE = 30, TEST_EXTERNAL_SCAN_NODE = 31, PARTITION_SORT_NODE = 32, GROUP_COMMIT_SCAN_NODE = 33, MATERIALIZATION_NODE = 34, REC_CTE_NODE = 35, REC_CTE_SCAN_NODE = 36, BUCKETED_AGGREGATION_NODE = 37, LOCAL_EXCHANGE_NODE = 38 } struct TKeyRange { 1: required i64 begin_key 2: required i64 end_key 3: required Types.TPrimitiveType column_type 4: required string column_name } // The information contained in subclasses of ScanNode captured in two separate // Thrift structs: // - TScanRange: the data range that's covered by the scan (which varies with the // particular partition of the plan fragment of which the scan node is a part) // - T: all other operational parameters that are the same across // all plan fragments // ATTN(changelog-rename): formerly "TBinlogScanType" enum TChangelogScanType { NONE = 0, APPEND_ONLY = 1, MIN_DELTA = 2, DETAIL = 3, UNKNOWN = 4 } struct TPaloScanRange { 1: required list hosts 2: required string schema_hash 3: required string version 4: required string version_hash // Deprecated 5: required Types.TTabletId tablet_id 6: required string db_name 7: optional list partition_column_ranges 8: optional string index_name 9: optional string table_name 10: optional i64 start_tso 11: optional i64 end_tso // ATTN(changelog-rename): formerly "binlog_scan_type" 12: optional TChangelogScanType changelog_scan_type // Full distribution bucket ordinal/count for runtime-filter bucket pruning // and exact scan-key bucket pruning. The count is not the selected tablet count. 13: optional i32 bucket_seq 14: optional i32 bucket_num } enum TFileFormatType { FORMAT_UNKNOWN = -1, FORMAT_CSV_PLAIN = 0, FORMAT_CSV_GZ = 1, FORMAT_CSV_LZO = 2, FORMAT_CSV_BZ2 = 3, FORMAT_CSV_LZ4FRAME = 4, FORMAT_CSV_LZOP = 5, FORMAT_PARQUET = 6, FORMAT_CSV_DEFLATE = 7, FORMAT_ORC = 8, FORMAT_JSON = 9, FORMAT_PROTO = 10, FORMAT_JNI = 11, FORMAT_AVRO = 12, // Deprecated: reading this format is no longer supported. FORMAT_CSV_LZ4BLOCK = 13, FORMAT_CSV_SNAPPYBLOCK = 14, FORMAT_WAL = 15, FORMAT_ARROW = 16, FORMAT_TEXT = 17, FORMAT_NATIVE = 18, FORMAT_LANCE = 19, FORMAT_ES_HTTP = 20, FORMAT_MONGODB = 21, // Older readers must reject this format instead of ignoring optional file or delete keys. FORMAT_PARQUET_PME = 22 } // In previous versions, the data compression format and file format were stored together, as TFileFormatType, // which was inconvenient for flexible combination of file format and compression format. // Therefore, the compressed format is separately added here. // In order to ensure forward compatibility, if this type is set, the type shall prevail, // otherwise, the TFileFormatType shall prevail enum TFileCompressType { UNKNOWN = 0, PLAIN = 1, GZ = 2, LZO = 3, BZ2 = 4, LZ4FRAME = 5, DEFLATE = 6, LZOP = 7, LZ4BLOCK = 8, SNAPPYBLOCK = 9, ZLIB = 10, ZSTD = 11 } struct THdfsConf { 1: required string key 2: required string value } struct THdfsParams { 1: optional string fs_name 2: optional string user 3: optional string hdfs_kerberos_principal 4: optional string hdfs_kerberos_keytab 5: optional list hdfs_conf // Used for Cold Heat Separation to specify the root path 6: optional string root_path } // One broker range information. struct TBrokerRangeDesc { 1: required Types.TFileType file_type 2: required TFileFormatType format_type 3: required bool splittable; // Path of this range 4: required string path // Offset of this file start 5: required i64 start_offset; // Size of this range, if size = -1, this means that will read to then end of file 6: required i64 size // used to get stream for this load 7: optional Types.TUniqueId load_id // total size of the file 8: optional i64 file_size // number of columns from file 9: optional i32 num_of_columns_from_file // columns parsed from file path should be after the columns read from file 10: optional list columns_from_path // it's usefull when format_type == FORMAT_JSON 11: optional bool strip_outer_array; 12: optional string jsonpaths; 13: optional string json_root; // it's usefull when format_type == FORMAT_JSON 14: optional bool num_as_string; 15: optional bool fuzzy_parse; 16: optional THdfsParams hdfs_params 17: optional bool read_json_by_line; // Whether read line by column defination, only for Hive 18: optional bool read_by_column_def; // csv with header type 19: optional string header_type; // csv skip line num, only used when csv header_type is not set. 20: optional i32 skip_lines; } struct TBrokerScanRangeParams { 1: required i8 column_separator; 2: required i8 line_delimiter; // We construct one line in file to a tuple. And each field of line // correspond to a slot in this tuple. // src_tuple_id is the tuple id of the input file 3: required Types.TTupleId src_tuple_id // src_slot_ids is the slot_ids of the input file // we use this id to find the slot descriptor 4: required list src_slot_ids // dest_tuple_id is the tuple id that need by scan node 5: required Types.TTupleId dest_tuple_id // This is expr that convert the content read from file // the format that need by the compute layer. 6: optional map expr_of_dest_slot // properties need to access broker. 7: optional map properties; // If partition_ids is set, data that doesn't in this partition will be filtered. 8: optional list partition_ids // This is the mapping of dest slot id and src slot id in load expr // It excludes the slot id which has the transform expr 9: optional map dest_sid_to_src_sid_without_trans // strictMode is a boolean // if strict mode is true, the incorrect data (the result of cast is null) will not be loaded 10: optional bool strict_mode // for multibytes separators 11: optional i32 column_separator_length = 1; 12: optional i32 line_delimiter_length = 1; 13: optional string column_separator_str; 14: optional string line_delimiter_str; // trim double quotes for csv 15: optional bool trim_double_quotes; } // Broker scan range struct TBrokerScanRange { 1: required list ranges 2: required TBrokerScanRangeParams params 3: required list broker_addresses } // Es scan range struct TEsScanRange { 1: required list es_hosts // es hosts is used by be scan node to connect to es // has to set index and type here, could not set it in scannode // because on scan node maybe scan an es alias then it contains one or more indices 2: required string index 3: optional string type 4: required i32 shard_id } struct TFileTextScanRangeParams { 1: optional string column_separator; 2: optional string line_delimiter; 3: optional string collection_delimiter;// array ,map ,struct delimiter 4: optional string mapkv_delimiter; 5: optional i8 enclose; 6: optional i8 escape; 7: optional string null_format; 8: optional bool empty_field_as_null } enum TColumnCategory { REGULAR = 0, PARTITION_KEY = 1, SYNTHESIZED = 2, GENERATED = 3, } struct TFileScanSlotInfo { 1: optional Types.TSlotId slot_id; 2: optional bool is_file_slot; 3: optional TColumnCategory category; // Default value expression for this column when it is missing from the data file. // Populated by FE from Column.getDefaultValue() or NULL literal. // This replaces the separate default_value_of_src_slot map in TFileScanRangeParams. 4: optional Exprs.TExpr default_value_expr; } // descirbe how to read file struct TFileAttributes { 1: optional TFileTextScanRangeParams text_params; // it's usefull when format_type == FORMAT_JSON 2: optional bool strip_outer_array; 3: optional string jsonpaths; 4: optional string json_root; 5: optional bool num_as_string; 6: optional bool fuzzy_parse; 7: optional bool read_json_by_line; // Whether read line by column defination, only for Hive 8: optional bool read_by_column_def; // csv with header type 9: optional string header_type; // trim double quotes for csv 10: optional bool trim_double_quotes; // csv skip line num, only used when csv header_type is not set. 11: optional i32 skip_lines; //For text type file reading, whether to enable utf8 encoding check.(Catalog && TVF) 12: optional bool enable_text_validate_utf8 = true; // org.openx.data.jsonserde.JsonSerDe 13: optional bool openx_json_ignore_malformed = false; // Hive OpenCSVSerde has different field states and physical record boundaries from load CSV. // Requires BE execution version >= 15 and excludes smooth-upgrade source backends. 14: optional bool hive_open_csv = false; // for cloud copy into 1001: optional bool ignore_csv_redundant_col; } // Per-file decryption payload for FE-to-BE reader setup. Execution remains blocked until // native decryption and protected transport are available. // redact_file_encryption.py runs after code generation to hide these fields in diagnostics. // Only binary/compact RPC preserves this payload; diagnostic JSON is deliberately lossy. struct TFileEncryptionInfo { // Version 1: Parquet AES_GCM_V1, with an unwrapped file key and the exact SDK AAD prefix. 1: optional i32 version; // Unwrapped file data-encryption key for the BE reader; never a KMS master key. 2: optional binary key; // Presence is required by version 1, including when the prefix is empty. 3: optional binary aad_prefix; } struct TIcebergDeleteFileDesc { 1: optional string path; 2: optional i64 position_lower_bound; 3: optional i64 position_upper_bound; 4: optional list field_ids; // Iceberg file type, 0: data, 1: position delete, 2: equality delete, 3: deletion vector. 5: optional i32 content; // 6 & 7 : iceberg v3 deletion vector. // The content_offset and content_size_in_bytes fields are used to reference a specific blob for direct access to a deletion vector. 6: optional i64 content_offset; 7: optional i64 content_size_in_bytes; 8: optional TFileFormatType file_format; // Original Iceberg delete file path before Doris storage path normalization. 9: optional string original_path; // Referenced data file path. Required to materialize rows from deletion vectors. 10: optional string referenced_data_file_path; 11: optional i64 file_size; // Independent of the data file key. Absence retains plaintext semantics. 12: optional TFileEncryptionInfo encryption_info; } struct TIcebergFileDesc { 1: optional i32 format_version; // Iceberg file type, 0: data, 1: position delete, 2: equality delete. // deprecated, a data file can have both position and delete files 2: optional i32 content; // When open a delete file, filter the data file path with the 'file_path' property 3: optional list delete_files; // Deprecated 4: optional Types.TTupleId delete_table_tuple_id; // Deprecated 5: optional Exprs.TExpr file_select_conjunct; 6: optional string original_file_path; // Deprecated 7: optional i64 row_count; 8: optional i32 partition_spec_id; 9: optional string partition_data_json; // Only for format_version >= 3, the starting _row_id to assign to rows added by ADDED data files. 10: optional i64 first_row_id; // Only for format_version >= 3, the sequence number which last updated this file. 11: optional i64 last_updated_sequence_number; 12: optional string serialized_split; // Reserved for branch-4.1 / branch-4.2 field `13: optional ExternalTableSchema.TSchema // equality_delete_schema` (the split-local schema of dropped equality-delete keys). Master // carries those schemas in TFileScanRangeParams.history_schema_info. Do not reuse this id. // Absence retains plaintext semantics; an empty or unsupported payload must never do so. 14: optional TFileEncryptionInfo encryption_info; } struct TPaimonDeletionFileDesc { 1: optional string path; 2: optional i64 offset; 3: optional i64 length; } enum TPaimonReaderType { PAIMON_NATIVE = 0, PAIMON_JNI = 1, // Deprecated wire value kept during rolling upgrades. New plans never emit it. PAIMON_CPP = 2, PAIMON_RUST = 3, } // Reserved for Paimon primary-key vector search. Keep wire values aligned with branch-4.2. enum TPaimonVectorPayloadType { // Serialized BucketVectorSearchSplit for candidate generation. BUCKET_SPLIT_BYTES = 0, // Opaque payload for delayed materialization. MATERIALIZE_OPAQUE_BYTES = 1, } // Reserved for #69493. The payload contains raw bytes, not a base64-encoded split. struct TPaimonVectorPayload { 1: optional TPaimonVectorPayloadType payload_type; 2: optional binary bytes; } // A managed BLOB column file, aligned with a Parquet anchor by absolute Paimon row id. struct TPaimonBlobFileDesc { 1: optional string path; 2: optional i64 file_size; // This .blob file's own logical row range: [first_row_id, first_row_id + row_count). 3: optional i64 first_row_id; 4: optional i64 row_count; 5: optional i32 field_id; } struct TPaimonFileDesc { 1: optional string paimon_split 2: optional string paimon_column_names 3: optional string db_name // deprecated 4: optional string table_name // deprecated 5: optional string paimon_predicate 6: optional map paimon_options // deprecated 7: optional i64 ctl_id // deprecated 8: optional i64 db_id // deprecated 9: optional i64 tbl_id // deprecated 10: optional i64 last_update_time // deprecated 11: optional string file_format 12: optional TPaimonDeletionFileDesc deletion_file; 13: optional map hadoop_conf // deprecated 14: optional string paimon_table // deprecated 15: optional i64 row_count // deprecated 16: optional i64 schema_id; // for schema change. // Reader implementation for logical paimon split. Native file split uses range format type. 17: optional TPaimonReaderType reader_type; // Reserved for the Paimon Rust reader. Keep these ids aligned with branch-4.1. 18: optional string paimon_table_schema_json 19: optional string paimon_branch // Original Paimon RawFile.path() before Doris storage path normalization. Native readers use this // to materialize the public file-location metadata column. This master-only field is appended after // the branch-4.1 fields instead of reusing field 18. 20: optional string original_file_path; // Keep BLOB scan metadata aligned with branch-4.1. 21: optional list blob_files // Logical row ID of row position 0 in the complete Parquet anchor. Byte splits of // the same anchor share this origin; this is not the first row returned by a split. 22: optional i64 anchor_first_row_id // Complete anchor range: [anchor_first_row_id, anchor_first_row_id + anchor_row_count). 23: optional i64 anchor_row_count // Reserved for the per-split Paimon primary-key vector search payload in #69493. 24: optional TPaimonVectorPayload vector_payload; } struct TTrinoConnectorFileDesc { 1: optional string catalog_name 2: optional string db_name 3: optional string table_name 4: optional map trino_connector_options 5: optional string trino_connector_table_handle 6: optional string trino_connector_column_handles 7: optional string trino_connector_column_metadata 8: optional string trino_connector_column_names // not used 9: optional string trino_connector_split 10: optional string trino_connector_predicate 11: optional string trino_connector_trascation_handle } struct TMaxComputeFileDesc { 1: optional string partition_spec // deprecated 2: optional string session_id 3: optional string table_batch_read_session // for mc network configuration 4: optional i32 connect_timeout 5: optional i32 read_timeout 6: optional i32 retry_times } struct THudiFileDesc { 1: optional string instant_time; 2: optional string serde; 3: optional string input_format; 4: optional string base_path; 5: optional string data_file_path; 6: optional i64 data_file_length; 7: optional list delta_logs; 8: optional list column_names; 9: optional list column_types; 10: optional list nested_fields; 11: optional string hudi_jni_scanner; // deprecated 12: optional i64 schema_id; // for schema change. (native reader) } // Deprecated: the associated external table read support has been removed. struct TLakeSoulFileDesc { 1: optional list file_paths; 2: optional list primary_keys; 3: optional list partition_descs; 4: optional string table_schema; 5: optional string options; } // Deprecated: the associated external table read support has been removed. struct TTransactionalHiveDeleteDeltaDesc { 1: optional string directory_location 2: optional list file_names } // Deprecated: the associated external table read support has been removed. struct TTransactionalHiveDesc { 1: optional string partition 2: optional list delete_deltas } struct TRemoteDorisFileDesc { 1: optional string ip 2: optional string arrow_port 3: optional binary ticket 4: optional string location_uri 5: optional string user 6: optional string password } // The external search enums below spell out their values because those values are on the wire: // branch-4.1/4.2 declared the same enums without explicit values, so each member must keep its // implicit position (FLOAT16 = 0, FLOAT32 = 1, ...) on every branch. // Element type and byte layout of a vector search query. The encoded values use little-endian // byte order and contain exactly `dimension` elements of `element_type`. enum TVectorElementType { FLOAT16 = 0, FLOAT32 = 1, FLOAT64 = 2, UINT8 = 3, INT8 = 4 } enum TVectorMetric { DEFAULT = 0, L2 = 1, COSINE = 2, DOT_PRODUCT = 3, HAMMING = 4 } struct TSearchVector { 1: optional TVectorElementType element_type 2: optional i32 dimension 3: optional binary values // Present only for one multi-vector query; values contains a row-major matrix. 4: optional i32 num_vectors } // Logical result parameters for one vector query. `top_k` is the number of rows returned after // skipping `offset`; an adapter may fetch more physical candidates to implement that contract. struct TVectorSearchParams { 1: optional string column 2: optional TSearchVector query_vector 3: optional i64 top_k 4: optional i64 offset 5: optional TVectorMetric metric // FLOAT bounds: inclusive lower and exclusive upper. 6: optional double distance_lower_bound 7: optional double distance_upper_bound } enum TFtsCoverageMode { STRICT = 0, INDEX_ONLY = 1 } enum TFtsQueryType { MATCH = 0, PHRASE = 1 } enum TFtsMatchOperator { OR = 0, AND = 1 } // Logical parameters for one full-text query. MATCH combines analyzed terms with match_operator; // PHRASE searches the analyzed terms in order and permits phrase_slop intervening positions. struct TFullTextSearchParams { 1: optional string column 2: optional string query 3: optional i64 top_k 4: optional i64 offset // STRICT requires the selected FTS index to cover the complete pinned snapshot. INDEX_ONLY // searches and scores only fragments covered by committed FTS index segments. 5: optional TFtsCoverageMode coverage_mode // Reserved for distributed FTS. Every BE may search a different index-segment subset, so // statistics prepared independently on each BE would produce BM25 scores that are not // comparable during the final TopK merge. The payload must be prepared once for the exact // snapshot, logical FTS index, segment set, and query (including its final fuzzy vocabulary), // then validated and installed unchanged on every BE scanner. // // Doris currently leaves this field unset and BE rejects a set value because Lance/lance-c // does not yet provide the complete producer and consumer contract. Track the upstream work // at https://github.com/lance-format/lance/issues/8937. 6: optional binary global_statistics 7: optional TFtsQueryType query_type // MATCH-only parameters. max_fuzzy_distance is reserved as zero until the bundled Lance-C // supports one canonical fuzzy vocabulary across all prepared index segments. 8: optional TFtsMatchOperator match_operator 9: optional i32 max_fuzzy_distance // PHRASE-only parameter. Zero requires an exact phrase. 10: optional i32 phrase_slop } enum TSearchFilterFormat { SQL = 0, SUBSTRAIT = 1 } // A TVF search filter is evaluated by the search provider. TExternalSearchRequest.prefilter // controls whether Lance applies it before or after vector/FTS candidate selection. A normal SQL // predicate above the search relation remains a Doris residual. struct TSearchFilter { 1: optional TSearchFilterFormat format 2: optional binary payload } // Optional vector search tuning. Logical query fields stay in TVectorSearchParams so providers // can reuse the same request and interpret the supported tuning fields independently. struct TVectorSearchOptions { 1: optional i32 nprobes 2: optional i32 refine_factor 3: optional i32 ef 4: optional bool use_index // Lance: -1 uses available CPU parallelism, 0 selects automatically, positive values cap it. 5: optional i32 query_parallelism // Reserved for branch-4.2 (#69852) until approx_mode is introduced on master: // 6: optional TVectorApproxMode approx_mode // with enum TVectorApproxMode { FAST = 0, NORMAL = 1, ACCURATE = 2 } } // The active union field identifies the logical search kind. A future hybrid field can contain both // vector and full-text subqueries plus its fusion parameters without changing either existing field. union TExternalSearchQuery { 1: TVectorSearchParams vector_search 2: TFullTextSearchParams full_text_search } // A catalog/S3 range reads fragments from a fixed snapshot. A local TVF range uses version zero // without fragment_ids to open the latest snapshot and scan the whole dataset on its selected BE. struct TLanceFileDesc { // URI of the Lance dataset (s3://..., file:///..., etc.) 1: optional string dataset_uri // Specific fragment IDs to read (for split-level parallelism) 2: optional list fragment_ids // Dataset version for time travel 3: optional i64 version // Per-split row limit pushed down from the query LIMIT. Each scanner returns at // most this many rows; the upper LIMIT operator still enforces the global bound. // Only set for ordinary scans whose predicates are fully pushed into Lance. 4: optional i64 limit // Physical index segments assigned to this split. Each UUID is 16 bytes in RFC 4122 order. // An ordinary scan accepts exactly one scalar segment and requires a fixed version and // nonempty fragment_ids. Vector/FTS scans interpret these as their own index segments. // Unset for fragment scans without an assigned segment. 5: optional list index_segment_uuids // Ordinary scans only. False for uncovered-fragment tasks in a scalar segment plan, // so these tasks filter their rows without repeating global scalar-index evaluation. // Unset preserves Lance's default; an explicit scalar segment must not be combined with false. 6: optional bool use_scalar_index } // A statement-wide source snapshot. Sessions and cursors remain local to each driver owner. struct TMongoSnapshot { // Seconds component of the server-selected BSON Timestamp T, not a BSON Date or a client clock. // Both Timestamp components are unsigned 32-bit values carried in i64 to preserve their full range. 1: optional i64 timestamp_seconds // Ordering counter within the same second; this is not a fractional-second duration. 2: optional i64 timestamp_increment // "replica_set" or "mongos", qualified independently of the collection's object kind. 3: optional string source_kind // Replica-set settings.replicaSetId or sharded-cluster config.version.clusterId, as 24-digit hex. // Identifies the source deployment; the namespace UUID is carried separately in TMongoScanDesc. 4: optional string source_id // replSetGetConfig.config.version, not hello.topologyVersion or an election term. // Zero for mongos, whose shared clusterId allows scans through different routers. 5: optional i64 topology_version // hello.maxWireVersion: 21 for MongoDB 7.0, 25 for 8.0. BE rechecks this qualification pin. 6: optional i32 max_wire_version // Public listCollections.options as canonical Extended JSON, preserving BSON value types. // BE compares the definition before reading and at EOF. Without a public time-series UUID, // this cannot detect drop/recreate with identical options; concurrent drop/rename is excluded. // Absent for ordinary collections. Does not contain credentials. 7: optional string timeseries_options_json } // One partition of a complete, frozen MongoDB plan. Bounds are typed BSON values, never SQL casts. struct TMongoSplit { // range, or single when planning retained the complete namespace. 1: optional string strategy // Top-level BSON field and scalar family (objectId/integer/date); empty for single. 2: optional string field 3: optional string type_family // Zero-based partition number; the last range-plan partition is the disjoint complement. 4: optional i32 index // Desired total, admitted total, and frozen total, including the complement. 5: optional i32 requested 6: optional i32 admitted 7: optional i32 actual // Stable decision code only; never contains source values, URIs, or driver errors. 8: optional string reason // Independent partition predicate, ANDed with the SQL candidate while preserving its residual. 9: optional binary filter_bson } // Stable read descriptor. Driver objects and active sessions remain local to FE/BE. struct TMongoScanDesc { // Version 1 is the complete single cursor; version 2 requires a frozen range partition. 1: optional i32 version // Doris catalog identity used to isolate authenticated BE client pools. 2: optional i64 catalog_id // Fingerprint of pinned connection/authentication settings; pool reuse requires a matching value. 3: optional string configuration_version // Remote MongoDB database name, preserving the source spelling. 4: optional string database // Public logical collection/view/time-series name; never an internal system.buckets namespace. 5: optional string collection // Source object kind: "collection", "view", or "timeseries". 6: optional string object_kind // Available source collection UUID as lowercase hex. Empty means metadata did not provide one; // a nonempty value must match before BE scans, preventing reads after DROP/CREATE name reuse. 7: optional string collection_uuid // Fingerprint of the statement-pinned schema/source definition, also carried by column handles. 8: optional string schema_version // Versioned JSON containing owned field names, exact path segments, BSON tags/subtypes and // child bindings. BE uses it for decoding; it does not sample or infer a schema from rows. 9: optional string bindings_json // MongoDB connection URI (including optional TLS/SRV/compression settings). May contain secrets; // keep it out of EXPLAIN, profiles, and error messages. 10: optional string uri // Optional separate authentication user; empty uses URI credentials or unauthenticated access. 11: optional string username // Secret for the separate username, carried only in the typed scan RPC descriptor. 12: optional string password // Authentication database for separate credentials, normally "admin"; not the data database. 13: optional string auth_database // Data-read routing: primary, primaryPreferred, secondary, secondaryPreferred, or nearest. // URI tag sets and max staleness remain in uri and are preserved by the native driver. // Metadata/UUID checks use primary independently of this data-read preference. 14: optional string read_preference // Data-read concern: local, majority, available, or snapshot. Snapshot requires the shared pin below. 15: optional string read_concern // Replace top-level conversion mismatches with SQL NULL after rollback. Transport, cancellation, // allocation and document-limit errors still fail the scan. 16: optional bool type_mismatch_as_null // Positive document count requested per find/getMore driver batch (1..65536), from the session. // Doris output blocks also obey a separate row/byte budget in MongoFileReader. 17: optional i32 batch_size // Local scan lifetime in milliseconds, derived from session query_timeout; bounds pool waits // and socket/server execution budgets and is checked before/after cursor advancement. // Synchronous connection/selection can still run up to their stable configured transport caps. // Snapshot planning subtracts elapsed FE snapshot-selection/planning time before publishing it. 18: optional i64 timeout_ms // Stable connection establishment cap in milliseconds; independent of per-scan remaining time. 19: optional i32 connect_timeout_ms // Stable server-selection cap in milliseconds; independent of per-scan remaining time. 20: optional i32 server_selection_timeout_ms // Socket I/O timeout in milliseconds; the leased client is bounded by the remaining scan time. 21: optional i32 socket_timeout_ms // Maximum simultaneously leased clients per BE scan instance (query/fragment/output tuple). // Catalog/configuration/credentials and transport policy further isolate its pool. // Independent scans do not share this quota; it is not a source-wide connection budget. 22: optional i32 pool_max_clients // Typed BSON candidate filter; the Doris residual is retained. Absent means scan all documents. 23: optional binary filter_bson // BSON inclusion projection of complete source roots. Absent means return the complete document. 24: optional binary projection_bson // Present exactly for read_concern=snapshot; every participating scan uses the same timestamp. 25: optional TMongoSnapshot snapshot // Version 2 requires a range partition at the common snapshot; single may carry diagnostics. 26: optional TMongoSplit split } struct TTableFormatFileDesc { 1: optional string table_format_type 2: optional TIcebergFileDesc iceberg_params 3: optional THudiFileDesc hudi_params 4: optional TPaimonFileDesc paimon_params 5: optional TTransactionalHiveDesc transactional_hive_params // Deprecated: reading this format is no longer supported. 6: optional TMaxComputeFileDesc max_compute_params 7: optional TTrinoConnectorFileDesc trino_connector_params 8: optional TLakeSoulFileDesc lakesoul_params // Deprecated: reading this format is no longer supported. 9: optional i64 table_level_row_count = -1 10: optional TRemoteDorisFileDesc remote_doris_params // JDBC connection parameters (used when table_format_type == "jdbc") 11: optional map jdbc_params 12: optional TLanceFileDesc lance_params // ES per-shard parameters (used when table_format_type == "es") // Contains: index, type, shard_id, host_port, es_hosts 13: optional map es_params // ADBC connection and query parameters (used when table_format_type == "adbc"). // Keys: driver_path, driver_entrypoint, uri, username, password, // adbc.