// 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 } 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 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 } 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, FORMAT_CSV_LZ4BLOCK = 13, FORMAT_CSV_SNAPPYBLOCK = 14, FORMAT_WAL = 15, FORMAT_ARROW = 16, FORMAT_TEXT = 17, FORMAT_NATIVE = 18, // Reserve the master wire IDs so branch-4.1 can explicitly keep these unsupported formats // off FileScannerV2 without renumbering later TFileFormatType values. FORMAT_LANCE = 19, FORMAT_ES_HTTP = 20 } // 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; // for cloud copy into 1001: optional bool ignore_csv_redundant_col; } 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; } 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; // Historical schema fragments required by equality-delete keys attached to this exact split. // Keeping this split-local preserves lazy batch planning without widening the query schema. 13: optional ExternalTableSchema.TSchema equality_delete_schema; } 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, } // 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; // paimon-rust: TableSchema serialized via JsonSerdeUtil.toJson(table.schema()). // Consumed by paimon_table_from_schema_json on BE; skips catalog/warehouse resolution. 18: optional string paimon_table_schema_json // paimon-rust: non-default branch name. Unset means main branch (matches // upstream paimon commit 742da63: null-if-DEFAULT_MAIN_BRANCH). 19: optional string paimon_branch // Field 20 is reserved for original_file_path on master. 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 } 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) } 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; } struct TTransactionalHiveDeleteDeltaDesc { 1: optional string directory_location 2: optional list file_names } 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 } // 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, FLOAT32, FLOAT64, UINT8, INT8 } enum TVectorMetric { DEFAULT, L2, COSINE, DOT_PRODUCT, HAMMING } 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, INDEX_ONLY } enum TFtsQueryType { MATCH, PHRASE } enum TFtsMatchOperator { OR, AND } // 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, SUBSTRAIT } // 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 } // 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 provider-independent logical search request. Physical target information remains in the // provider FileDesc (for example, dataset_uri/version/fragment_ids in TLanceFileDesc). struct TExternalSearchRequest { 1: optional i32 schema_version = 1 2: optional TExternalSearchQuery search_query 3: optional TSearchFilter search_filter 4: optional TVectorSearchOptions vector_search_options // Applies only to search_filter. Defaults to false (postfilter); Doris WHERE predicates remain // residuals regardless of this setting. 5: optional bool prefilter } // 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 { 1: optional string dataset_uri 2: optional list fragment_ids 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 } struct TLanceScanParams { // Serialized Substrait ExtendedExpression executed by the native Lance scanner. Set at // ScanNode level so it is not serialized once per fragment split. 1: optional binary lance_substrait_filter // Provider-independent search request. Set at ScanNode level so all ranges use the same logical // query. Lance external search uses one range per fragment or physical index segment, and Doris // merges the split-local candidates. 2: optional TExternalSearchRequest external_search_request // Lance-native storage options, handed to lance-c untranslated. The namespace protocol treats // storage_options as opaque configuration passed directly to Lance, so any key vocabulary the // BE imposed here would drop options it does not happen to know - including credentials a // namespace spelled with a different accepted alias, and every non-S3 provider's keys. // Set at ScanNode level so credentials are not serialized once per fragment split. // These are the initial options for the scan and are never refreshed: lance-c opens datasets // with a static option set, so credentials that expire mid-scan are not re-vended. Renewal // needs a refresh channel of its own, which this field is not. 3: optional map lance_storage_options } 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 6: optional TMaxComputeFileDesc max_compute_params 7: optional TTrinoConnectorFileDesc trino_connector_params 8: optional TLakeSoulFileDesc lakesoul_params 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 } // Deprecated, hive text talbe is a special format, not a serde type enum TTextSerdeType { JSON_TEXT_SERDE = 0, HIVE_TEXT_SERDE = 1, } struct TFileScanRangeParams { // deprecated, move to TFileScanRange 1: optional Types.TFileType file_type; // deprecated, move to TFileScanRange 2: optional TFileFormatType format_type; // deprecated, move to TFileScanRange 3: optional TFileCompressType compress_type; // If this is for load job, src point to the source table and dest point to the doris table. // If this is for query, only dest_tuple_id is set, including both file slot and partition slot. 4: optional Types.TTupleId src_tuple_id; 5: optional Types.TTupleId dest_tuple_id // num_of_columns_from_file can spilt the all_file_slot and all_partition_slot 6: optional i32 num_of_columns_from_file; // all selected slots which may compose from file and partition value. 7: optional list required_slots; 8: optional THdfsParams hdfs_params; // properties for file such as s3 information 9: optional map properties; // The convert exprt map for load job // desc slot id -> expr 10: optional map expr_of_dest_slot 11: optional map default_value_of_src_slot // 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 12: 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 13: optional bool strict_mode 14: optional list broker_addresses 15: optional TFileAttributes file_attributes 16: optional Exprs.TExpr pre_filter_exprs // Deprecated, For data lake table format 17: optional TTableFormatFileDesc table_format_params // For csv query task, same the column index in file, order by dest_tuple 18: optional list column_idxs // Map of slot to its position in table schema. Only for Hive external table. 19: optional map slot_name_to_schema_pos 20: optional list pre_filter_exprs_list 21: optional Types.TUniqueId load_id // Deprecated, hive text talbe is a special format, not a serde type 22: optional TTextSerdeType text_serde_type // used by flexible partial update 23: optional string sequence_map_col // table from FE, used for jni scanner // BE can use table director: // 1. Reduce the access to HMS and HDFS on the JNI side. // 2. There will be no inconsistency between the fe and be tables. 24: optional string serialized_table // Every time a iceberg/hudi/paimon table makes a schema change, a new schema id is generated. // This is used to represent the latest id. 25: optional i64 current_schema_id; // All schema information used in the current query process 26: optional list history_schema_info // Paimon predicate from FE, used for jni scanner // Set at ScanNode level to avoid redundant serialization in each split 27: optional string paimon_predicate // enable mapping varbinary type for Doris external table and TVF 28: optional bool enable_mapping_varbinary = false; 29: optional bool enable_mapping_timestamp_tz = false; // Paimon options from FE, used for jni/native scanner // Set at ScanNode level to avoid redundant serialization in each split 30: optional map paimon_options // Versioned Iceberg scan semantics negotiated by FE. Absence/zero preserves legacy BE // behavior during a BE-first rolling upgrade; version 1 enables file-wide ID projection and // logical initial-default materialization. 34: optional i32 iceberg_scan_semantics_version // FE-generated identity for sharing a deserialized table across JNI scanners in one scan node. 35: optional string serialized_table_cache_key // HMS catalog property hive.parquet.time-zone. Interpretation is versioned by // parquet_timestamp_semantics_version. 36: optional string hive_parquet_time_zone // 31-33 are used in master; do not allocate them in branch-4.1. 37: optional TLanceScanParams lance_scan_params // Non-regular columns in the pinned full schema, including columns pruned from phase one. // When present, omitted names are REGULAR. Used to rebuild row-id fetch projections. 38: optional map column_name_to_category // If both this marker and the timezone are absent, preserve legacy session-timezone decoding. // Version 1 makes an absent/empty hive_parquet_time_zone explicitly disable INT96 conversion. 39: optional i32 parquet_timestamp_semantics_version // Hybrid Paimon/Hudi scans keep FORMAT_JNI while individual ranges can be native Parquet. 40: optional bool contains_native_parquet } struct TFileRangeDesc { // If load_id is set, this is for stream/routine load. // If path is set, this is for bulk load. 1: optional Types.TUniqueId load_id // Path of this range 2: optional string path; // Offset of this file start 3: optional i64 start_offset; // Size of this range, if size = -1, this means that will read to the end of file 4: optional i64 size; // total size of file this range belongs to, -1 means unset 5: optional i64 file_size = -1; // columns parsed from file path should be after the columns read from file 6: optional list columns_from_path; // column names from file path, in the same order with columns_from_path 7: optional list columns_from_path_keys; // For data lake table format 8: optional TTableFormatFileDesc table_format_params // Use modification time to determine whether the file is changed 9: optional i64 modification_time 10: optional Types.TFileType file_type; 11: optional TFileCompressType compress_type; // for hive table, different files may have different fs, // so fs_name should be with TFileRangeDesc 12: optional string fs_name 13: optional TFileFormatType format_type; 14: optional i64 self_split_weight // whether the value of columns_from_path is null 15: optional list columns_from_path_is_null; 16: optional bool file_cache_admission; // FE's effective split target in bytes for BE-local physical split refinement. 17: optional i64 target_split_size; } struct TSplitSource { 1: optional i64 split_source_id 2: optional i32 num_splits } // TFileScanRange represents a set of descriptions of a file and the rules for reading and converting it. // TFileScanRangeParams: describe how to read and convert file // list: file location and range struct TFileScanRange { 1: optional list ranges // If file_scan_params in TExecPlanFragmentParams is set in TExecPlanFragmentParams // will use that field, otherwise, use this field. // file_scan_params in TExecPlanFragmentParams will always be set in query request, // and TFileScanRangeParams here is used for some other request such as fetch table schema for tvf. 2: optional TFileScanRangeParams params 3: optional TSplitSource split_source } // Scan range for external datasource, such as file on hdfs, es datanode, etc. struct TExternalScanRange { 1: optional TFileScanRange file_scan_range } enum TDataGenFunctionName { NUMBERS = 0, LIST_FILE = 1, } // Every table valued function should have a scan range definition to save its // running parameters struct TTVFNumbersScanRange { 1: optional i64 totalNumbers 2: optional bool useConst 3: optional i64 constValue } struct TTVFListFileScanRange { 1: Types.TS3Resource resource 2: string uri 3: bool recursive } struct TDataGenScanRange { 1: optional TTVFNumbersScanRange numbers_params 2: optional TTVFListFileScanRange list_file_params } // deprecated struct TIcebergMetadataParams { 1: optional Types.TIcebergQueryType iceberg_query_type 2: optional string catalog 3: optional string database 4: optional string table } // deprecated struct TPaimonMetadataParams { 1: optional string db_name 2: optional string tbl_name 3: optional string query_type 4: optional i64 ctl_id 5: optional i64 db_id 6: optional i64 tbl_id 7: optional string serialized_split 8: optional map hadoop_props 9: optional map paimon_props } struct THudiMetadataParams { 1: optional Types.THudiQueryType hudi_query_type 2: optional string catalog 3: optional string database 4: optional string table } struct TBackendsMetadataParams { 1: optional string cluster_name } struct TFrontendsMetadataParams { 1: optional string cluster_name 2: optional string current_connected_fe_host } struct TMaterializedViewsMetadataParams { 1: optional string database 2: optional Types.TUserIdentity current_user_ident } struct TPartitionsMetadataParams { 1: optional string catalog 2: optional string database 3: optional string table } struct TPartitionValuesMetadataParams { 1: optional string catalog 2: optional string database 3: optional string table } struct TJobsMetadataParams { 1: optional string type 2: optional Types.TUserIdentity current_user_ident } struct TTasksMetadataParams { 1: optional string type 2: optional Types.TUserIdentity current_user_ident } struct TQueriesMetadataParams { 1: optional string cluster_name 2: optional bool relay_to_other_fe 3: optional TMaterializedViewsMetadataParams materialized_views_params 4: optional TJobsMetadataParams jobs_params 5: optional TTasksMetadataParams tasks_params 6: optional TPartitionsMetadataParams partitions_params 7: optional TPartitionValuesMetadataParams partition_values_params } struct TMetaCacheStatsParams { } struct TParquetMetadataParams { 1: optional list paths 2: optional string mode 3: optional Types.TFileType file_type 4: optional map properties 5: optional string bloom_column 6: optional string bloom_literal } // Identifies a Lance table for read-only physical index entry inspection. struct TLanceIndexMetadataParams { 1: optional string catalog 2: optional string database 3: optional string table } struct TMetaScanRange { 1: optional Types.TMetadataType metadata_type 2: optional TIcebergMetadataParams iceberg_params // deprecated 3: optional TBackendsMetadataParams backends_params 4: optional TFrontendsMetadataParams frontends_params 5: optional TQueriesMetadataParams queries_params 6: optional TMaterializedViewsMetadataParams materialized_views_params 7: optional TJobsMetadataParams jobs_params 8: optional TTasksMetadataParams tasks_params 9: optional TPartitionsMetadataParams partitions_params 10: optional TMetaCacheStatsParams meta_cache_stats_params 11: optional TPartitionValuesMetadataParams partition_values_params 12: optional THudiMetadataParams hudi_params 13: optional TPaimonMetadataParams paimon_params // deprecated // for quering sys tables for Paimon/Iceberg 14: optional map hadoop_props 15: optional string serialized_table; 16: optional list serialized_splits; 17: optional TParquetMetadataParams parquet_params; 18: optional TLanceIndexMetadataParams lance_index_params; } // Specification of an individual data range which is held in its entirety // by a storage server struct TScanRange { // one of these must be set for every TScanRange2 4: optional TPaloScanRange palo_scan_range 5: optional binary kudu_scan_token // Decrepated 6: optional TBrokerScanRange broker_scan_range 7: optional TEsScanRange es_scan_range 8: optional TExternalScanRange ext_scan_range 9: optional TDataGenScanRange data_gen_scan_range 10: optional TMetaScanRange meta_scan_range } struct TMySQLScanNode { 1: required Types.TTupleId tuple_id 2: required string table_name 3: required list columns 4: required list filters } struct TOdbcScanNode { 1: optional Types.TTupleId tuple_id 2: optional string table_name //Deprecated 3: optional string driver 4: optional Types.TOdbcTableType type 5: optional list columns 6: optional list filters //Use now 7: optional string connect_string 8: optional string query_string } struct TJdbcScanNode { 1: optional Types.TTupleId tuple_id 2: optional string table_name 3: optional string query_string 4: optional Types.TOdbcTableType table_type 5: optional bool is_tvf } struct TBrokerScanNode { 1: required Types.TTupleId tuple_id // Partition info used to process partition select in broker load 2: optional list partition_exprs 3: optional list partition_infos 4: optional list pre_filter_exprs } struct TFileScanNode { 1: optional Types.TTupleId tuple_id 2: optional string table_name } struct TRecCTETarget { 1: optional Types.TNetworkAddress addr 2: optional Types.TUniqueId fragment_instance_id 3: optional i32 node_id } struct TRecCTEResetInfo { 1: optional Types.TNetworkAddress addr 2: optional i32 fragment_id } struct TRecCTENode { 1: optional bool is_union_all 2: optional list targets 3: optional list fragments_to_reset 4: optional list> result_expr_lists 5: optional list rec_side_runtime_filter_ids 6: optional bool is_used_by_other_rec_cte } struct TRecCTEScanNode { } struct TEsScanNode { 1: required Types.TTupleId tuple_id 2: optional map properties // used to indicate which fields can get from ES docavalue // because elasticsearch can have "fields" feature, field can have // two or more types, the first type maybe have not docvalue but other // can have, such as (text field not have docvalue, but keyword can have): // "properties": { // "city": { // "type": "text", // "fields": { // "raw": { // "type": "keyword" // } // } // } // } // then the docvalue context provided the mapping between the select field and real request field : // {"city": "city.raw"} // use select city from table, if enable the docvalue, we will fetch the `city` field value from `city.raw` 3: optional map docvalue_context // used to indicate which string-type field predicate should used xxx.keyword etc. // "k1": { // "type": "text", // "fields": { // "keyword": { // "type": "keyword", // "ignore_above": 256 // } // } // } // k1 > 'abc' -> k1.keyword > 'abc' 4: optional map fields_context } struct TMiniLoadEtlFunction { 1: required string function_name 2: required i32 param_column_index } struct TCsvScanNode { 1: required Types.TTupleId tuple_id 2: required list file_paths 3: optional string column_separator 4: optional string line_delimiter // 5: optional map column_type_mapping // columns specified in load command 6: optional list columns // 7: optional list unspecified_columns // always string type, and only contain columns which are not specified 8: optional list default_values 9: optional double max_filter_ratio 10:optional map column_function_mapping } struct TSchemaScanNode { 1: required Types.TTupleId tuple_id 2: required string table_name 3: optional string db 4: optional string table 5: optional string wild 6: optional string user // deprecated 7: optional string ip // frontend ip 8: optional i32 port // frontend thrift server port 9: optional i64 thread_id 10: optional string user_ip // deprecated 11: optional Types.TUserIdentity current_user_ident // to replace the user and user_ip 12: optional bool show_hidden_cloumns = false // 13: optional list table_structure // deprecated 14: optional string catalog 15: optional list fe_addr_list 16: optional string frontend_conjuncts } struct TMetaScanNode { 1: required Types.TTupleId tuple_id 2: optional Types.TMetadataType metadata_type 3: optional Types.TUserIdentity current_user_ident } struct TTestExternalScanNode { 1: optional Types.TTupleId tuple_id 2: optional string table_name } struct TSortInfo { 1: required list ordering_exprs 2: required list is_asc_order // Indicates, for each expr, if nulls should be listed first or last. This is // independent of is_asc_order. 3: required list nulls_first // Expressions evaluated over the input row that materialize the tuple to be sorted. // Contains one expr per slot in the materialized tuple. 4: optional list sort_tuple_slot_exprs // Indicates whether topn query using two phase read 6: optional bool use_two_phase_read } enum TPushAggOp { NONE = 0, MINMAX = 1, COUNT = 2, MIX = 3, COUNT_ON_INDEX = 4 } struct TScoreRangeInfo { // Score range filter parameters for BM25 range queries like score() > 0.5 1: optional Opcodes.TExprOpcode op 2: optional double threshold } struct TOlapScanNode { 1: required Types.TTupleId tuple_id 2: required list key_column_name 3: required list key_column_type 4: required bool is_preaggregation 5: optional string sort_column 6: optional Types.TKeysType keyType 7: optional string table_name 8: optional list columns_desc 9: optional TSortInfo sort_info // When scan match sort_info, we can push limit into OlapScanNode. // It's limit for scanner instead of scanNode so we add a new limit. 10: optional i64 sort_limit 11: optional bool enable_unique_key_merge_on_write 12: optional TPushAggOp push_down_agg_type_opt //Deprecated 13: optional bool use_topn_opt // Deprecated 14: optional list indexes_desc 15: optional set output_column_unique_ids 16: optional list distribute_column_ids 17: optional i32 schema_version 18: optional list topn_filter_source_node_ids //deprecated, move to TPlanNode.106 19: optional TSortInfo score_sort_info 20: optional i64 score_sort_limit 21: optional TSortInfo ann_sort_info 22: optional i64 ann_sort_limit 23: optional TScoreRangeInfo score_range_info // Enable value predicate pushdown for MOR tables 24: optional bool enable_mor_value_predicate_pushdown // Read MOR table as DUP table: skip merge, skip delete sign 25: optional bool read_mor_as_dup } struct TEqJoinCondition { // left-hand side of " = " 1: required Exprs.TExpr left; // right-hand side of " = " 2: required Exprs.TExpr right; // operator of equal join 3: optional Opcodes.TExprOpcode opcode; } enum TJoinOp { INNER_JOIN = 0, LEFT_OUTER_JOIN = 1, LEFT_SEMI_JOIN = 2, RIGHT_OUTER_JOIN = 3, FULL_OUTER_JOIN = 4, CROSS_JOIN = 5, MERGE_JOIN = 6, // deprecated RIGHT_SEMI_JOIN = 7, LEFT_ANTI_JOIN = 8, RIGHT_ANTI_JOIN = 9, // Similar to LEFT_ANTI_JOIN with special handling for NULLs for the join conjuncts // on the build side. Those NULLs are considered candidate matches, and therefore could // be rejected (ANTI-join), based on the other join conjuncts. This is in contrast // to LEFT_ANTI_JOIN where NULLs are not matches and therefore always returned. NULL_AWARE_LEFT_ANTI_JOIN = 10, NULL_AWARE_LEFT_SEMI_JOIN = 11, ASOF_LEFT_INNER_JOIN = 12, ASOF_RIGHT_INNER_JOIN = 13, ASOF_LEFT_OUTER_JOIN = 14, ASOF_RIGHT_OUTER_JOIN = 15 } enum TJoinDistributionType { NONE = 0, BROADCAST = 1, PARTITIONED = 2, BUCKET_SHUFFLE = 3, COLOCATE = 4, } struct THashJoinNode { 1: required TJoinOp join_op // anything from the ON, USING or WHERE clauses that's an equi-join predicate 2: required list eq_join_conjuncts // deprecated 3: optional list other_join_conjuncts // deprecated 4: optional bool add_probe_filters // anything from the ON or USING clauses (but *not* the WHERE clause) that's not an // equi-join predicate, only use in vec exec engine 5: optional Exprs.TExpr vother_join_conjunct // hash output column 6: optional list hash_output_slot_ids // TODO: remove 7 and 8 in the version after the version include projection on ExecNode // deprecated 7: optional list srcExprList // deprecated 8: optional Types.TTupleId voutput_tuple_id 9: optional list vintermediate_tuple_id_list 10: optional bool is_broadcast_join 11: optional bool is_mark 12: optional TJoinDistributionType dist_type 13: optional list mark_join_conjuncts // use_specific_projections true, if output exprssions is denoted by srcExprList represents, o.w. PlanNode.projections // deprecated 14: optional bool use_specific_projections 15: optional Exprs.TExpr match_condition } struct TNestedLoopJoinNode { 1: required TJoinOp join_op // deprecated 2: optional list srcExprList // deprecated 3: optional Types.TTupleId voutput_tuple_id 4: optional list vintermediate_tuple_id_list // Deprecated: bitmap runtime filter planning no longer uses this field; for bitmap filer, // don't need to join, but output left child tuple 5: optional bool is_output_left_side_only 6: optional Exprs.TExpr vjoin_conjunct 7: optional bool is_mark 8: optional list join_conjuncts 9: optional list mark_join_conjuncts // deprecated 10: optional bool use_specific_projections } struct TMergeJoinNode { // anything from the ON, USING or WHERE clauses that's an equi-join predicate 1: required list cmp_conjuncts // anything from the ON or USING clauses (but *not* the WHERE clause) that's not an // equi-join predicate 2: optional list other_join_conjuncts } enum TAggregationOp { INVALID = 0, COUNT = 1, MAX = 2, DISTINCT_PC = 3, DISTINCT_PCSA = 4, MIN = 5, SUM = 6, GROUP_CONCAT = 7, HLL = 8, COUNT_DISTINCT = 9, SUM_DISTINCT = 10, LEAD = 11, FIRST_VALUE = 12, LAST_VALUE = 13, RANK = 14, DENSE_RANK = 15, ROW_NUMBER = 16, LAG = 17, HLL_C = 18, BITMAP_UNION = 19, NTILE = 20, } //struct TAggregateFunctionCall { // The aggregate function to call. // 1: required Types.TFunction fn // The input exprs to this aggregate function // 2: required list input_exprs // If set, this aggregate function udf has varargs and this is the index for the // first variable argument. // 3: optional i32 vararg_start_idx //} struct TAggregationNode { 1: optional list grouping_exprs // aggregate exprs. The root of each expr is the aggregate function. The // other exprs are the inputs to the aggregate function. 2: required list aggregate_functions // Tuple id used for intermediate aggregations (with slots of agg intermediate types) 3: required Types.TTupleId intermediate_tuple_id // Tupld id used for the aggregation output (with slots of agg output types) // Equal to intermediate_tuple_id if intermediate type == output type for all // aggregate functions. 4: required Types.TTupleId output_tuple_id // Set to true if this aggregation function requires finalization to complete after all // rows have been aggregated, and this node is not an intermediate node. 5: required bool need_finalize 6: optional bool use_streaming_preaggregation 7: optional list agg_sort_infos 8: optional bool is_first_phase 9: optional bool is_colocate 10: optional TSortInfo agg_sort_info_by_group_key } struct TRepeatNode { // Tulple id used for output, it has new slots. 1: required Types.TTupleId output_tuple_id // Slot id set used to indicate those slots need to set to null. 2: required list> slot_id_set_list // An integer bitmap list, it indicates the bit position of the exprs not null. 3: required list repeat_id_list // A list of integer list, it indicates the position of the grouping virtual slot. 4: required list> grouping_list // A list of all slot 5: required set all_slot_ids 6: required list exprs } struct TMaterializationNode { // Materialization node output tuple 1: optional Types.TTupleId tuple_id // Intertemporal materializes tuple 2: optional Types.TTupleId intermediate_tuple_id // Nodes in this cluster, used for second phase fetch 3: optional Descriptors.TPaloNodesInfo nodes_info // Separate list of expr for fetch data 4: optional list fetch_expr_lists // Fetch schema 5: optional list> column_descs_lists; // Add column in tuple offset 6: optional list> slot_locs_lists; // [[1, 2], [4, 5]] // Whether fetch row store 7: optional list fetch_row_stores // Whethe to clear id map 8: optional bool gc_id_map // 与 slot_locs_lists 类型 不过它代表的是 当前slot 在 表中的位置(第几列) 9: optional list> column_idxs_lists; } struct TPreAggregationNode { 1: required list group_exprs 2: required list aggregate_exprs } enum TSortAlgorithm { HEAP_SORT = 0, TOPN_SORT = 1, FULL_SORT = 2 } struct TSortNode { 1: required TSortInfo sort_info // Indicates whether the backend service should use topn vs. sorting 2: required bool use_top_n; // This is the number of rows to skip before returning results 3: optional i64 offset // Indicates whether the imposed limit comes DEFAULT_ORDER_BY_LIMIT. 6: optional bool is_default_limit 7: optional bool use_topn_opt // Deprecated 8: optional bool merge_by_exchange 9: optional bool is_analytic_sort 10: optional bool is_colocate 11: optional TSortAlgorithm algorithm 12: optional bool use_local_merge 13: optional i64 full_sort_max_buffered_bytes } enum TopNAlgorithm { RANK = 0, DENSE_RANK = 1, ROW_NUMBER = 2 } enum TPartTopNPhase { UNKNOWN = 0, ONE_PHASE_GLOBAL = 1, TWO_PHASE_LOCAL = 2, TWO_PHASE_GLOBAL = 3 } struct TPartitionSortNode { 1: optional list partition_exprs 2: optional TSortInfo sort_info 3: optional bool has_global_limit 4: optional TopNAlgorithm top_n_algorithm 5: optional i64 partition_inner_limit 6: optional TPartTopNPhase ptopn_phase } enum TAnalyticWindowType { // Specifies the window as a logical offset RANGE = 0, // Specifies the window in physical units ROWS = 1 } enum TAnalyticWindowBoundaryType { // The window starts/ends at the current row. CURRENT_ROW = 0, // The window starts/ends at an offset preceding current row. PRECEDING = 1, // The window starts/ends at an offset following current row. FOLLOWING = 2 } struct TAnalyticWindowBoundary { 1: required TAnalyticWindowBoundaryType type // Predicate that checks: child tuple '<=' buffered tuple + offset for the orderby expr 2: optional Exprs.TExpr range_offset_predicate // Offset from the current row for ROWS windows. 3: optional i64 rows_offset_value } struct TAnalyticWindow { // Specifies the window type for the start and end bounds. 1: required TAnalyticWindowType type // Absence indicates window start is UNBOUNDED PRECEDING. 2: optional TAnalyticWindowBoundary window_start // Absence indicates window end is UNBOUNDED FOLLOWING. 3: optional TAnalyticWindowBoundary window_end } // Defines a group of one or more analytic functions that share the same window, // partitioning expressions and order-by expressions and are evaluated by a single // ExecNode. struct TAnalyticNode { // Exprs on which the analytic function input is partitioned. Input is already sorted // on partitions and order by clauses, partition_exprs is used to identify partition // boundaries. Empty if no partition clause is specified. 1: required list partition_exprs // Exprs specified by an order-by clause for RANGE windows. Used to evaluate RANGE // window boundaries. Empty if no order-by clause is specified or for windows // specifying ROWS. 2: required list order_by_exprs // Functions evaluated over the window for each input row. The root of each expr is // the aggregate function. Child exprs are the inputs to the function. 3: required list analytic_functions // Window specification 4: optional TAnalyticWindow window // Tuple used for intermediate results of analytic function evaluations // (with slots of analytic intermediate types) 5: required Types.TTupleId intermediate_tuple_id // Tupld used for the analytic function output (with slots of analytic output types) // Equal to intermediate_tuple_id if intermediate type == output type for all // analytic functions. 6: required Types.TTupleId output_tuple_id // id of the buffered tuple (identical to the input tuple, which is assumed // to come from a single SortNode); not set if both partition_exprs and // order_by_exprs are empty 7: optional Types.TTupleId buffered_tuple_id // predicate that checks: child tuple is in the same partition as the buffered tuple, // i.e. each partition expr is equal or both are not null. Only set if // buffered_tuple_id is set; should be evaluated over a row that is composed of the // child tuple and the buffered tuple 8: optional Exprs.TExpr partition_by_eq // predicate that checks: the order_by_exprs are equal or both NULL when evaluated // over the child tuple and the buffered tuple. only set if buffered_tuple_id is set; // should be evaluated over a row that is composed of the child tuple and the buffered // tuple 9: optional Exprs.TExpr order_by_eq 10: optional bool is_colocate 11: optional list range_between_offset_exprs } struct TMergeNode { // A MergeNode could be the left input of a join and needs to know which tuple to write. 1: required Types.TTupleId tuple_id // List or expr lists materialized by this node. // There is one list of exprs per query stmt feeding into this merge node. 2: required list> result_expr_lists // Separate list of expr lists coming from a constant select stmts. 3: required list> const_expr_lists } struct TUnionNode { // A UnionNode materializes all const/result exprs into this tuple. 1: required Types.TTupleId tuple_id // List or expr lists materialized by this node. // There is one list of exprs per query stmt feeding into this union node. 2: required list> result_expr_lists // Separate list of expr lists coming from a constant select stmts. 3: required list> const_expr_lists // Index of the first child that needs to be materialized. 4: required i64 first_materialized_child_idx } struct TIntersectNode { // A IntersectNode materializes all const/result exprs into this tuple. 1: required Types.TTupleId tuple_id // List or expr lists materialized by this node. // There is one list of exprs per query stmt feeding into this union node. 2: required list> result_expr_lists // Separate list of expr lists coming from a constant select stmts. 3: required list> const_expr_lists // Index of the first child that needs to be materialized. 4: required i64 first_materialized_child_idx 5: optional bool is_colocate } struct TExceptNode { // A ExceptNode materializes all const/result exprs into this tuple. 1: required Types.TTupleId tuple_id // List or expr lists materialized by this node. // There is one list of exprs per query stmt feeding into this union node. 2: required list> result_expr_lists // Separate list of expr lists coming from a constant select stmts. 3: required list> const_expr_lists // Index of the first child that needs to be materialized. 4: required i64 first_materialized_child_idx 5: optional bool is_colocate } struct TExchangeNode { // The ExchangeNode's input rows form a prefix of the output rows it produces; // this describes the composition of that prefix 1: required list input_row_tuples // For a merging exchange, the sort information. 2: optional TSortInfo sort_info // This is tHe number of rows to skip before returning results 3: optional i64 offset // Shuffle partition type 4: optional Partitions.TPartitionType partition_type } struct TOlapRewriteNode { 1: required list columns 2: required list column_types 3: required Types.TTupleId output_tuple_id } struct TTableFunctionNode { 1: optional list fnCallExprList 2: optional list outputSlotIds 3: optional list expand_conjuncts } // This contains all of the information computed by the plan as part of the resource // profile that is needed by the backend to execute. struct TBackendResourceProfile { // The minimum reservation for this plan node in bytes. 1: required i64 min_reservation = 0; // no support reservation // The maximum reservation for this plan node in bytes. MAX_INT64 means effectively // unlimited. 2: required i64 max_reservation = 12188490189880; // no max reservation limit // The spillable buffer size in bytes to use for this node, chosen by the planner. // Set iff the node uses spillable buffers. 3: optional i64 spillable_buffer_size = 2097152 // The buffer size in bytes that is large enough to fit the largest row to be processed. // Set if the node allocates buffers for rows from the buffer pool. // Deprecated after support string type 4: optional i64 max_row_buffer_size = 4294967296 // 4G } enum TAssertion { EQ = 0, // val1 == val2 NE = 1, // val1 != val2 LT = 2, // val1 < val2 LE = 3, // val1 <= val2 GT = 4, // val1 > val2 GE = 5 // val1 >= val2 } struct TAssertNumRowsNode { 1: optional i64 desired_num_rows; 2: optional string subquery_string; 3: optional TAssertion assertion; 4: optional bool should_convert_output_to_nullable; } enum TRuntimeFilterType { IN = 1, BLOOM = 2, MIN_MAX = 4, IN_OR_BLOOM = 8, // Deprecated: bitmap runtime filters are no longer planned. BITMAP = 16 } // generate min-max runtime filter for non-equal condition or equal condition. enum TMinMaxRuntimeFilterType { // only min is valid, RF generated according to condition: n < col_A MIN = 1, // only max is valid, RF generated according to condition: m > col_A MAX = 2, // both min/max are valid, // support hash join condition: col_A = col_B // support other join condition: n < col_A and col_A < m MIN_MAX = 4 } struct TTopnFilterDesc { // topn node id 1: required i32 source_node_id 2: required bool is_asc 3: required bool null_first // scan node id -> expr on scan node 4: required map target_node_id_to_target_expr } // Specification of a runtime filter. struct TRuntimeFilterDesc { // Filter unique id (within a query) 1: required i32 filter_id // Expr on which the filter is built on a hash join. 2: required Exprs.TExpr src_expr // The order of Expr in join predicate 3: required i32 expr_order // Map of target node id to the target expr. Used by consumer 4: required map planId_to_target_expr // Indicates if the source join node of this filter is a broadcast or // a partitioned join. 5: required bool is_broadcast_join // Indicates if there is at least one target scan node that is in the // same fragment as the broadcast join that produced the runtime filter // Now only use has_remote_targets to judge how to publish, // the values ​​of has_local_targets and has_remote_targets must be different 6: required bool has_local_targets // Indicates if there is at least one target scan node that is not in the same // fragment as the broadcast join that produced the runtime filter 7: required bool has_remote_targets // The type of runtime filter to build. 8: required TRuntimeFilterType type // The size of the filter based on the ndv estimate and the min/max limit specified in // the query options. Should be greater than zero for bloom filters, zero otherwise. 9: optional i64 bloom_filter_size_bytes // Deprecated: bitmap runtime filters are no longer planned; for bitmap filter target expr 10: optional Exprs.TExpr bitmap_target_expr // Deprecated: bitmap runtime filters are no longer planned; for bitmap filter 11: optional bool bitmap_filter_not_in 12: optional bool opt_remote_rf; // Deprecated // for min/max rf 13: optional TMinMaxRuntimeFilterType min_max_type; // true, if bloom filter size is calculated by ndv // if bloom_filter_size_calculated_by_ndv=false, BE could calculate filter size according to the actural row count, and // ignore bloom_filter_size_bytes 14: optional bool bloom_filter_size_calculated_by_ndv; // true, if join type is null aware like <=>. rf should dispose the case 15: optional bool null_aware; 16: optional bool sync_filter_size; // Deprecated 17: optional bool build_bf_by_runtime_size; } struct TDataGenScanNode { 1: optional Types.TTupleId tuple_id 2: optional TDataGenFunctionName func_name } struct TGroupCommitScanNode { 1: optional i64 table_id; } // This is essentially a union of all messages corresponding to subclasses // of PlanNode. struct TPlanNode { // node id, needed to reassemble tree structure 1: required Types.TPlanNodeId node_id 2: required TPlanNodeType node_type 3: required i32 num_children 4: required i64 limit 5: required list row_tuples // nullable_tuples[i] is true if row_tuples[i] is nullable 6: required list nullable_tuples 7: optional list conjuncts // Produce data in compact format. 8: required bool compact_data // one field per PlanNode subclass 11: optional THashJoinNode hash_join_node 12: optional TAggregationNode agg_node 13: optional TSortNode sort_node 14: optional TMergeNode merge_node 15: optional TExchangeNode exchange_node 17: optional TMySQLScanNode mysql_scan_node 18: optional TOlapScanNode olap_scan_node 19: optional TCsvScanNode csv_scan_node 20: optional TBrokerScanNode broker_scan_node 21: optional TPreAggregationNode pre_agg_node 22: optional TSchemaScanNode schema_scan_node 23: optional TMergeJoinNode merge_join_node 24: optional TMetaScanNode meta_scan_node 25: optional TAnalyticNode analytic_node 26: optional TOlapRewriteNode olap_rewrite_node 28: optional TUnionNode union_node 29: optional TBackendResourceProfile resource_profile 30: optional TEsScanNode es_scan_node 31: optional TRepeatNode repeat_node 32: optional TAssertNumRowsNode assert_num_rows_node 33: optional TIntersectNode intersect_node 34: optional TExceptNode except_node 35: optional TOdbcScanNode odbc_scan_node // Runtime filters assigned to this plan node, exist in HashJoinNode and ScanNode 36: optional list runtime_filters 37: optional TGroupCommitScanNode group_commit_scan_node 38: optional TMaterializationNode materialization_node 39: optional TRecCTENode rec_cte_node // Use in vec exec engine 40: optional Exprs.TExpr vconjunct 41: optional TTableFunctionNode table_function_node // output column 42: optional list output_slot_ids 43: optional TDataGenScanNode data_gen_scan_node // file scan node 44: optional TFileScanNode file_scan_node 45: optional TJdbcScanNode jdbc_scan_node 46: optional TNestedLoopJoinNode nested_loop_join_node 47: optional TTestExternalScanNode test_external_scan_node 48: optional TPushAggOp push_down_agg_type_opt 49: optional i64 push_down_count 50: optional list> distribute_expr_lists 51: optional bool is_serial_operator 52: optional TRecCTEScanNode rec_cte_scan_node // COUNT(*) and COUNT(col) share push_down_agg_type_opt=COUNT, but file readers need to know // whether a projected scan slot is the aggregate argument or merely the placeholder retained by // column pruning. Empty means row-count semantics; non-empty identifies explicit COUNT columns. 55: optional list push_down_count_slot_ids // projections is final projections, which means projecting into results and materializing them into the output block. 101: optional list projections 102: optional Types.TTupleId output_tuple_id 103: optional TPartitionSortNode partition_sort_node // Intermediate projections will not materialize into the output block. 104: optional list> intermediate_projections_list 105: optional list intermediate_output_tuple_id_list 106: optional list topn_filter_source_node_ids 107: optional i32 nereids_id } // A flattened representation of a tree of PlanNodes, obtained by depth-first // traversal. struct TPlan { 1: required list nodes }