Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<!-- test intra-project -->
<dependency>
Expand Down
1 change: 1 addition & 0 deletions beeline/src/main/resources/beeline-log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

name = BeelineLog4j2
monitorInterval = 30

# list of properties
property.hive.log.level = WARN
Expand Down
49 changes: 49 additions & 0 deletions bin/ext/util/execHiveCmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,55 @@ execHiveCmd () {
HIVE_LIB=`cygpath -w "$HIVE_LIB"`
fi

# For services that may encounter SLF4J conflicts (schemaTool, beeline),
# filter out old SLF4J 1.x jars from HADOOP_CLASSPATH to prevent binding conflicts
if [[ "$SERVICE" =~ ^(schemaTool|beeline)$ ]]; then
echo "DEBUG: Starting SLF4J conflict check for SERVICE=$SERVICE"
echo "DEBUG: HIVE_CONF_DIR=$HIVE_CONF_DIR"
echo "DEBUG: HIVE_HOME=$HIVE_HOME"
echo "DEBUG: Initial HADOOP_CLIENT_OPTS=$HADOOP_CLIENT_OPTS"

# Force Log4j2 to use the fresh config from the build, ignoring stale /etc/hive path
# This ensures monitorInterval=30 is actually applied even when /etc/hive exists
if [ -f "${HIVE_CONF_DIR}/hive-log4j2.properties" ]; then
echo "DEBUG: Found config in HIVE_CONF_DIR"
export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j2.configurationFile=file://${HIVE_CONF_DIR}/hive-log4j2.properties"
elif [ -f "${HIVE_HOME}/conf/hive-log4j2.properties" ]; then
echo "DEBUG: Found config in HIVE_HOME/conf"
export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j2.configurationFile=file://${HIVE_HOME}/conf/hive-log4j2.properties"
else
echo "DEBUG: No local hive-log4j2.properties found"
fi

echo "DEBUG: Final HADOOP_CLIENT_OPTS=$HADOOP_CLIENT_OPTS"

# Filter HADOOP_CLASSPATH to remove paths with old SLF4J/log4j bindings
if [ "$HADOOP_CLASSPATH" != "" ]; then
FILTERED_CP=""
IFS=':' read -ra CP_ARRAY <<< "$HADOOP_CLASSPATH"
for cp_entry in "${CP_ARRAY[@]}"; do
# Skip wildcard paths pointing to Tez/Hadoop lib directories that contain old SLF4J
# This prevents slf4j-log4j12-1.7.x from being loaded alongside slf4j-api-2.0.x
if [[ "$cp_entry" == */tez*/lib/* || "$cp_entry" == */tez*/* ]] && [[ "$cp_entry" == *"*"* ]]; then
continue
fi
if [[ "$cp_entry" == */hadoop*/lib/* ]] && [[ "$cp_entry" == *"*"* ]]; then
continue
fi
# Skip explicit SLF4J 1.x jar paths
if [[ "$cp_entry" == *slf4j-log4j12* || "$cp_entry" == *slf4j-reload4j* ]]; then
continue
fi
if [ "$FILTERED_CP" == "" ]; then
FILTERED_CP="$cp_entry"
else
FILTERED_CP="${FILTERED_CP}:${cp_entry}"
fi
done
export HADOOP_CLASSPATH="$FILTERED_CP"
fi
fi

# hadoop 20 or newer - skip the aux_jars option. picked up from hiveconf
exec $HADOOP jar ${HIVE_LIB}/$JAR $CLASS $HIVE_OPTS "$@"
}
Empty file modified bin/schematool
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/hive-log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

name = HiveLog4j2
monitorInterval = 30

# list of properties
property.hive.log.level = INFO
Expand Down
1 change: 1 addition & 0 deletions data/conf/hive-log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

name = HiveLog4j2Test
monitorInterval = 30

# list of properties
property.hive.log.level = DEBUG
Expand Down
4 changes: 4 additions & 0 deletions druid-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.druid</groupId>
<artifactId>druid-aws-common</artifactId>
Expand Down
6 changes: 0 additions & 6 deletions jdbc-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,5 @@
<version>${h2database.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
6 changes: 6 additions & 0 deletions kudu-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
<artifactId>kudu-test-utils</artifactId>
<version>${kudu.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
Expand Down
4 changes: 4 additions & 0 deletions llap-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.hadoop.security.Credentials;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.token.Token;
import org.apache.logging.slf4j.Log4jMarker;
import org.apache.tez.common.CallableWithNdc;

import org.apache.hadoop.service.AbstractService;
Expand All @@ -50,7 +49,7 @@
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.slf4j.Marker;
import org.slf4j.impl.StaticMarkerBinder;
import org.slf4j.MarkerFactory;

import java.io.IOException;
import java.util.Collections;
Expand All @@ -71,7 +70,7 @@ public class QueryTracker extends AbstractService {

private static final Logger LOG = LoggerFactory.getLogger(QueryTracker.class);
private static final Marker QUERY_COMPLETE_MARKER =
new Log4jMarker(StaticMarkerBinder.getSingleton().getMarkerFactory(), new Log4jQueryCompleteMarker());
MarkerFactory.getMarker(Log4jQueryCompleteMarker.EOF_MARKER);

/// Shared singleton MetricsSource instance for all DAG locks
private static final MetricsSource LOCK_METRICS;
Expand Down
20 changes: 20 additions & 0 deletions packaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@
<groupId>org.apache.hive</groupId>
<artifactId>hive-common</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
Expand All @@ -296,6 +306,16 @@
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
Expand Down
1 change: 1 addition & 0 deletions packaging/src/docker/conf/hive-log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

name = HiveLog4j2
monitorInterval = 30

# list of properties
property.hive.log.level = INFO
Expand Down
44 changes: 42 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
<rat.version>0.16.1</rat.version>
<roaringbit.version>1.3.0</roaringbit.version>
<stax.version>1.0.1</stax.version>
<slf4j.version>1.7.30</slf4j.version>
<slf4j.version>2.0.13</slf4j.version>
<ST4.version>4.0.4</ST4.version>
<storage-api.version>4.3.0-SNAPSHOT</storage-api.version>
<tez.version>0.10.5</tez.version>
Expand Down Expand Up @@ -494,7 +494,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -654,6 +654,17 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-storage-api</artifactId>
Expand Down Expand Up @@ -924,6 +935,11 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
Expand Down Expand Up @@ -972,6 +988,14 @@
<artifactId>hadoop-common</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
Expand Down Expand Up @@ -1321,6 +1345,12 @@
<groupId>org.apache.tez</groupId>
<artifactId>tez-runtime-internals</artifactId>
<version>${tez.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tez</groupId>
Expand Down Expand Up @@ -1492,9 +1522,19 @@
<dependencies>
<!-- dependencies are always listed in sorted order by groupId, artifactId -->
<!-- global dependencies -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
Expand Down
2 changes: 1 addition & 1 deletion ql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
Expand Down
1 change: 1 addition & 0 deletions ql/src/main/resources/hive-exec-log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

name = HiveExecLog4j2
monitorInterval = 30

# list of properties
property.hive.log.level = INFO
Expand Down
1 change: 1 addition & 0 deletions ql/src/main/resources/tez-container-log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

name = TezContainerLog4j2
monitorInterval = 30

# list of properties
property.tez.container.log.level = INFO
Expand Down
6 changes: 0 additions & 6 deletions serde/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.esri.geometry</groupId>
<artifactId>esri-geometry-api</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions standalone-metastore/metastore-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,6 @@
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
Expand Down
8 changes: 1 addition & 7 deletions standalone-metastore/metastore-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-hive</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
Expand Down Expand Up @@ -270,7 +264,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

name = MetastoreLog4j2
monitorInterval = 30

# list of properties
property.metastore.log.level = INFO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
<dependency>
Expand Down
Loading