Skip to content

Commit d87b65c

Browse files
authored
chore(query): system.tables add table_option, is_external and storage_param filed (#18016)
* chore(query): system.tables add table_option, is_external, storage_param filed * modify field order * Pluralize some variables
1 parent 388ffd3 commit d87b65c

File tree

10 files changed

+131
-61
lines changed

10 files changed

+131
-61
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/meta/app/src/storage/storage_params.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,12 @@ impl Display for StorageParams {
206206
StorageParams::S3(v) => {
207207
write!(
208208
f,
209-
"s3 | bucket={},root={},endpoint={}",
210-
v.bucket, v.root, v.endpoint_url
209+
"s3 | bucket={},root={},endpoint={},ak={},iam_role={}",
210+
v.bucket,
211+
v.root,
212+
v.endpoint_url,
213+
&mask_string(&v.access_key_id, 3),
214+
v.role_arn,
211215
)
212216
}
213217
StorageParams::Webhdfs(v) => {

src/query/service/tests/it/servers/http/http_query_handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ async fn test_simple_sql() -> Result<()> {
327327
assert_eq!(result.state, ExecuteStateKind::Succeeded, "{:?}", result);
328328
assert_eq!(result.next_uri, Some(final_uri.clone()), "{:?}", result);
329329
assert_eq!(result.data.len(), 10, "{:?}", result);
330-
assert_eq!(result.schema.len(), 23, "{:?}", result);
330+
assert_eq!(result.schema.len(), 26, "{:?}", result);
331331

332332
// get state
333333
let uri = result.stats_uri.unwrap();

src/query/service/tests/it/storages/testdata/columns_table.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ DB.Table: 'system'.'columns', Table: columns-table_id:1, ver:0, Engine: SystemCo
223223
| 'is_attach' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
224224
| 'is_attach' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
225225
| 'is_configured' | 'system' | 'users' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
226+
| 'is_external' | 'system' | 'tables' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' |
227+
| 'is_external' | 'system' | 'tables_with_history' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' |
226228
| 'is_insertable_into' | 'information_schema' | 'views' | 'Boolean' | 'BOOLEAN' | '' | '' | 'NO' | '' |
227229
| 'is_nullable' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
228230
| 'is_nullable' | 'system' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
@@ -406,6 +408,8 @@ DB.Table: 'system'.'columns', Table: columns-table_id:1, ver:0, Engine: SystemCo
406408
| 'status' | 'system' | 'locks' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
407409
| 'status' | 'system' | 'notification_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
408410
| 'status' | 'system' | 'processes' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
411+
| 'storage_param' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
412+
| 'storage_param' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
409413
| 'stream_id' | 'system' | 'streams' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
410414
| 'sub_part' | 'information_schema' | 'statistics' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' |
411415
| 'suspend_task_after_num_failures' | 'system' | 'tasks' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' |
@@ -434,6 +438,8 @@ DB.Table: 'system'.'columns', Table: columns-table_id:1, ver:0, Engine: SystemCo
434438
| 'table_name' | 'information_schema' | 'views' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
435439
| 'table_name' | 'system' | 'streams' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' |
436440
| 'table_name' | 'system' | 'streams_terse' | 'Nullable(String)' | 'VARCHAR' | '' | '' | 'YES' | '' |
441+
| 'table_option' | 'system' | 'tables' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
442+
| 'table_option' | 'system' | 'tables_with_history' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
437443
| 'table_rows' | 'information_schema' | 'tables' | 'Nullable(UInt64)' | 'BIGINT UNSIGNED' | '' | '' | 'YES' | '' |
438444
| 'table_schema' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
439445
| 'table_schema' | 'information_schema' | 'key_column_usage' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' |

src/query/storages/system/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ databend-common-storages-stream = { workspace = true }
3535
databend-common-storages-view = { workspace = true }
3636
databend-common-users = { workspace = true }
3737
databend-storages-common-cache = { workspace = true }
38+
databend-storages-common-table-meta = { workspace = true }
3839
futures = { workspace = true }
3940
itertools = { workspace = true }
4041
jiff = { workspace = true }

0 commit comments

Comments
 (0)