Skip to content

Commit f3b5afa

Browse files
committed
Merge branch 'main' of https://github.com/datafuselabs/databend into desc
2 parents feecf9b + 9449729 commit f3b5afa

File tree

59 files changed

+1143
-566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1143
-566
lines changed

Cargo.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/doc/14-sql-commands/10-dml/dml-copy-into-location.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ externalStage ::= @<external_stage_name>[/<path>]
4141

4242
### externalLocation (for Amazon S3)
4343

44-
```
44+
```sql
4545
externalLocation (for Amazon S3) ::=
4646
's3://<bucket>[/<path>]'
4747
[ { CONNECTION = ( { { AWS_KEY_ID = '<string>' AWS_SECRET_KEY = '<string>' } } ) } ]
@@ -59,7 +59,7 @@ externalLocation (for Amazon S3) ::=
5959
See [Input & Output File Formats](../../13-sql-reference/50-file-format-options.md).
6060

6161
### copyOptions
62-
```
62+
```sql
6363
copyOptions ::=
6464
[ SINGLE = TRUE | FALSE ]
6565
[ MAX_FILE_SIZE = <num> ]
@@ -93,4 +93,4 @@ COPY INTO @s2 FROM test_table FILE_FORMAT = (TYPE = CSV);
9393

9494
-- Unload the data from a query into a parquet file on the stage
9595
COPY INTO @s2 FROM (SELECT name, age, id FROM test_table LIMIT 100) FILE_FORMAT = (TYPE = PARQUET);
96-
```
96+
```

src/common/storage/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ async-trait = "0.1"
2222
bytes = "1"
2323
futures = "0.3"
2424
opendal = { workspace = true }
25-
parking_lot = "0.12.1"
2625
regex = "1.6.0"
2726
serde = { workspace = true }
2827

src/common/storage/src/metrics.rs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use opendal::raw::RpRead;
3333
use opendal::raw::RpScan;
3434
use opendal::raw::RpWrite;
3535
use opendal::Result;
36-
use parking_lot::RwLock;
3736

3837
/// StorageMetrics represents the metrics of storage (all bytes metrics are compressed size).
3938
#[derive(Debug, Default)]
@@ -50,8 +49,6 @@ pub struct StorageMetrics {
5049
partitions_scanned: AtomicU64,
5150
/// Number of partitions, before pruning
5251
partitions_total: AtomicU64,
53-
/// Status of the operation.
54-
status: Arc<RwLock<String>>,
5552
}
5653

5754
impl StorageMetrics {
@@ -72,13 +69,6 @@ impl StorageMetrics {
7269
partitions_total: AtomicU64::new(
7370
vs.iter().map(|v| v.as_ref().get_partitions_total()).sum(),
7471
),
75-
// Get the last one status, mainly used for the single table operation.
76-
status: Arc::new(RwLock::new(
77-
vs.iter()
78-
.map(|v| v.as_ref().get_status())
79-
.collect::<Vec<String>>()
80-
.join("|"),
81-
)),
8272
}
8373
}
8474

@@ -141,16 +131,6 @@ impl StorageMetrics {
141131
pub fn get_partitions_total(&self) -> u64 {
142132
self.partitions_total.load(Ordering::Relaxed)
143133
}
144-
145-
pub fn set_status(&self, new: &str) {
146-
let mut status = self.status.write();
147-
*status = new.to_string();
148-
}
149-
150-
pub fn get_status(&self) -> String {
151-
let status = self.status.read();
152-
status.clone()
153-
}
154134
}
155135

156136
#[derive(Clone, Debug)]
@@ -210,6 +190,14 @@ impl<A: Accessor> LayeredAccessor for StorageMetricsAccessor<A> {
210190
.map(|(rp, r)| (rp, StorageMetricsWrapper::new(r, self.metrics.clone())))
211191
}
212192

193+
async fn list(&self, path: &str, args: OpList) -> Result<(RpList, Self::Pager)> {
194+
self.inner.list(path, args).await
195+
}
196+
197+
async fn scan(&self, path: &str, args: OpScan) -> Result<(RpScan, Self::Pager)> {
198+
self.inner.scan(path, args).await
199+
}
200+
213201
fn blocking_read(&self, path: &str, args: OpRead) -> Result<(RpRead, Self::BlockingReader)> {
214202
self.inner
215203
.blocking_read(path, args)
@@ -222,14 +210,6 @@ impl<A: Accessor> LayeredAccessor for StorageMetricsAccessor<A> {
222210
.map(|(rp, r)| (rp, StorageMetricsWrapper::new(r, self.metrics.clone())))
223211
}
224212

225-
async fn list(&self, path: &str, args: OpList) -> Result<(RpList, Self::Pager)> {
226-
self.inner.list(path, args).await
227-
}
228-
229-
async fn scan(&self, path: &str, args: OpScan) -> Result<(RpScan, Self::Pager)> {
230-
self.inner.scan(path, args).await
231-
}
232-
233213
fn blocking_list(&self, path: &str, args: OpList) -> Result<(RpList, Self::BlockingPager)> {
234214
self.inner.blocking_list(path, args)
235215
}

src/meta/api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ pub use util::db_has_to_exist;
4343
pub use util::deserialize_struct;
4444
pub use util::fetch_id;
4545
pub use util::get_object_shared_by_share_ids;
46+
pub use util::get_pb_value;
4647
pub use util::get_share_account_meta_or_err;
4748
pub use util::get_share_database_id_and_privilege;
4849
pub use util::get_share_id_to_name_or_err;
4950
pub use util::get_share_meta_by_id_or_err;
5051
pub use util::get_share_or_err;
51-
pub use util::get_struct_value;
5252
pub use util::get_u64_value;
5353
pub use util::is_all_db_data_removed;
5454
pub use util::is_db_need_to_be_remove;

0 commit comments

Comments
 (0)