mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
test: run sqlness for flat format (#7178)
* test: support flat format in sqlness Signed-off-by: evenyag <realevenyag@gmail.com> * test: replace region stats test result with NUM Signed-off-by: evenyag <realevenyag@gmail.com> * ci: add flat format to sqlness ci Signed-off-by: evenyag <realevenyag@gmail.com> --------- Signed-off-by: evenyag <realevenyag@gmail.com>
This commit is contained in:
3
.github/workflows/develop.yml
vendored
3
.github/workflows/develop.yml
vendored
@@ -613,6 +613,9 @@ jobs:
|
||||
- name: "MySQL Kvbackend"
|
||||
opts: "--setup-mysql"
|
||||
kafka: false
|
||||
- name: "Flat format"
|
||||
opts: "--enable-flat-format"
|
||||
kafka: false
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -22,6 +22,7 @@ INSERT INTO test VALUES
|
||||
Affected Rows: 3
|
||||
|
||||
-- SQLNESS SLEEP 3s
|
||||
-- SQLNESS REPLACE (\s+\d+\s+) <NUM>
|
||||
-- For regions using different WAL implementations, the manifest size may vary.
|
||||
-- The remote WAL implementation additionally stores a flushed entry ID when creating the manifest.
|
||||
SELECT SUM(region_rows),SUM(written_bytes_since_open), SUM(memtable_size), SUM(sst_size), SUM(index_size)
|
||||
@@ -31,15 +32,16 @@ SELECT SUM(region_rows),SUM(written_bytes_since_open), SUM(memtable_size), SUM(s
|
||||
+-------------------------------------------------------+--------------------------------------------------------------------+---------------------------------------------------------+----------------------------------------------------+------------------------------------------------------+
|
||||
| sum(information_schema.region_statistics.region_rows) | sum(information_schema.region_statistics.written_bytes_since_open) | sum(information_schema.region_statistics.memtable_size) | sum(information_schema.region_statistics.sst_size) | sum(information_schema.region_statistics.index_size) |
|
||||
+-------------------------------------------------------+--------------------------------------------------------------------+---------------------------------------------------------+----------------------------------------------------+------------------------------------------------------+
|
||||
| 3 | 78 | 78 | 0 | 0 |
|
||||
|<NUM>|<NUM>|<NUM>|<NUM>|<NUM>|
|
||||
+-------------------------------------------------------+--------------------------------------------------------------------+---------------------------------------------------------+----------------------------------------------------+------------------------------------------------------+
|
||||
|
||||
-- SQLNESS REPLACE (\s+\d+\s+) <NUM>
|
||||
SELECT data_length, index_length, avg_row_length, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'test';
|
||||
|
||||
+-------------+--------------+----------------+------------+
|
||||
| data_length | index_length | avg_row_length | table_rows |
|
||||
+-------------+--------------+----------------+------------+
|
||||
| 0 | 0 | 26 | 3 |
|
||||
|<NUM>|<NUM>|<NUM>|<NUM>|
|
||||
+-------------+--------------+----------------+------------+
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
@@ -17,12 +17,14 @@ INSERT INTO test VALUES
|
||||
(21, 'c', 21);
|
||||
|
||||
-- SQLNESS SLEEP 3s
|
||||
-- SQLNESS REPLACE (\s+\d+\s+) <NUM>
|
||||
-- For regions using different WAL implementations, the manifest size may vary.
|
||||
-- The remote WAL implementation additionally stores a flushed entry ID when creating the manifest.
|
||||
SELECT SUM(region_rows),SUM(written_bytes_since_open), SUM(memtable_size), SUM(sst_size), SUM(index_size)
|
||||
FROM INFORMATION_SCHEMA.REGION_STATISTICS WHERE table_id
|
||||
IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'test' and table_schema = 'public');
|
||||
|
||||
-- SQLNESS REPLACE (\s+\d+\s+) <NUM>
|
||||
SELECT data_length, index_length, avg_row_length, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'test';
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
@@ -3,6 +3,12 @@ mode = 'distributed'
|
||||
require_lease_before_startup = true
|
||||
rpc_runtime_size = 8
|
||||
|
||||
[[region_engine]]
|
||||
[region_engine.mito]
|
||||
{{ if enable_flat_format }}
|
||||
default_experimental_flat_format = true
|
||||
{{ endif }}
|
||||
|
||||
[wal]
|
||||
{{ if is_raft_engine }}
|
||||
provider = "raft_engine"
|
||||
|
||||
@@ -2,6 +2,12 @@ mode = 'standalone'
|
||||
enable_memory_catalog = false
|
||||
require_lease_before_startup = true
|
||||
|
||||
[[region_engine]]
|
||||
[region_engine.mito]
|
||||
{{ if enable_flat_format }}
|
||||
default_experimental_flat_format = true
|
||||
{{ endif }}
|
||||
|
||||
[wal]
|
||||
{{ if is_raft_engine }}
|
||||
provider = "raft_engine"
|
||||
|
||||
@@ -102,6 +102,10 @@ pub struct BareCommand {
|
||||
/// Extra command line arguments when starting GreptimeDB binaries.
|
||||
#[clap(long)]
|
||||
extra_args: Vec<String>,
|
||||
|
||||
/// Enable flat format for storage engine (sets default_experimental_flat_format = true).
|
||||
#[clap(long, default_value = "false")]
|
||||
enable_flat_format: bool,
|
||||
}
|
||||
|
||||
impl BareCommand {
|
||||
@@ -170,6 +174,7 @@ impl BareCommand {
|
||||
setup_etcd: self.setup_etcd,
|
||||
setup_pg: self.setup_pg,
|
||||
setup_mysql: self.setup_mysql,
|
||||
enable_flat_format: self.enable_flat_format,
|
||||
};
|
||||
|
||||
let runner = Runner::new(
|
||||
|
||||
1
tests/runner/src/env/bare.rs
vendored
1
tests/runner/src/env/bare.rs
vendored
@@ -76,6 +76,7 @@ pub struct StoreConfig {
|
||||
pub setup_etcd: bool,
|
||||
pub(crate) setup_pg: Option<ServiceProvider>,
|
||||
pub(crate) setup_mysql: Option<ServiceProvider>,
|
||||
pub enable_flat_format: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
@@ -105,6 +105,8 @@ struct ConfigContext {
|
||||
mysql_addr: String,
|
||||
// for standalone
|
||||
postgres_addr: String,
|
||||
// enable flat format for storage engine
|
||||
enable_flat_format: bool,
|
||||
}
|
||||
|
||||
impl ServerMode {
|
||||
@@ -328,6 +330,7 @@ impl ServerMode {
|
||||
grpc_addr,
|
||||
mysql_addr,
|
||||
postgres_addr,
|
||||
enable_flat_format: db_ctx.store_config().enable_flat_format,
|
||||
};
|
||||
|
||||
let rendered = tt.render(self.name(), &ctx).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user