mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-13 08:43:00 +00:00
* wip Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor/expose-bulk-symbols: ### Commit Message Enhance DDL Module Accessibility and Refactor `verify_alter` Function - **`statement.rs`**: Made the `ddl` module public to enhance accessibility. - **`ddl.rs`**: - Made `NAME_PATTERN_REG` public for broader usage. - Refactored `verify_alter` function to be a standalone public function, improving modularity and reusability. - Made `parse_partitions` function public to allow external access. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor/expose-bulk-symbols: ### Add Parquet Writer and Enhance Row Modifier - **Add Parquet Writer Module**: Introduced a new module `parquet_writer.rs` to bridge `opendal` `Writer` with `parquet` `AsyncFileWriter`. - **Enhance Row Modifier**: Updated `RowModifier` to use `Default` trait and made `fill_internal_columns` a public static method in `row_modifier.rs`. - **Expose Internal Structures**: Made `RowsIter`, `RowIter`, `TablesBuilder`, and `TableBuilder` structs public in `row_modifier.rs` and `prom_row_builder.rs`. - **Update Metric Engine**: Changed `RowModifier` instantiation to use `default()` in `engine.rs`. - **Modify Table Options Handling**: Added `fill_table_options_for_create` function in `insert.rs` to handle table options based on `AutoCreateTableType`. - **Make Constants Public**: Changed `DEFAULT_ROW_GROUP_SIZE` to public in `parquet.rs`. - **Expose Functions**: Made `extract_add_columns_expr` public in `expr_helper.rs` and `AutoCreateTableType` public in `insert.rs`. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor/expose-bulk-symbols: ### Commit Message Enhance HTTP Server and Prometheus Integration - **`http.rs`**: Made `extractor` module public to allow external access. - **`prom_store.rs`**: Refactored `decode_remote_write_request` to return `TablesBuilder` and adjusted logic for processing requests based on pipeline usage. - **`lib.rs`**: Made `metrics` module public for broader accessibility. - **`prom_row_builder.rs`**: Exposed `tables` field in `TablesBuilder` for external manipulation. - **`proto.rs`**: Changed visibility of `table_data` in `PromWriteRequest` to `pub(crate)` for internal module access. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor/expose-bulk-symbols: ### Add Accessor Methods for Managers and Executors - **`src/frontend/src/instance.rs`**: Added accessor methods for `NodeManagerRef`, `PartitionRuleManagerRef`, `CacheInvalidatorRef`, and `ProcedureExecutorRef` to the `Instance` struct. - **`src/operator/src/insert.rs`**: Introduced methods to access `NodeManagerRef` and `PartitionRuleManagerRef` in the `Inserter` struct. - **`src/operator/src/statement.rs`**: Added methods to retrieve `ProcedureExecutorRef` and `CacheInvalidatorRef` in the `StatementExecutor` struct. ### Change HashMap Implementation - **`src/servers/src/prom_row_builder.rs`**: Replaced `ahash::HashMap` with `std::collections::HashMap`. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor/expose-bulk-symbols: Refactor table option handling in `insert.rs` - Replaced `Vec` with `HashMap` for `table_options` to improve efficiency. - Extracted logic for filling table options into a new function `fill_table_options_for_create`. - Modified `fill_table_options_for_create` to return the engine name based on `create_type`. - Simplified the insertion of table options into `create_table_expr` by using `extend` method. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor/expose-bulk-symbols: Refactor `insert.rs` to separate engine name logic from table options - Updated `Inserter` implementation to determine `engine_name` separately from `fill_table_options_for_create`. - Modified `fill_table_options_for_create` to no longer return an engine name, focusing solely on populating table options. - Adjusted logic to set `engine_name` based on `AutoCreateTableType`, using `METRIC_ENGINE_NAME` for logical tables and `default_engine()` otherwise. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> --------- Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>