Skip to content

Commit f3c2976

Browse files
committed
HIVE-28059 : major rebase stage 1;
1 parent 3bc9d06 commit f3c2976

File tree

14 files changed

+207
-57
lines changed

14 files changed

+207
-57
lines changed

iceberg/patched-iceberg-api/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
</parent>
2222
<modelVersion>4.0.0</modelVersion>
2323
<artifactId>patched-iceberg-api</artifactId>
24-
<version>${revision}</version>
2524
<name>Patched Iceberg API</name>
2625
<!-- Temporary package until we need unreleased Iceberg changes for development purposes. -->
2726
<!-- We should periodically clean this package during rebasing to newer Iceberg releases. -->

iceberg/patched-iceberg-core/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<modelVersion>4.0.0</modelVersion>
2323
<artifactId>patched-iceberg-core</artifactId>
2424
<name>Patched Iceberg Core</name>
25-
<version>${revision}</version>
2625
<!-- Temporary package until we need unreleased Iceberg changes for development purposes. -->
2726
<!-- We should periodically clean this package during rebasing to newer Iceberg releases. -->
2827
<!-- We should remove the package for good when Iceberg integration has been stabilized. -->

pom.xml

+17-19
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<maven.exec.plugin.version>3.1.0</maven.exec.plugin.version>
100100
<maven.versions.plugin.version>2.16.0</maven.versions.plugin.version>
101101
<maven.shade.plugin.version>3.5.0</maven.shade.plugin.version>
102-
<maven.surefire.plugin.version>3.0.0-M4</maven.surefire.plugin.version>
102+
<maven.surefire.plugin.version>3.5.1</maven.surefire.plugin.version>
103103
<maven.cyclonedx.plugin.version>2.7.10</maven.cyclonedx.plugin.version>
104104
<maven.license.plugin.version>2.3.0</maven.license.plugin.version>
105105
<!-- Library Dependency Versions -->
@@ -110,7 +110,7 @@
110110
<antlr4.version>4.9.3</antlr4.version>
111111
<apache-directory-server.version>1.5.7</apache-directory-server.version>
112112
<!-- Include arrow for LlapOutputFormatService -->
113-
<arrow.version>12.0.0</arrow.version>
113+
<arrow.version>16.0.0</arrow.version>
114114
<avatica.version>1.12.0</avatica.version>
115115
<avro.version>1.11.4</avro.version>
116116
<bcprov-jdk18on.version>1.78</bcprov-jdk18on.version>
@@ -126,7 +126,7 @@
126126
<commons-compress.version>1.26.0</commons-compress.version>
127127
<commons-configuration.version>1.10</commons-configuration.version>
128128
<commons-exec.version>1.1</commons-exec.version>
129-
<commons-io.version>2.12.0</commons-io.version>
129+
<commons-io.version>2.14.0</commons-io.version>
130130
<commons-lang3.version>3.12.0</commons-lang3.version>
131131
<commons-math3.version>3.6.1</commons-math3.version>
132132
<commons-dbcp2.version>2.12.0</commons-dbcp2.version>
@@ -151,7 +151,6 @@
151151
<!-- httpcomponents are not always in version sync -->
152152
<httpcomponents.client.version>4.5.13</httpcomponents.client.version>
153153
<httpcomponents.core.version>4.4.13</httpcomponents.core.version>
154-
<iceberg.version>1.6.1</iceberg.version>
155154
<ivy.version>2.5.2</ivy.version>
156155
<jackson.version>2.16.1</jackson.version>
157156
<jamon.plugin.version>2.3.4</jamon.plugin.version>
@@ -167,19 +166,19 @@
167166
<jodd.version>6.0.0</jodd.version>
168167
<json.version>1.8</json.version>
169168
<junit.version>4.13.2</junit.version>
170-
<junit.jupiter.version>5.10.0</junit.jupiter.version>
171-
<junit.vintage.version>5.6.3</junit.vintage.version>
169+
<junit.jupiter.version>5.11.2</junit.jupiter.version>
170+
<junit.vintage.version>5.11.2</junit.vintage.version>
172171
<kafka.version>2.5.0</kafka.version>
173172
<kryo.version>5.5.0</kryo.version>
174173
<reflectasm.version>1.11.9</reflectasm.version>
175174
<kudu.version>1.12.0</kudu.version>
176175
<!-- Leaving libfb303 at 0.9.3 regardless of libthrift: As per THRIFT-4613 The Apache Thrift project does not publish items related to fb303 at this point -->
177176
<libfb303.version>0.9.3</libfb303.version>
178177
<libthrift.version>0.16.0</libthrift.version>
179-
<log4j2.version>2.24.1</log4j2.version>
178+
<log4j2.version>2.18.0</log4j2.version>
180179
<mariadb.version>2.5.0</mariadb.version>
181180
<mssql.version>6.2.1.jre8</mssql.version>
182-
<mysql.version>8.0.31</mysql.version>
181+
<mysql.version>8.2.0</mysql.version>
183182
<postgres.version>42.7.3</postgres.version>
184183
<oracle.version>21.3.0.0</oracle.version>
185184
<opencsv.version>5.9</opencsv.version>
@@ -188,12 +187,12 @@
188187
<mockito-core.version>3.4.4</mockito-core.version>
189188
<mockito-inline.version>4.11.0</mockito-inline.version>
190189
<mina.version>2.0.0-M5</mina.version>
191-
<netty.version>4.1.77.Final</netty.version>
190+
<netty.version>4.1.116.Final</netty.version>
192191
<netty3.version>3.10.5.Final</netty3.version>
193192
<!-- used by druid storage handler -->
194193
<pac4j-saml.version>4.5.5</pac4j-saml.version>
195194
<paranamer.version>2.8</paranamer.version>
196-
<parquet.version>1.13.1</parquet.version>
195+
<parquet.version>1.14.4</parquet.version>
197196
<pig.version>0.16.0</pig.version>
198197
<plexus.version>1.5.6</plexus.version>
199198
<protobuf.version>3.25.5</protobuf.version>
@@ -1016,7 +1015,7 @@
10161015
<exclusions>
10171016
<exclusion>
10181017
<groupId>io.netty</groupId>
1019-
<artifactId>netty</artifactId>
1018+
<artifactId>netty-all</artifactId>
10201019
</exclusion>
10211020
</exclusions>
10221021
</dependency>
@@ -1754,6 +1753,7 @@
17541753
<groupId>org.apache.maven.plugins</groupId>
17551754
<artifactId>maven-surefire-plugin</artifactId>
17561755
<configuration>
1756+
<enableOutErrElements>false</enableOutErrElements>
17571757
<excludes>
17581758
<exclude>**/TestSerDe.java</exclude>
17591759
<exclude>**/TestHiveMetaStore.java</exclude>
@@ -1765,8 +1765,8 @@
17651765
</excludes>
17661766
<redirectTestOutputToFile>true</redirectTestOutputToFile>
17671767
<reuseForks>false</reuseForks>
1768-
<failIfNoTests>false</failIfNoTests>
1769-
<argLine>${maven.test.jvm.args}</argLine>
1768+
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
1769+
<argLine>${maven.test.jvm.args} -Xshare:off</argLine>
17701770
<trimStackTrace>false</trimStackTrace>
17711771
<additionalClasspathElements>
17721772
<additionalClasspathElement>${test.conf.dir}</additionalClasspathElement>
@@ -1795,10 +1795,10 @@
17951795
<!-- required for hive-exec jar path and tests which reference a jar -->
17961796
<maven.local.repository>${maven.repo.local}</maven.local.repository>
17971797
<mapred.job.tracker>local</mapred.job.tracker>
1798-
<log4j.configurationFile>${test.log4j.scheme}${test.conf.dir}/hive-log4j2.properties
1799-
</log4j.configurationFile>
1798+
<log4j.configurationFile>${test.log4j.scheme}${test.conf.dir}/hive-log4j2.properties</log4j.configurationFile>
18001799
<hive.test.console.log.level>${test.console.log.level}</hive.test.console.log.level>
18011800
<hive.cluster.id>hive-test-cluster-id-cli</hive.cluster.id>
1801+
<log4j.debug>true</log4j.debug>
18021802
<!-- don't dirty up /tmp -->
18031803
<java.io.tmpdir>${test.tmp.dir}</java.io.tmpdir>
18041804
<!-- Hadoop's minidfs class uses this -->
@@ -1916,11 +1916,9 @@
19161916
<workingDirectory>${basedir}</workingDirectory>
19171917
<arguments>
19181918
<argument>-c</argument>
1919-
<argument>${thrift.home}/bin/thrift -version | fgrep 'Thrift version ${libthrift.version}' &amp;&amp;
1920-
exit 0;
1919+
<argument>${thrift.home}/bin/thrift -version | fgrep 'Thrift version ${libthrift.version}' &amp;&amp; exit 0;
19211920
echo "=================================================================================";
1922-
echo "========== [FATAL] Build is configured to require Thrift version ${libthrift.version}
1923-
=========";
1921+
echo "========== [FATAL] Build is configured to require Thrift version ${libthrift.version} =========";
19241922
echo "========== Currently installed: ";
19251923
${thrift.home}/bin/thrift -version;
19261924
echo "=================================================================================";

