Skip to content

Commit 24e634c

Browse files
committed
feat(query): add get_lineage table function
1 parent bfa3e68 commit 24e634c

7 files changed

Lines changed: 1819 additions & 35 deletions

File tree

src/common/license/src/license.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ pub enum Feature {
3737
StorageEncryption,
3838
#[serde(alias = "stream", alias = "STREAM")]
3939
Stream,
40+
#[serde(alias = "lineage", alias = "LINEAGE")]
41+
Lineage,
4042
#[serde(alias = "table_ref", alias = "TABLE_REF")]
4143
TableRef,
4244
#[serde(alias = "attach_table", alias = "ATTACH_TABLE")]
@@ -77,6 +79,7 @@ impl fmt::Display for Feature {
7779
Feature::ComputedColumn => write!(f, "computed_column"),
7880
Feature::StorageEncryption => write!(f, "storage_encryption"),
7981
Feature::Stream => write!(f, "stream"),
82+
Feature::Lineage => write!(f, "lineage"),
8083
Feature::TableRef => write!(f, "table_ref"),
8184
Feature::AttacheTable => write!(f, "attach_table"),
8285
Feature::AmendTable => write!(f, "amend_table"),
@@ -211,6 +214,10 @@ mod tests {
211214
Feature::Stream,
212215
serde_json::from_str::<Feature>("\"Stream\"").unwrap()
213216
);
217+
assert_eq!(
218+
Feature::Lineage,
219+
serde_json::from_str::<Feature>("\"LINEAGE\"").unwrap()
220+
);
214221
assert_eq!(
215222
Feature::TableRef,
216223
serde_json::from_str::<Feature>("\"TableRef\"").unwrap()
@@ -270,6 +277,7 @@ mod tests {
270277
Feature::ComputedColumn,
271278
Feature::StorageEncryption,
272279
Feature::Stream,
280+
Feature::Lineage,
273281
Feature::TableRef,
274282
Feature::AttacheTable,
275283
Feature::AmendTable,
@@ -281,7 +289,7 @@ mod tests {
281289
};
282290

283291
assert_eq!(
284-
"LicenseInfo{ type: enterprise, org: databend, tenants: [databend_tenant,foo], features: [amend_table,attach_table,computed_column,data_mask,license_info,private_task,row_access_policy,storage_encryption,stream,system_history,table_ref,vacuum,workload_group] }",
292+
"LicenseInfo{ type: enterprise, org: databend, tenants: [databend_tenant,foo], features: [amend_table,attach_table,computed_column,data_mask,license_info,lineage,private_task,row_access_policy,storage_encryption,stream,system_history,table_ref,vacuum,workload_group] }",
285293
license_info.to_string()
286294
);
287295
}
@@ -297,6 +305,7 @@ mod tests {
297305
Feature::ComputedColumn,
298306
Feature::StorageEncryption,
299307
Feature::Stream,
308+
Feature::Lineage,
300309
Feature::TableRef,
301310
Feature::AttacheTable,
302311
Feature::AmendTable,

src/query/ee/tests/it/license/license_mgr.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ async fn test_license_features() -> databend_common_exception::Result<()> {
102102
Feature::LicenseInfo,
103103
Feature::Vacuum,
104104
Feature::Stream,
105+
Feature::Lineage,
105106
]),
106107
),
107108
Duration::from_hours(2),
@@ -137,7 +138,13 @@ async fn test_license_features() -> databend_common_exception::Result<()> {
137138

138139
assert!(
139140
license_mgr
140-
.check_enterprise_enabled(token, Feature::Stream)
141+
.check_enterprise_enabled(token.clone(), Feature::Stream)
142+
.is_ok()
143+
);
144+
145+
assert!(
146+
license_mgr
147+
.check_enterprise_enabled(token, Feature::Lineage)
141148
.is_ok()
142149
);
143150

0 commit comments

Comments
 (0)