@@ -34,65 +34,7 @@ The latest version is at https://central.sonatype.com/artifact/io.github.linghen
34
34
35
35
## Quick Start
36
36
37
- Start a HiveServer2 instance through Docker Engine.
38
-
39
- ``` bash
40
- docker run -d -p 10000:10000 -p 10002:10002 --env SERVICE_NAME=hiveserver2 apache/hive:4.0.1
41
- ```
42
-
43
- Use third-party builds of this project in any Maven project.
44
-
45
- ``` xml
46
- <dependencies >
47
- <dependency >
48
- <groupId >io.github.linghengqian</groupId >
49
- <artifactId >hive-server2-jdbc-driver-thin</artifactId >
50
- <version >1.6.0</version >
51
- </dependency >
52
- <dependency >
53
- <groupId >com.zaxxer</groupId >
54
- <artifactId >HikariCP</artifactId >
55
- <version >4.0.3</version >
56
- </dependency >
57
- <dependency >
58
- <groupId >org.junit.jupiter</groupId >
59
- <artifactId >junit-jupiter</artifactId >
60
- <version >5.11.2</version >
61
- <scope >test</scope >
62
- </dependency >
63
- </dependencies >
64
- ```
65
-
66
- Simply enjoy the happiness that comes without dependency conflicts.
67
-
68
- ``` java
69
- import com.zaxxer.hikari.HikariConfig ;
70
- import com.zaxxer.hikari.HikariDataSource ;
71
- import org.junit.jupiter.api.Test ;
72
- import java.sql.Connection ;
73
- import java.sql.SQLException ;
74
- import java.sql.Statement ;
75
- @SuppressWarnings (" SqlNoDataSourceInspection" )
76
- public class ExampleTest {
77
- @Test
78
- void test () throws SQLException {
79
- HikariConfig config = new HikariConfig ();
80
- config. setJdbcUrl(" jdbc:hive2://127.0.0.1:10000/" );
81
- config. setDriverClassName(" org.apache.hive.jdbc.HiveDriver" );
82
- try (HikariDataSource dataSource = new HikariDataSource (config);
83
- Connection connection = dataSource. getConnection();
84
- Statement statement = connection. createStatement()) {
85
- statement. execute(" CREATE DATABASE demo_ds_0" );
86
- statement. executeQuery(" show tables" );
87
- statement. execute(" create table hive_example(a string, b int) partitioned by(c int)" );
88
- statement. execute(" alter table hive_example add partition(c=1)" );
89
- statement. execute(" insert into hive_example partition(c=1) values('a', 1), ('a', 2),('b',3)" );
90
- statement. executeQuery(" select count(distinct a) from hive_example" );
91
- statement. executeQuery(" select sum(b) from hive_example" );
92
- }
93
- }
94
- }
95
- ```
37
+ Refer to [ QuickStart] ( ./doc/QuickStart.md ) .
96
38
97
39
## Compatibility
98
40
0 commit comments