standalone-metastore/metastore-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogServer.java

+5-9
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,9 @@
5050

5151
public class HMSCatalogServer {
5252
private static final String CACHE_EXPIRY = "hive.metastore.catalog.cache.expiry";
53-
private static final String CACHE_AUTHORIZATION = "hive.metastore.catalog.cache.authorization";
5453
private static final String JETTY_THREADPOOL_MIN = "hive.metastore.catalog.jetty.threadpool.min";
5554
private static final String JETTY_THREADPOOL_MAX = "hive.metastore.catalog.jetty.threadpool.max";
5655
private static final String JETTY_THREADPOOL_IDLE = "hive.metastore.catalog.jetty.threadpool.idle";
57-
/**
58-
* The metric names prefix.
59-
*/
60-
static final String HMS_METRIC_PREFIX = "hmscatalog.";
6156
private static final Logger LOG = LoggerFactory.getLogger(HMSCatalogServer.class);
6257
private static Reference<Catalog> catalogRef;
6358

@@ -92,12 +87,12 @@ public static Catalog createCatalog(Configuration configuration) {
9287
properties.put("external-warehouse", cextwarehouse);
9388
}
9489
catalog.initialize("hive", properties);
95-
long expiry = 0;//configuration.getLong(CACHE_EXPIRY, 60_000L);
90+
long expiry = configuration.getLong(CACHE_EXPIRY, 60_000L);
9691
return expiry > 0? HiveCachingCatalog.wrap(catalog, expiry) : catalog;
9792
}
9893

