You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ay...@apache.org on 2022/09/14 19:41:31 UTC
[hive] branch master updated: HIVE-26488: Fix NPE in DDLSemanticAnalyzerFactory during compilation. (#3538). (Ayush Saxena, reviewed by Stamatis Zampetakis)
This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new 67533069d8 HIVE-26488: Fix NPE in DDLSemanticAnalyzerFactory during compilation. (#3538). (Ayush Saxena, reviewed by Stamatis Zampetakis)
67533069d8 is described below
commit 67533069d84baabfe8ee8c1ab42a7450cff42356
Author: Ayush Saxena <ay...@apache.org>
AuthorDate: Thu Sep 15 01:11:15 2022 +0530
HIVE-26488: Fix NPE in DDLSemanticAnalyzerFactory during compilation. (#3538). (Ayush Saxena, reviewed by Stamatis Zampetakis)
---
ql/pom.xml | 2 +-
.../apache/hadoop/hive/ql/ddl/DDLSemanticAnalyzerFactory.java | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/ql/pom.xml b/ql/pom.xml
index 463e8e02f9..1b0cb5125f 100644
--- a/ql/pom.xml
+++ b/ql/pom.xml
@@ -26,7 +26,7 @@
<properties>
<hive.path.to.root>..</hive.path.to.root>
<powermock.version>2.0.2</powermock.version>
- <reflections.version>0.9.10</reflections.version>
+ <reflections.version>0.10.2</reflections.version>
<atlas.version>2.1.0</atlas.version>
</properties>
<dependencies>
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLSemanticAnalyzerFactory.java b/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLSemanticAnalyzerFactory.java
index 9d4bf79af9..3750bb7fc3 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLSemanticAnalyzerFactory.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLSemanticAnalyzerFactory.java
@@ -65,17 +65,17 @@ public final class DDLSemanticAnalyzerFactory {
new HashMap<>();
static {
- Set<Class<? extends BaseSemanticAnalyzer>> analyzerClasses1 =
+ Set<Class<? extends BaseSemanticAnalyzer>> analyzerClasses =
new Reflections(DDL_ROOT).getSubTypesOf(BaseSemanticAnalyzer.class);
- Set<Class<? extends CalcitePlanner>> analyzerClasses2 =
- new Reflections(DDL_ROOT).getSubTypesOf(CalcitePlanner.class);
- Set<Class<? extends BaseSemanticAnalyzer>> analyzerClasses = Sets.union(analyzerClasses1, analyzerClasses2);
for (Class<? extends BaseSemanticAnalyzer> analyzerClass : analyzerClasses) {
if (Modifier.isAbstract(analyzerClass.getModifiers())) {
continue;
}
DDLType ddlType = analyzerClass.getAnnotation(DDLType.class);
+ if (ddlType == null) {
+ continue;
+ }
for (int type : ddlType.types()) {
if (TYPE_TO_ANALYZER.containsKey(type)) {
throw new IllegalStateException(
@@ -93,6 +93,9 @@ public final class DDLSemanticAnalyzerFactory {
}
DDLType ddlType = analyzerCategoryClass.getAnnotation(DDLType.class);
+ if (ddlType == null) {
+ continue;
+ }
for (int type : ddlType.types()) {
if (TYPE_TO_ANALYZERCATEGORY.containsKey(type)) {
throw new IllegalStateException(