# springboot-clickhouse-test **Repository Path**: 12581/springboot-clickhouse-test ## Basic Information - **Project Name**: springboot-clickhouse-test - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-02 - **Last Updated**: 2024-03-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 1. install clickhouse ```shell docker run -d -p 8123:8123 -p9000:9000 --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server ``` > clickhouse-server docker IMAGE: https://hub.docker.com/r/clickhouse/clickhouse-server/ > install DOCKER: https://docs.docker.com/desktop/install/archlinux/ `other way TO INSTALL CLICKHOUSE` [https://clickhouse.com/docs/zh/development/build](https://clickhouse.com/docs/zh/development/build) # 1.1 create table and install data ```shell create table t_order01( id UInt32, sku_id String, total_amount Decimal(16,2), create_time Datetime ) engine =MergeTree partition by toYYYYMMDD(create_time) primary key (id) order by (id,sku_id); insert into t_order01 values (101,'sku_001',1000.00,'2021-12-01 12:00:00'), (102,'sku_002',2000.00,'2021-12-01 11:00:00'), (102,'sku_004',2500.00,'2021-12-01 12:00:00'), (102,'sku_002',2000.00,'2021-12-01 13:00:00'), (102,'sku_002',12000.00,'2021-12-01 13:00:00'), (102,'sku_002',600.00,'2020-06-12 12:00:00'); ``` ```shell CREATE TABLE user_info ( `id` UInt64, `user_name` String, `pass_word` String, `phone` String, `create_day` Date DEFAULT CAST(now(),'Date') )ENGINE = MergeTree primary key (id) order by (id); INSERT INTO user_info (id,user_name,pass_word,phone) VALUES (1,'xiaowang','123456','13325511231'), (2,'xiaoma','123456','13825511231'), (3,'xiaozhao','123456','18925511231'); ``` # 2. git clone this repository # 3. run it on IDEA # 4. test ```shell curl --request GET -sL \ --url 'http://localhost:8080/getById?id=1' ``` ```shell curl --request GET -sL \ --url 'http://localhost:8080/saveData' ```