Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Bump datafusion, prost, hyper, tonic, tower, axum #5417

Open
wants to merge 124 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 121 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
2db8107
change dep
waynexia Dec 6, 2024
db9dfba
feat: adapt to arrow's interval array
evenyag Dec 6, 2024
c757feb
chore: fix compile errors in datatypes crate
evenyag Dec 12, 2024
181f28e
chore: fix api crate compiler errors
evenyag Dec 13, 2024
75f9ea2
chore: fix compiler errors in common-grpc
evenyag Dec 13, 2024
46bc65e
chore: fix common-datasource errors
evenyag Dec 13, 2024
4514db9
chore: fix deprecated code in common-datasource
evenyag Dec 13, 2024
ce73058
fix promql and physical plan related
waynexia Dec 13, 2024
8dad368
wip: upgrading network deps
waynexia Dec 16, 2024
8f1c760
block on updating `sqlparser`
MichaelScofield Dec 16, 2024
3845086
upgrade sqlparser
waynexia Dec 23, 2024
3047af4
adapt new df's trait requirements
waynexia Dec 23, 2024
9caf689
chore: fix compiler errors in mito2
evenyag Dec 24, 2024
5986565
chore: fix common-function crate errors
evenyag Dec 24, 2024
761ff28
chore: fix catalog errors
evenyag Dec 24, 2024
93213dd
change import path
waynexia Dec 25, 2024
55add17
chore: fix some errors in query crate
evenyag Dec 26, 2024
069fff0
chore: fix some errors in query crate
evenyag Dec 27, 2024
176645b
aggr expr and some other tiny fixes
waynexia Jan 6, 2025
885bc52
chore: fix expr related errors in query crate
evenyag Jan 7, 2025
2b1caa6
chore: fix query serializer and admin command
evenyag Jan 7, 2025
0207c37
chore: fix grpc services
evenyag Jan 7, 2025
9c575d8
feat: axum serve
evenyag Jan 7, 2025
b1a3490
chore: fix http server
evenyag Jan 8, 2025
91abacf
chore: fix flow aggr functions
evenyag Jan 8, 2025
ba6442f
chore: fix flow
discord9 Jan 8, 2025
04871e2
feat: fix errors in meta-srv
evenyag Jan 8, 2025
b68f727
feat!: Remove script crate and python feature (#5321)
evenyag Jan 8, 2025
124115e
chore: fix servers tests compiler errors
evenyag Jan 8, 2025
c6e3452
feat: fix tests-integration errors
evenyag Jan 8, 2025
d5c036e
chore: fix unused
evenyag Jan 8, 2025
66a807f
test: fix catalog test
evenyag Jan 8, 2025
fc21dca
chore: fix compiler errors for crates using common-meta
evenyag Jan 8, 2025
b36830c
test: use display for logical plan test
evenyag Jan 8, 2025
9ef86f0
test: implement rewrite for ScanHintRule
evenyag Jan 8, 2025
847979b
fix: http server build panic
evenyag Jan 8, 2025
377e732
test: fix mito test
evenyag Jan 9, 2025
2c06862
fix: sql parser type alias error
evenyag Jan 9, 2025
b954dc7
test: fix TestClient not listen
evenyag Jan 9, 2025
8e10762
test: some flow tests
discord9 Jan 9, 2025
7e34af6
test(flow): more fix
discord9 Jan 9, 2025
d4cc156
fix: test_otlp_logs
shuiyisong Jan 9, 2025
629df0b
test: fix promql test that using deprecated method fun()
evenyag Jan 10, 2025
1286bbc
fix: sql type replace supports Int8 ~ Int64, UInt8 ~ UInt64
evenyag Jan 10, 2025
8e92b7f
test: fix infer schema test case
evenyag Jan 10, 2025
3833f8e
test: fix tests related to plan display
evenyag Jan 10, 2025
9f52ed2
chore: fix last flow test
discord9 Jan 10, 2025
c839a33
test: fix function format related assertion
evenyag Jan 10, 2025
c63b4a7
test: use larger port range for tests
evenyag Jan 10, 2025
d90ad81
fix: test_otlp_traces
shuiyisong Jan 10, 2025
500e9d2
fix: test_otlp_metrics
shuiyisong Jan 10, 2025
e85c2bb
fix range query and dist plan
waynexia Jan 10, 2025
3177e50
fix: flow handle distinct use deprecated field
discord9 Jan 14, 2025
80f8b29
fix: can't pass Join plan expressions to LogicalPlan::with_new_exprs
evenyag Jan 14, 2025
6295752
test: fix deserialize test
evenyag Jan 14, 2025
435177b
test: reduce split key case num
evenyag Jan 14, 2025
e4ef268
tests: lower case aggr func name
discord9 Jan 14, 2025
b1d96ed
test: fix some sqlness tests
evenyag Jan 14, 2025
23a3297
tests: more sqlness fix
discord9 Jan 14, 2025
cfe7489
tests: fixed sqlness test
discord9 Jan 14, 2025
0706c5d
commit non-bug changes
waynexia Jan 14, 2025
9bc7245
fix: make our udf correct
discord9 Jan 14, 2025
5e82f74
fix: implement empty methods of ContextProvider for DfContextProvider…
evenyag Jan 14, 2025
1f717d9
test: update sqlness test result
evenyag Jan 14, 2025
a0b91ea
chore: remove unused
evenyag Jan 15, 2025
0fb8a3d
fix: provide alias name for AggregateExprBuilder in range plan
evenyag Jan 15, 2025
90c0f4a
test: update range query result
evenyag Jan 15, 2025
003b3c9
fix: implement missing ContextProvider methods for DfContextProviderA…
evenyag Jan 15, 2025
d61fe84
test: update timestamps, cte result
evenyag Jan 15, 2025
1707c4c
fix: supports empty projection in mito
evenyag Jan 15, 2025
30f7270
test: update comment for cte test
evenyag Jan 15, 2025
2aff1ef
fix: support projection for numbers
evenyag Jan 15, 2025
9141f18
test: update test cases after projection fix
evenyag Jan 15, 2025
83eb820
fix: fix range select first_value/last_value
evenyag Jan 16, 2025
719add2
fix: handle CAST and time index conflict
evenyag Jan 16, 2025
bebb0e1
fix: handle order by correctly in range first_value/last_value
evenyag Jan 16, 2025
7039650
test: update sqlness result
evenyag Jan 16, 2025
77bb4f1
test: update view test result
evenyag Jan 16, 2025
a53dc00
test: update decimal test
evenyag Jan 16, 2025
1fb87e3
feat: remove redundant physical optimization
evenyag Jan 17, 2025
5da9192
test: update sqlness test result
evenyag Jan 17, 2025
8ff8af2
chore: range select default sort use nulls_first = false
evenyag Jan 17, 2025
92ed750
test: update filter push down test result
evenyag Jan 17, 2025
b408cb3
test: comment deciaml test to avoid different panic message
evenyag Jan 17, 2025
8bae616
test: update some distributed test result
evenyag Jan 17, 2025
1f5f9ca
test: update test for distributed count and filter push down
evenyag Jan 17, 2025
0e002cf
test: update subqueries test
evenyag Jan 17, 2025
5b3f01d
fix: SessionState may overwrite our UDFs
evenyag Jan 17, 2025
af2674d
feat: Merge branch 'main' into bump-df-202412
evenyag Jan 20, 2025
e54ad27
chore: fix compiler errors after merging main
evenyag Jan 20, 2025
ca3fec9
fix: fix elasticsearch and dashboard router panic
evenyag Jan 20, 2025
eec9c4b
chore: fix common-functions tests
evenyag Jan 20, 2025
c4c3f08
chore: update sqlness result
evenyag Jan 20, 2025
ee835b4
test: fix id keyword and update sqlness result
evenyag Jan 20, 2025
f59fdfa
test: fix flow_null test
evenyag Jan 20, 2025
c2030db
fix: enlarge thread size in debug mode to avoid overflow
evenyag Jan 20, 2025
500b735
chore: fix warnings in common-function
evenyag Jan 20, 2025
1e18e54
chore: fix warning in flow
evenyag Jan 20, 2025
33a465f
chore: fix warnings in query crate
evenyag Jan 20, 2025
4540437
chore: remove unused warnings
evenyag Jan 21, 2025
5743c9a
chore: fix deprecated warnings for parquet
evenyag Jan 21, 2025
74f3bcd
chore: fix deprecated warning in servers crate
evenyag Jan 21, 2025
5ec29a4
style: fix clippy
evenyag Jan 21, 2025
ebbf641
chore: Merge branch 'main' into bump-df-202412
evenyag Jan 21, 2025
d90a268
test: enlarge mito cache tttl test ttl time
evenyag Jan 21, 2025
e77880f
chore: fix typo
evenyag Jan 21, 2025
02c20f6
style: fmt toml
evenyag Jan 21, 2025
8924283
refactor: reimplement PartialOrd for RangeSelect
evenyag Jan 21, 2025
5f6875f
chore: remove script crate files introduced by merge
evenyag Jan 21, 2025
68ba6df
fix: return error if sql option is not kv
evenyag Jan 21, 2025
5826579
chore: do not use ..default::default()
evenyag Jan 21, 2025
b58d2f8
chore: per review
discord9 Jan 22, 2025
feeb3a8
chore: update error message in BuildAdminFunctionArgsSnafu
evenyag Jan 22, 2025
3aed891
refactor: typed precision
discord9 Jan 22, 2025
257e8dd
update sqlness view case
waynexia Jan 22, 2025
500a8c7
chore: flow per review
discord9 Jan 22, 2025
bad35dc
chore: add example in comment
evenyag Jan 22, 2025
30a78a9
chore: warn if parquet stats of timestamp is not INT64
evenyag Jan 22, 2025
aaacdbd
style: add a newline before derive to make the comment more clear
evenyag Jan 22, 2025
5b9d412
test: update sqlness result
evenyag Jan 22, 2025
5e6b7e8
chore: Merge branch 'main' into bump-df-202412
evenyag Jan 22, 2025
74b34aa
fix: flow from substrait
discord9 Jan 22, 2025
fbbbfee
chore: change update_range_context log to debug level
evenyag Jan 22, 2025
3a28240
chore: move axum-extra axum-macros to workspace
evenyag Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,518 changes: 819 additions & 699 deletions Cargo.lock

Large diffs are not rendered by default.

56 changes: 30 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ rust.unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
# See for more detaiils: https://github.com/rust-lang/cargo/issues/11329
ahash = { version = "0.8", features = ["compile-time-rng"] }
aquamarine = "0.3"
arrow = { version = "51.0.0", features = ["prettyprint"] }
arrow-array = { version = "51.0.0", default-features = false, features = ["chrono-tz"] }
arrow-flight = "51.0"
arrow-ipc = { version = "51.0.0", default-features = false, features = ["lz4", "zstd"] }
arrow-schema = { version = "51.0", features = ["serde"] }
arrow = { version = "53.0.0", features = ["prettyprint"] }
arrow-array = { version = "53.0.0", default-features = false, features = ["chrono-tz"] }
arrow-flight = "53.0"
arrow-ipc = { version = "53.0.0", default-features = false, features = ["lz4", "zstd"] }
arrow-schema = { version = "53.0", features = ["serde"] }
async-stream = "0.3"
async-trait = "0.1"
axum = { version = "0.6", features = ["headers"] }
# Remember to update axum-extra, axum-macros when updating axum
axum = "0.8"
backon = "1"
base64 = "0.21"
bigdecimal = "0.4.2"
Expand All @@ -107,53 +108,56 @@ clap = { version = "4.4", features = ["derive"] }
config = "0.13.0"
crossbeam-utils = "0.8"
dashmap = "5.4"
datafusion = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-common = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-expr = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-functions = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-optimizer = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-physical-expr = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-physical-plan = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-sql = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-substrait = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-common = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-expr = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-functions = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-optimizer = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-sql = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
datafusion-substrait = { git = "https://github.com/apache/datafusion.git", rev = "2464703c84c400a09cc59277018813f0e797bb4e" }
deadpool = "0.10"
deadpool-postgres = "0.12"
derive_builder = "0.12"
dotenv = "0.15"
etcd-client = "0.13"
etcd-client = "0.14"
fst = "0.4.7"
futures = "0.3"
futures-util = "0.3"
greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "6cee3db98a552f1dd848dec3eefcce8f26343748" }
greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "683e9d10ae7f3dfb8aaabd89082fc600c17e3795" }
hex = "0.4"
http = "0.2"
http = "1"
humantime = "2.1"
humantime-serde = "1.1"
hyper = "1.1"
hyper-util = "0.1"
itertools = "0.10"
jsonb = { git = "https://github.com/databendlabs/jsonb.git", rev = "8c8d2fc294a39f3ff08909d60f718639cfba3875", default-features = false }
lazy_static = "1.4"
local-ip-address = "0.6"
loki-api = { git = "https://github.com/shuiyisong/tracing-loki", branch = "chore/prost_version" }
meter-core = { git = "https://github.com/GreptimeTeam/greptime-meter.git", rev = "a10facb353b41460eeb98578868ebf19c2084fac" }
mockall = "0.11.4"
moka = "0.12"
nalgebra = "0.33"
notify = "6.1"
num_cpus = "1.16"
once_cell = "1.18"
opentelemetry-proto = { version = "0.5", features = [
opentelemetry-proto = { version = "0.27", features = [
"gen-tonic",
"metrics",
"trace",
"with-serde",
"logs",
] }
parking_lot = "0.12"
parquet = { version = "51.0.0", default-features = false, features = ["arrow", "async", "object_store"] }
parquet = { version = "53.0.0", default-features = false, features = ["arrow", "async", "object_store"] }
paste = "1.0"
pin-project = "1.0"
prometheus = { version = "0.13.3", features = ["process"] }
promql-parser = { version = "0.4.3", features = ["ser"] }
prost = "0.12"
prost = "0.13"
raft-engine = { version = "0.4.1", default-features = false }
rand = "0.8"
ratelimit = "0.9"
Expand All @@ -172,6 +176,7 @@ rstest = "0.21"
rstest_reuse = "0.7"
rust_decimal = "1.33"
rustc-hash = "2.0"
rustls = { version = "0.23.20", default-features = false } # override by patch, see [patch.crates-io]
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["float_roundtrip"] }
serde_with = "3"
Expand All @@ -180,9 +185,8 @@ similar-asserts = "1.6.0"
smallvec = { version = "1", features = ["serde"] }
snafu = "0.8"
sysinfo = "0.30"

rustls = { version = "0.23.20", default-features = false } # override by patch, see [patch.crates-io]
sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "54a267ac89c09b11c0c88934690530807185d3e7", features = [
# on branch v0.52.x
sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "71dd86058d2af97b9925093d40c4e03360403170", features = [
"visitor",
"serde",
] } # on branch v0.44.x
Expand All @@ -194,8 +198,8 @@ tokio-rustls = { version = "0.26.0", default-features = false } # override by pa
tokio-stream = "0.1"
tokio-util = { version = "0.7", features = ["io-util", "compat"] }
toml = "0.8.8"
tonic = { version = "0.11", features = ["tls", "gzip", "zstd"] }
tower = "0.4"
tonic = { version = "0.12", features = ["tls", "gzip", "zstd"] }
tower = "0.5"
tracing-appender = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "fmt"] }
typetag = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion src/api/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum Error {
#[snafu(implicit)]
location: Location,
#[snafu(source)]
error: prost::DecodeError,
error: prost::UnknownEnumValue,
},

