Skip to content

Commit 4f9faca

Browse files
committed
Refactor HiveServer2's nativeTest
1 parent 8b9a1ab commit 4f9faca

24 files changed

Lines changed: 121 additions & 124 deletions

File tree

docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh
5252
<plugin>
5353
<groupId>org.graalvm.buildtools</groupId>
5454
<artifactId>native-maven-plugin</artifactId>
55-
<version>0.11.0</version>
55+
<version>0.11.3</version>
5656
<extensions>true</extensions>
5757
<configuration>
5858
<buildArgs>
@@ -92,12 +92,12 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh
9292

9393
```groovy
9494
plugins {
95-
id 'org.graalvm.buildtools.native' version '0.11.0'
95+
id 'org.graalvm.buildtools.native' version '0.11.3'
9696
}
9797
9898
dependencies {
9999
implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}'
100-
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.0', classifier: 'repository', ext: 'zip')
100+
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.3', classifier: 'repository', ext: 'zip')
101101
}
102102
103103
graalvmNative {

docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ and the documentation of GraalVM Native Build Tools shall prevail.
5353
<plugin>
5454
<groupId>org.graalvm.buildtools</groupId>
5555
<artifactId>native-maven-plugin</artifactId>
56-
<version>0.11.0</version>
56+
<version>0.11.3</version>
5757
<extensions>true</extensions>
5858
<configuration>
5959
<buildArgs>
@@ -95,12 +95,12 @@ Reference https://github.com/graalvm/native-build-tools/issues/572 .
9595

9696
```groovy
9797
plugins {
98-
id 'org.graalvm.buildtools.native' version '0.11.0'
98+
id 'org.graalvm.buildtools.native' version '0.11.3'
9999
}
100100
101101
dependencies {
102102
implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}'
103-
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.0', classifier: 'repository', ext: 'zip')
103+
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.3', classifier: 'repository', ext: 'zip')
104104
}
105105
106106
graalvmNative {

docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/presto/_index.cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ShardingSphere 对 Presto JDBC Driver 的支持位于可选模块中。
2828
<dependency>
2929
<groupId>com.facebook.presto</groupId>
3030
<artifactId>presto-jdbc</artifactId>
31-
<version>0.292</version>
31+
<version>0.296</version>
3232
</dependency>
3333
</dependencies>
3434
```
@@ -43,7 +43,7 @@ ShardingSphere 对 Presto JDBC Driver 的支持位于可选模块中。
4343
```yaml
4444
services:
4545
presto:
46-
image: prestodb/presto:0.292
46+
image: prestodb/presto:0.296
4747
ports:
4848
- "8080:8080"
4949
volumes:

docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/presto/_index.en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Possible Maven dependencies are as follows,
2828
<dependency>
2929
<groupId>com.facebook.presto</groupId>
3030
<artifactId>presto-jdbc</artifactId>
31-
<version>0.292</version>
31+
<version>0.296</version>
3232
</dependency>
3333
</dependencies>
3434
```
@@ -44,7 +44,7 @@ In addition, this Iceberg Connector will start a Hive Metastore Server using a l
4444
```yaml
4545
services:
4646
presto:
47-
image: prestodb/presto:0.292
47+
image: prestodb/presto:0.296
4848
ports:
4949
- "8080:8080"
5050
volumes:

docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ services:
118118
environment:
119119
MYSQL_ROOT_PASSWORD: example
120120
volumes:
121-
- ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
121+
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
122122
ports:
123123
- "3306:3306"
124124
```

docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ services:
129129
environment:
130130
MYSQL_ROOT_PASSWORD: example
131131
volumes:
132-
- ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
132+
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
133133
ports:
134134
- "3306:3306"
135135
```

infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reachability-metadata.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,18 @@
261261
"type": "org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex",
262262
"allPublicMethods": true
263263
},
264+
{
265+
"condition": {
266+
"typeReached": "org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex"
267+
},
268+
"type": "org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndexBeanInfo"
269+
},
270+
{
271+
"condition": {
272+
"typeReached": "org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex"
273+
},
274+
"type": "org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndexCustomizer"
275+
},
264276
{
265277
"condition": {
266278
"typeReached": "org.apache.shardingsphere.infra.metadata.database.schema.builder.SystemSchemaBuilder"

pom.xml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@
127127
<clickhouse-jdbc.version>0.6.3</clickhouse-jdbc.version>
128128
<hive-jdbc.version>4.0.1</hive-jdbc.version>
129129
<hive-server2-jdbc-driver-thin.version>1.8.2</hive-server2-jdbc-driver-thin.version>
130-
<presto.version>0.292</presto.version>
130+
<presto.version>0.296</presto.version>
131131
<jaybird.version>5.0.6.java8</jaybird.version>
132132

133133
<hikari-cp.version>4.0.3</hikari-cp.version>
134134

135-
<junit.version>5.13.4</junit.version>
135+
<junit.version>5.14.1</junit.version>
136136
<hamcrest.version>3.0</hamcrest.version>
137137
<mockito.version>4.11.0</mockito.version>
138138
<awaitility.version>4.3.0</awaitility.version>
@@ -145,7 +145,7 @@
145145
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
146146
<dockerfile-maven.version>1.4.13</dockerfile-maven.version>
147147
<os-detector-maven-plugin.version>0.3.1</os-detector-maven-plugin.version>
148-
<native-maven-plugin.version>0.11.0</native-maven-plugin.version>
148+
<native-maven-plugin.version>0.11.3</native-maven-plugin.version>
149149

150150
<!-- Compile plugin versions -->
151151
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
@@ -1177,14 +1177,6 @@
11771177
</goals>
11781178
<phase>integration-test</phase>
11791179
</execution>
1180-
<!--TODO See https://github.com/graalvm/native-build-tools/pull/748 -->
1181-
<execution>
1182-
<id>metadata-copy-manually</id>
1183-
<goals>
1184-
<goal>metadata-copy</goal>
1185-
</goals>
1186-
<phase>deploy</phase>
1187-
</execution>
11881180
</executions>
11891181
</plugin>
11901182
</plugins>

test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/AddressRepository.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ public void createAcidTableInHiveServer2() throws SQLException {
9797
}
9898
}
9999

100+
/**
101+
* Create Iceberg table in HiveServer2.
102+
*
103+
* @throws SQLException SQL exception
104+
*/
105+
public void createIcebergTableInHiveServer2() throws SQLException {
106+
String sql = "CREATE TABLE IF NOT EXISTS t_address (address_id BIGINT NOT NULL,address_name string NOT NULL,"
107+
+ "PRIMARY KEY (address_id) disable novalidate) STORED BY ICEBERG STORED AS ORC TBLPROPERTIES ('format-version' = '2')";
108+
try (
109+
Connection connection = dataSource.getConnection();
110+
Statement statement = connection.createStatement()) {
111+
statement.executeUpdate(sql);
112+
}
113+
}
114+
100115
/**
101116
* Drop table t_address in MySQL.
102117
*

test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderItemRepository.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,23 @@ public void createAcidTableInHiveServer2() throws SQLException {
118118
}
119119
}
120120

121+
/**
122+
* create Iceberg table in HiveServer2.
123+
* Hive does not support `AUTO_INCREMENT`,
124+
* refer to <a href="https://issues.apache.org/jira/browse/HIVE-6905">HIVE-6905</a>.
125+
*
126+
* @throws SQLException SQL exception
127+
*/
128+
public void createIcebergTableInHiveServer2() throws SQLException {
129+
String sql = "CREATE TABLE IF NOT EXISTS t_order_item (order_item_id BIGINT NOT NULL,order_id BIGINT NOT NULL,user_id INT NOT NULL,phone string,status string,"
130+
+ "PRIMARY KEY (order_item_id) disable novalidate) STORED BY ICEBERG STORED AS ORC TBLPROPERTIES ('format-version' = '2')";
131+
try (
132+
Connection connection = dataSource.getConnection();
133+
Statement statement = connection.createStatement()) {
134+
statement.executeUpdate(sql);
135+
}
136+
}
137+
121138
/**
122139
* drop table in MySQL.
123140
*

0 commit comments

Comments
 (0)