Skip to content

Commit

Permalink
Merge branch 'main' into fix-comment-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
LeslieKid authored Jul 19, 2024
2 parents 9a72cb7 + c5825cc commit cfbf6ce
Show file tree
Hide file tree
Showing 11 changed files with 780 additions and 208 deletions.
83 changes: 83 additions & 0 deletions integration_tests/cases/env/local/dml/insert_into_select.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
DROP TABLE IF EXISTS `insert_into_select_table1`;

affected_rows: 0

CREATE TABLE `insert_into_select_table1` (
`timestamp` timestamp NOT NULL,
`value` int,
`name` string,
timestamp KEY (timestamp)) ENGINE=Analytic
WITH(
enable_ttl='false'
);

affected_rows: 0

INSERT INTO `insert_into_select_table1` (`timestamp`, `value`, `name`)
VALUES
(1, 100, "s1"),
(2, 200, "s2"),
(3, 300, "s3"),
(4, 400, "s4"),
(5, 500, "s5");

affected_rows: 5

DROP TABLE IF EXISTS `insert_into_select_table2`;

affected_rows: 0

CREATE TABLE `insert_into_select_table2` (
`timestamp` timestamp NOT NULL,
`value` int,
`name` string NULL,
timestamp KEY (timestamp)) ENGINE=Analytic
WITH(
enable_ttl='false'
);

affected_rows: 0

INSERT INTO `insert_into_select_table2` (`timestamp`, `value`)
SELECT `timestamp`, `value`
FROM `insert_into_select_table1`;

affected_rows: 5

SELECT `timestamp`, `value`, `name`
FROM `insert_into_select_table2`;

timestamp,value,name,
Timestamp(1),Int32(100),String(""),
Timestamp(2),Int32(200),String(""),
Timestamp(3),Int32(300),String(""),
Timestamp(4),Int32(400),String(""),
Timestamp(5),Int32(500),String(""),


DROP TABLE `insert_into_select_table1`;

affected_rows: 0

DROP TABLE `insert_into_select_table2`;

affected_rows: 0

59 changes: 59 additions & 0 deletions integration_tests/cases/env/local/dml/insert_into_select.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--

DROP TABLE IF EXISTS `insert_into_select_table1`;

CREATE TABLE `insert_into_select_table1` (
`timestamp` timestamp NOT NULL,
`value` int,
`name` string,
timestamp KEY (timestamp)) ENGINE=Analytic
WITH(
enable_ttl='false'
);

INSERT INTO `insert_into_select_table1` (`timestamp`, `value`, `name`)
VALUES
(1, 100, "s1"),
(2, 200, "s2"),
(3, 300, "s3"),
(4, 400, "s4"),
(5, 500, "s5");

DROP TABLE IF EXISTS `insert_into_select_table2`;

CREATE TABLE `insert_into_select_table2` (
`timestamp` timestamp NOT NULL,
`value` int,
`name` string NULL,
timestamp KEY (timestamp)) ENGINE=Analytic
WITH(
enable_ttl='false'
);

INSERT INTO `insert_into_select_table2` (`timestamp`, `value`)
SELECT `timestamp`, `value`
FROM `insert_into_select_table1`;

SELECT `timestamp`, `value`, `name`
FROM `insert_into_select_table2`;

DROP TABLE `insert_into_select_table1`;

DROP TABLE `insert_into_select_table2`;
4 changes: 2 additions & 2 deletions src/components/object_store/src/disk_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ impl DiskCache {

Ok(Self {
root_dir,
meta_cache: Arc::new(PartitionedMutex::try_new(
meta_cache: Arc::new(PartitionedMutex::try_new_with_bit_len(
init_lru,
partition_bits,
SeaHasherBuilder {},
Expand Down Expand Up @@ -545,7 +545,7 @@ impl DiskCacheStore {
assert!(cap_per_part > 0);
Ok(LruCache::new(cap_per_part))
};
let meta_cache = PartitionedMutex::try_new(
let meta_cache = PartitionedMutex::try_new_with_bit_len(
init_size_lru,
FILE_SIZE_CACHE_PARTITION_BITS,
SeaHasherBuilder,
Expand Down
2 changes: 1 addition & 1 deletion src/components/object_store/src/mem_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl MemCache {
))
};

let inner = PartitionedMutex::try_new(
let inner = PartitionedMutex::try_new_with_bit_len(
init_lru,
partition_bits,
build_fixed_seed_ahasher_builder(),
Expand Down
Loading

0 comments on commit cfbf6ce

Please sign in to comment.