#[snafu(display("Failed to create column datatype from {:?}", from))]
Expand Down
28 changes: 20 additions & 8 deletions src/api/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl ColumnDataTypeWrapper {

/// Get a tuple of ColumnDataType and ColumnDataTypeExtension.
pub fn to_parts(&self) -> (ColumnDataType, Option<ColumnDataTypeExtension>) {
(self.datatype, self.datatype_ext.clone())
(self.datatype, self.datatype_ext)
}
}

Expand Down Expand Up @@ -685,14 +685,18 @@ pub fn pb_values_to_vector_ref(data_type: &ConcreteDataType, values: Values) ->
IntervalType::YearMonth(_) => Arc::new(IntervalYearMonthVector::from_vec(
values.interval_year_month_values,
)),
IntervalType::DayTime(_) => Arc::new(IntervalDayTimeVector::from_vec(
values.interval_day_time_values,
IntervalType::DayTime(_) => Arc::new(IntervalDayTimeVector::from_iter_values(
values
.interval_day_time_values
.iter()
.map(|x| IntervalDayTime::from_i64(*x).into()),
)),
IntervalType::MonthDayNano(_) => {
Arc::new(IntervalMonthDayNanoVector::from_iter_values(
values.interval_month_day_nano_values.iter().map(|x| {
IntervalMonthDayNano::new(x.months, x.days, x.nanoseconds).to_i128()
}),
values
.interval_month_day_nano_values
.iter()
.map(|x| IntervalMonthDayNano::new(x.months, x.days, x.nanoseconds).into()),
))
}
},
Expand Down Expand Up @@ -1495,14 +1499,22 @@ mod tests {
column.values.as_ref().unwrap().interval_year_month_values
);

let vector = Arc::new(IntervalDayTimeVector::from_vec(vec![4, 5, 6]));
let vector = Arc::new(IntervalDayTimeVector::from_vec(vec![
IntervalDayTime::new(0, 4).into(),
IntervalDayTime::new(0, 5).into(),
IntervalDayTime::new(0, 6).into(),
]));
push_vals(&mut column, 3, vector);
assert_eq!(
vec![4, 5, 6],
column.values.as_ref().unwrap().interval_day_time_values
);

let vector = Arc::new(IntervalMonthDayNanoVector::from_vec(vec![7, 8, 9]));
let vector = Arc::new(IntervalMonthDayNanoVector::from_vec(vec![
IntervalMonthDayNano::new(0, 0, 7).into(),
IntervalMonthDayNano::new(0, 0, 8).into(),
IntervalMonthDayNano::new(0, 0, 9).into(),
]));
let len = vector.len();
push_vals(&mut column, 3, vector);
(0..len).for_each(|i| {
Expand Down
6 changes: 2 additions & 4 deletions src/api/src/v1/column_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ const SKIPPING_INDEX_GRPC_KEY: &str = "skipping_index";

/// Tries to construct a `ColumnSchema` from the given `ColumnDef`.
pub fn try_as_column_schema(column_def: &ColumnDef) -> Result<ColumnSchema> {
let data_type = ColumnDataTypeWrapper::try_new(
column_def.data_type,
column_def.datatype_extension.clone(),
)?;
let data_type =
ColumnDataTypeWrapper::try_new(column_def.data_type, column_def.datatype_extension)?;

let constraint = if column_def.default_constraint.is_empty() {
None
Expand Down
1 change: 1 addition & 0 deletions src/catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub mod information_schema {
}

pub mod table_source;

#[async_trait::async_trait]
pub trait CatalogManager: Send + Sync {
fn as_any(&self) -> &dyn Any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const INIT_CAPACITY: usize = 42;
/// - `uptime`: the uptime of the peer.
/// - `active_time`: the time since the last activity of the peer.
///
#[derive(Debug)]
evenyag marked this conversation as resolved.
Show resolved Hide resolved
pub(super) struct InformationSchemaClusterInfo {
schema: SchemaRef,
catalog_manager: Weak<dyn CatalogManager>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ use crate::error::{
use crate::information_schema::Predicates;
use crate::CatalogManager;

#[derive(Debug)]
pub(super) struct InformationSchemaColumns {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub const FLOWNODE_IDS: &str = "flownode_ids";
pub const OPTIONS: &str = "options";

/// The `information_schema.flows` to provides information about flows in databases.
///
#[derive(Debug)]
pub(super) struct InformationSchemaFlows {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub(crate) const FULLTEXT_INDEX_CONSTRAINT_NAME: &str = "FULLTEXT INDEX";
pub(crate) const SKIPPING_INDEX_CONSTRAINT_NAME: &str = "SKIPPING INDEX";

/// The virtual table implementation for `information_schema.KEY_COLUMN_USAGE`.
#[derive(Debug)]
pub(super) struct InformationSchemaKeyColumnUsage {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const INIT_CAPACITY: usize = 42;
/// The `PARTITIONS` table provides information about partitioned tables.
/// See https://dev.mysql.com/doc/refman/8.0/en/information-schema-partitions-table.html
/// We provide an extral column `greptime_partition_id` for GreptimeDB region id.
#[derive(Debug)]
pub(super) struct InformationSchemaPartitions {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const INIT_CAPACITY: usize = 42;
/// - `end_time`: the ending execution time of the procedure.
/// - `status`: the status of the procedure.
/// - `lock_keys`: the lock keys of the procedure.
///
#[derive(Debug)]
pub(super) struct InformationSchemaProcedureInfo {
schema: SchemaRef,
catalog_manager: Weak<dyn CatalogManager>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const INIT_CAPACITY: usize = 42;
/// - `is_leader`: whether the peer is the leader
/// - `status`: the region status, `ALIVE` or `DOWNGRADED`.
/// - `down_seconds`: the duration of being offline, in seconds.
///
#[derive(Debug)]
pub(super) struct InformationSchemaRegionPeers {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const INIT_CAPACITY: usize = 42;
/// - `index_size`: The sst index files size in bytes.
/// - `engine`: The engine type.
/// - `region_role`: The region role.
///
#[derive(Debug)]
pub(super) struct InformationSchemaRegionStatistics {
schema: SchemaRef,
catalog_manager: Weak<dyn CatalogManager>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use store_api::storage::{ScanRequest, TableId};
use super::{InformationTable, RUNTIME_METRICS};
use crate::error::{CreateRecordBatchSnafu, InternalSnafu, Result};

#[derive(Debug)]
pub(super) struct InformationSchemaMetrics {
schema: SchemaRef,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub const SCHEMA_OPTS: &str = "options";
const INIT_CAPACITY: usize = 42;

/// The `information_schema.schemata` table implementation.
#[derive(Debug)]
pub(super) struct InformationSchemaSchemata {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use crate::information_schema::Predicates;
use crate::CatalogManager;

/// The `TABLE_CONSTRAINTS` table describes which tables have constraints.
#[derive(Debug)]
pub(super) struct InformationSchemaTableConstraints {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const TABLE_ID: &str = "table_id";
pub const ENGINE: &str = "engine";
const INIT_CAPACITY: usize = 42;

#[derive(Debug)]
pub(super) struct InformationSchemaTables {
schema: SchemaRef,
catalog_name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub const CHARACTER_SET_CLIENT: &str = "character_set_client";
pub const COLLATION_CONNECTION: &str = "collation_connection";

/// The `information_schema.views` to provides information about views in databases.
#[derive(Debug)]
pub(super) struct InformationSchemaViews {
schema: SchemaRef,
catalog_name: String,
Expand Down
1 change: 1 addition & 0 deletions src/catalog/src/system_schema/memory_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use super::SystemTable;
use crate::error::{CreateRecordBatchSnafu, InternalSnafu, Result};

/// A memory table with specified schema and columns.
#[derive(Debug)]
pub(crate) struct MemoryTable {
pub(crate) table_id: TableId,
pub(crate) table_name: &'static str,
Expand Down
10 changes: 10 additions & 0 deletions src/catalog/src/system_schema/pg_catalog/pg_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::fmt;
use std::sync::{Arc, Weak};

use arrow_schema::SchemaRef as ArrowSchemaRef;
Expand Down Expand Up @@ -100,6 +101,15 @@ impl PGClass {
}
}

impl fmt::Debug for PGClass {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("PGClass")
.field("schema", &self.schema)
.field("catalog_name", &self.catalog_name)
.finish()
}
}

impl SystemTable for PGClass {
fn table_id(&self) -> table::metadata::TableId {
PG_CATALOG_PG_CLASS_TABLE_ID
Expand Down
9 changes: 9 additions & 0 deletions src/catalog/src/system_schema/pg_catalog/pg_database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ pub(super) struct PGDatabase {
namespace_oid_map: PGNamespaceOidMapRef,
}

impl std::fmt::Debug for PGDatabase {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("PGDatabase")
.field("schema", &self.schema)
.field("catalog_name", &self.catalog_name)
.finish()
}
}

impl PGDatabase {
pub(super) fn new(
catalog_name: String,
Expand Down
10 changes: 10 additions & 0 deletions src/catalog/src/system_schema/pg_catalog/pg_namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
pub(super) mod oid_map;

use std::fmt;
use std::sync::{Arc, Weak};

use arrow_schema::SchemaRef as ArrowSchemaRef;
Expand Down Expand Up @@ -87,6 +88,15 @@ impl PGNamespace {
}
}

impl fmt::Debug for PGNamespace {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("PGNamespace")
.field("schema", &self.schema)
.field("catalog_name", &self.catalog_name)
.finish()
}
}

impl SystemTable for PGNamespace {
fn schema(&self) -> SchemaRef {
self.schema.clone()
Expand Down
Loading
Loading