9994
public static HttpServlet createServlet(Configuration configuration, Catalog catalog) throws IOException {
100-
String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.CATALOG_SERVLET_AUTH);
95+
String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
10196
boolean jwt = "jwt".equalsIgnoreCase(auth);
10297
SecureServletCaller security = new ServletSecurity(configuration, jwt);
10398
Catalog actualCatalog = catalog;
@@ -112,11 +107,12 @@ public static HttpServlet createServlet(Configuration configuration, Catalog cat
112107
/**
113108
* Convenience method to start a http server that only serves this servlet.
114109
* @param conf the configuration
110+
* @param catalog the catalog instance to serve
115111
* @return the server instance
116112
* @throws Exception if servlet initialization fails
117113
*/
118114
public static Server startServer(Configuration conf, HiveCatalog catalog) throws Exception {
119-
int port = MetastoreConf.getIntVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PORT);
115+
int port = MetastoreConf.getIntVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PORT);
120116
if (port < 0) {
121117
return null;
122118
}
@@ -125,7 +121,7 @@ public static Server startServer(Configuration conf, HiveCatalog catalog) throws
125121
context.setContextPath("/");
126122
ServletHolder servletHolder = new ServletHolder(servlet);
127123
servletHolder.setInitParameter("javax.ws.rs.Application", "ServiceListPublic");
128-
final String cli = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PATH);
124+
final String cli = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PATH);
129125
context.addServlet(servletHolder, "/" + cli + "/*");
130126
context.setVirtualHosts(null);
131127
context.setGzipHandler(new GzipHandler());

standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/HMSTestBase.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ public void setUp() throws Exception {
159159
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.SCHEMA_INFO_CLASS, "org.apache.iceberg.rest.HMSTestBase$TestSchemaInfo");
160160
// Events that get cleaned happen in batches of 1 to exercise batching code
161161
MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.EVENT_CLEAN_MAX_EVENTS, 1L);
162-
MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PORT, 0);
163-
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_AUTH, "jwt");
164-
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PATH, catalogPath);
162+
MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PORT, 0);
163+
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_AUTH, "jwt");
164+
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PATH, catalogPath);
165165
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.THRIFT_METASTORE_AUTHENTICATION_JWT_JWKS_URL,
166166
"http://localhost:" + MOCK_JWKS_SERVER_PORT + "/jwks");
167167
MOCK_JWKS_SERVER.stubFor(get("/jwks")

standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/TestHMSCatalog.java

-11
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
import org.apache.iceberg.Transaction;
3232
import org.apache.iceberg.catalog.Namespace;
3333
import org.apache.iceberg.catalog.TableIdentifier;
34-
import static org.apache.iceberg.rest.HMSTestBase.DB_NAME;
35-
import static org.apache.iceberg.rest.HMSTestBase.RND;
36-
import static org.apache.iceberg.rest.HMSTestBase.clientCall;
37-
import static org.apache.iceberg.rest.HMSTestBase.reportMetricCounters;
3834
import org.apache.iceberg.types.Types;
3935
import static org.apache.iceberg.types.Types.NestedField.required;
4036
import org.junit.Assert;
@@ -59,11 +55,6 @@ public void tearDown() throws Exception {
5955
super.tearDown();
6056
}
6157

62-
@Test
63-
public void testC0() throws Exception {
64-
testCreateNamespaceHttp();
65-
}
66-
6758
@Test
6859
public void testCreateNamespaceHttp() throws Exception {
6960
String ns = "nstesthttp";
@@ -138,7 +129,6 @@ public void testCreateTableTxnBuilder() throws Exception {
138129
Object response = clientCall(jwt, url, "GET", null);
139130
Assert.assertNotNull(response);
140131

141-
if (false) {
142132
// list tables in hivedb
143133
url = new URL("http://hive@localhost:" + catalogPort + "/" + catalogPath+"/v1/namespaces/" + DB_NAME + "/tables");
144134
// succeed
@@ -155,7 +145,6 @@ public void testCreateTableTxnBuilder() throws Exception {
155145
// quick check on metrics
156146
Map<String, Long> counters = reportMetricCounters("list_namespaces", "list_tables", "load_table");
157147
counters.forEach((key, value) -> Assert.assertTrue(key, value > 0));
158-
}
159148
table = catalog.loadTable(tableIdent);
160149
Assert.assertNotNull(table);
161150
} catch (Exception xany) {

standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java

+14
Original file line numberDiff line numberDiff line change
@@ -1827,6 +1827,20 @@ public enum ConfVars {
18271827
"hive.metastore.properties.servlet.auth", "jwt",
18281828
"Property-maps servlet authentication method (simple or jwt)."
18291829
),
1830+
ICEBERG_CATALOG_SERVLET_PATH("hive.metastore.catalog.servlet.path",
1831+
"hive.metastore.catalog.servlet.path", "icecli",
1832+
"HMS Iceberg Catalog servlet path component of URL endpoint."
1833+
),
1834+
ICEBERG_CATALOG_SERVLET_PORT("hive.metastore.catalog.servlet.port",
1835+
"hive.metastore.catalog.servlet.port", -1,
1836+
"HMS Iceberg Catalog servlet server port. Negative value disables the servlet," +
1837+
" 0 will let the system determine the catalog server port," +
1838+
" positive value will be used as-is."
1839+
),
1840+
ICEBERG_CATALOG_SERVLET_AUTH("hive.metastore.catalog.servlet.auth",
1841+
"hive.metastore.catalog.servlet.auth", "jwt",
1842+
"HMS Iceberg Catalog servlet authentication method (simple or jwt)."
1843+
),
18301844

18311845
// Deprecated Hive values that we are keeping for backwards compatibility.
18321846
@Deprecated
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.hadoop.hive.metastore.metasummary;
21+
22+
import java.util.HashMap;
23+
import java.util.Map;
24+
25+
public class SummaryMapBuilder {
26+
private final Map<String, Object> container = new HashMap<>();
27+
28+
public SummaryMapBuilder add(String key, Object value) {
29+
container.put(key, value);
30+
return this;
31+
}
32+
33+
public Map<String, Object> build() {
34+
Map<String, Object> result = new HashMap<>(container);
35+
container.clear();
36+
return result;
37+
}
38+
39+
public <T> T get(String key, Class<T> type) {
40+
if (!container.containsKey(key)) {
41+
return null;
42+
}
43+
return type.cast(container.get(key));
44+
}
45+
}

standalone-metastore/metastore-server/pom.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
-->
15-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
16-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
15+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1716
<parent>
1817
<artifactId>hive-standalone-metastore</artifactId>
1918
<groupId>org.apache.hive</groupId>

0 commit comments

Comments
 (0)