Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
timeout-minutes: 150
strategy:
matrix:
# Java versions to run unit tests
java: [ '11', '17', '21' ]
# Java versions to run unit tests (Jetty 12 requires Java 17+)
java: [ '17', '21' ]
profile: ['default-hadoop']
fail-fast: false
steps:
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
cache: 'maven'
# Caches built protobuf library
- name: Cache protobufs
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Cache Maven Repository
uses: actions/cache@v4
with:
Expand Down
14 changes: 14 additions & 0 deletions contrib/storage-hbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
<includes>
<!-- Needed by HBase test cluster -->
<include>commons-logging:commons-logging:*:jar:provided</include>
<!-- Needed by HBase mini cluster (test scope) for embedded Jetty/web server -->
<include>javax.servlet:*</include>
<include>javax.servlet.jsp:*</include>
<include>javax.websocket:*</include>
<include>org.eclipse.jetty:*</include>
<include>org.eclipse.jetty.websocket:*</include>
</includes>
</bannedDependencies>
</rules>
Expand Down Expand Up @@ -254,6 +260,14 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Expand Down
40 changes: 40 additions & 0 deletions contrib/storage-hive/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -184,6 +196,14 @@
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -200,6 +220,14 @@
<artifactId>reload4j</artifactId>
<groupId>ch.qos.reload4j</groupId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Used by complex types tests for loading nested data -->
Expand Down Expand Up @@ -293,6 +321,18 @@
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java7</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
8 changes: 8 additions & 0 deletions contrib/storage-hive/hive-exec-shade/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -62,16 +61,21 @@ public class TestHttpUDFWithAliases extends ClusterTest {

private static AliasRegistry storageAliasesRegistry;
private static AliasRegistry tableAliasesRegistry;
private static final int MOCK_SERVER_PORT = 47778;
private static String TEST_JSON_PAGE1;
private static final String DUMMY_URL = "http://localhost:" + MOCK_SERVER_PORT;
private static MockWebServer server;
private static String mockServerUrl;

@BeforeClass
public static void setUpBeforeClass() throws Exception {

TEST_JSON_PAGE1 = Files.asCharSource(DrillFileUtils.getResourceAsFile("/data/p1.json"),
StandardCharsets.UTF_8).read();

// Start MockWebServer with dynamic port allocation
server = new MockWebServer();
server.start(0); // Use port 0 for dynamic allocation
mockServerUrl = server.url("/").toString().replaceAll("/$", "");

cluster = ClusterFixture.bareBuilder(dirTestWatcher)
.configProperty(ExecConstants.USER_AUTHENTICATION_ENABLED, true)
.configProperty(ExecConstants.IMPERSONATION_ENABLED, true)
Expand Down Expand Up @@ -106,7 +110,7 @@ public static void setUpBeforeClass() throws Exception {
.build();

HttpApiConfig basicJson = HttpApiConfig.builder()
.url(String.format("%s/json", DUMMY_URL))
.url(String.format("%s/json", mockServerUrl))
.method("get")
.jsonOptions(jsonOptions)
.requireTail(false)
Expand All @@ -131,7 +135,7 @@ public void testSeveralRowsAndRequestsAndPublicStorageAlias() throws Exception {
storageAliasesRegistry.getPublicAliases().put("`foobar`", "`local`", false);

String sql = "SELECT http_request('foobar.basicJson', `col1`) as data FROM cp.`/data/p4.json`";
try (MockWebServer server = startServer()) {
try {
server.enqueue(new MockResponse().setResponseCode(200).setBody(TEST_JSON_PAGE1));
server.enqueue(new MockResponse().setResponseCode(200).setBody(TEST_JSON_PAGE1));

Expand Down Expand Up @@ -161,8 +165,7 @@ public void testSeveralRowsAndRequestsAndPublicStorageAlias() throws Exception {
@Test
public void testSeveralRowsAndRequestsAndUserStorageAlias() throws Exception {
String sql = "SELECT http_request('foobar.basicJson', `col1`) as data FROM cp.`/data/p4.json`";
try (MockWebServer server = startServer()) {

try {
ClientFixture client = cluster.clientBuilder()
.property(DrillProperties.USER, TEST_USER_2)
.property(DrillProperties.PASSWORD, TEST_USER_2_PASSWORD)
Expand Down Expand Up @@ -203,7 +206,7 @@ public void testSeveralRowsAndRequestsAndPublicTableAlias() throws Exception {
tableAliasesRegistry.getPublicAliases().put("`foobar`", "`basicJson`", false);

String sql = "SELECT http_request('local.foobar', `col1`) as data FROM cp.`/data/p4.json`";
try (MockWebServer server = startServer()) {
try {
server.enqueue(new MockResponse().setResponseCode(200).setBody(TEST_JSON_PAGE1));
server.enqueue(new MockResponse().setResponseCode(200).setBody(TEST_JSON_PAGE1));

Expand Down Expand Up @@ -233,8 +236,7 @@ public void testSeveralRowsAndRequestsAndPublicTableAlias() throws Exception {
@Test
public void testSeveralRowsAndRequestsAndUserTableAlias() throws Exception {
String sql = "SELECT http_request('local.foobar', `col1`) as data FROM cp.`/data/p4.json`";
try (MockWebServer server = startServer()) {

try {
ClientFixture client = cluster.clientBuilder()
.property(DrillProperties.USER, TEST_USER_2)
.property(DrillProperties.PASSWORD, TEST_USER_2_PASSWORD)
Expand Down Expand Up @@ -268,10 +270,4 @@ public void testSeveralRowsAndRequestsAndUserTableAlias() throws Exception {
tableAliasesRegistry.deleteUserAliases(TEST_USER_2);
}
}

public static MockWebServer startServer() throws IOException {
MockWebServer server = new MockWebServer();
server.start(MOCK_SERVER_PORT);
return server;
}
}
Loading
Loading