Skip to content

Commit

Permalink
[FLINK-28150][sql-gateway][hive] Introduce the hiveserver2 endpoint a…
Browse files Browse the repository at this point in the history
…nd factory

This closes apache#20101
  • Loading branch information
fsk119 committed Jul 24, 2022
1 parent 8017a41 commit d067629
Show file tree
Hide file tree
Showing 34 changed files with 1,852 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ public static DescribedPredicate<JavaField> annotatedWith(
return DescribedPredicate.describe(
"annotated with @" + annotationType.getSimpleName(),
field ->
field.getAnnotations().size() == 1
&& field.getAnnotations()
.iterator()
.next()
.getRawType()
.isEquivalentTo(annotationType));
field.getAnnotations().stream()
.map(
annotation ->
annotation
.getRawType()
.isEquivalentTo(annotationType))
.reduce(false, Boolean::logicalOr));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ under the License.
<artifactId>flink-sql-client</artifactId>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway</artifactId>
</dependency>

<!-- Connectors -->

<dependency>
Expand Down
14 changes: 14 additions & 0 deletions flink-architecture-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ under the License.
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<!-- Connectors -->

<dependency>
Expand Down
50 changes: 50 additions & 0 deletions flink-connectors/flink-connector-hive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ under the License.
<scope>provided</scope>
</dependency>

<!-- HiveServer2 Endpoint -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<!-- Connectors -->

<dependency>
Expand Down Expand Up @@ -883,6 +891,48 @@ under the License.
<artifactId>flink-architecture-tests-test</artifactId>
<scope>test</scope>
</dependency>

<!-- HiveServer2 Endpoint -->

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway-api</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-gateway</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>${hive.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,15 @@ public HiveCatalog(
@Nullable String hiveVersion) {
this(
catalogName,
defaultDatabase == null ? DEFAULT_DB : defaultDatabase,
defaultDatabase,
hiveConf,
isNullOrWhitespaceOnly(hiveVersion) ? HiveShimLoader.getHiveVersion() : hiveVersion,
false);
}

@VisibleForTesting
protected HiveCatalog(
public HiveCatalog(
String catalogName,
String defaultDatabase,
@Nullable String defaultDatabase,
@Nullable HiveConf hiveConf,
String hiveVersion,
boolean allowEmbedded) {
Expand All @@ -221,8 +220,8 @@ protected HiveCatalog(
LOG.info("Created HiveCatalog '{}'", catalogName);
}

@VisibleForTesting
static HiveConf createHiveConf(@Nullable String hiveConfDir, @Nullable String hadoopConfDir) {
public static HiveConf createHiveConf(
@Nullable String hiveConfDir, @Nullable String hadoopConfDir) {
// create HiveConf from hadoop configuration with hadoop conf directory configured.
Configuration hadoopConf = null;
if (isNullOrWhitespaceOnly(hadoopConfDir)) {
Expand Down
Loading

0 comments on commit d067629

Please sign in to comment.