Skip to content

Commit

Permalink
fix:select system.public.tables will return error (#174)
Browse files Browse the repository at this point in the history
* fix:select system.public.tables will return error

* edit:rename record_schema_key to projected_record_schema
  • Loading branch information
dust1 authored Aug 9, 2022
1 parent 653d279 commit 91553aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions system_catalog/src/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ impl<M: Manager> SystemTable for Tables<M> {
.all_catalogs()
.map_err(|e| Box::new(e) as _)
.context(table_engine::table::Scan { table: self.name() })?;
let mut builder =
RecordBatchWithKeyBuilder::new(self.schema.clone().to_record_schema_with_key());
let projected_record_schema = request.projected_schema.to_record_schema_with_key();
let mut builder = RecordBatchWithKeyBuilder::new(projected_record_schema);

let projector = request
.projected_schema
Expand Down
4 changes: 3 additions & 1 deletion tests/cases/01_system/system_tables.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ affected_rows: 0

SELECT `timestamp`, `catalog`, `schema`, `table_name`, `engine`FROM system.public.tablesWHERE table_name = '01_system_table1';

Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to execute interpreter, query: SELECT `timestamp`, `catalog`, `schema`, `table_name`, `engine` FROM system.public.tables WHERE table_name = '01_system_table1';. Caused by: Failed to execute select, err:Failed to execute logical plan, err:Failed to collect record batch stream, err:Stream error, msg:Convert from arrow record batch, err:External error: Execution error: Failed to read table, partition:3, err:Failed to scan table, table:tables, err:Failed to append datum, err:Data type conflict, expect:UInt64, given:String." })
timestamp,catalog,schema,table_name,engine,
Timestamp(Timestamp(0)),String(StringBytes(b"ceresdb")),String(StringBytes(b"public")),String(StringBytes(b"01_system_table1")),String(StringBytes(b"Analytic")),


SHOW TABLES `name` LIKE '01_system_table1';

Expand Down

0 comments on commit 91553aa

Please sign in to comment.