Skip to content
Merged
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
21 changes: 21 additions & 0 deletions .github/bin/retry
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euo pipefail

x() {
echo "+ $*" >&2
"$@"
}

max_retry_time_seconds=$(( 30 * 60 ))
retry_delay_seconds=10

END=$(( $(date +%s) + ${max_retry_time_seconds} ))

while (( $(date +%s) < $END )); do
x "$@" && exit 0
sleep "${retry_delay_seconds}"
done

echo "$0: retrying [$*] timed out" >&2
exit 1
201 changes: 201 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: ci

on:
pull_request:

env:
# An envar that signals to tests we are executing in the CI environment
CONTINUOUS_INTEGRATION: true
MAVEN_OPTS: "-Xmx1024M -XX:+ExitOnOutOfMemoryError"
MAVEN_INSTALL_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError"
MAVEN_FAST_INSTALL: "-B -V --quiet -T C1 -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true"
MAVEN_TEST: "-B -Dair.check.skip-all -Dmaven.javadoc.skip=true -DLogTestDurationListener.enabled=true --fail-at-end"
RETRY: .github/bin/retry

jobs:
maven-checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
timeout-minutes: 45
steps:
- name: Free Disk Space
run: |
df -h
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Maven Checks
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install -B -V -T C1 -DskipTests -P ci -pl '!:presto-server-rpm'
- name: Test Server RPM
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw verify -B -P ci -pl :presto-server-rpm
- name: Clean Maven Output
run: ./mvnw clean -pl '!:presto-server,!:presto-cli'

web-ui-checks:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Web UI Checks
run: presto-main/bin/check_webui.sh

hive-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Install Hive Module
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl :presto-hive-hadoop2
- name: Run Hive Tests
run: presto-hive-hadoop2/bin/run_hive_tests.sh
- name: Run Hive S3 Tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.HIVE_AWS_ACCESSKEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.HIVE_AWS_SECRETKEY }}
S3_BUCKET: "presto-ci-test"
S3_BUCKET_ENDPOINT: "s3.us-east-2.amazonaws.com"
run: |
if [ "${AWS_ACCESS_KEY_ID}" != "" ]; then
presto-hive-hadoop2/bin/run_hive_s3_tests.sh
fi
- name: Run Hive Glue Tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.HIVE_AWS_ACCESSKEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.HIVE_AWS_SECRETKEY }}
run: |
if [ "${HIVE_AWS_ACCESS_KEY_ID}" != "" ]; then
./mvnw test ${MAVEN_TEST} -pl :presto-hive -P test-hive-glue
fi

test-other-modules:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -pl '!:presto-docs,!:presto-server,!:presto-server-rpm'
- name: Maven Tests
run: |
./mvnw test ${MAVEN_TEST} -pl '
!presto-tests,
!presto-raptor,
!presto-accumulo,
!presto-cassandra,
!presto-hive,
!presto-kudu,
!presto-docs,
!presto-server,
!presto-server-rpm,
!presto-main,
!presto-mongodb,
!presto-spark-package,
!presto-spark-launcher,
!presto-spark-testing,
!presto-spark-base,
!presto-redis,
!presto-elasticsearch,
!presto-orc,
!presto-thrift-connector'

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
modules:
- ":presto-docs"
- ":presto-tests -P presto-tests-execution-memory"
- ":presto-tests -P presto-tests-general"
- ":presto-tests -P ci-only-distributed-non-hash-gen"
- ":presto-tests -P ci-only-tpch-distributed-queries"
- ":presto-tests -P ci-only-local-queries"
- ":presto-tests -P ci-only-distributed-queries"
- ":presto-tests -P ci-only-aggregation-queries"
- ":presto-tests -P ci-only-plan-determinism"
- ":presto-raptor"
- ":presto-accumulo"
- ":presto-cassandra -P test-cassandra-integration-smoke-test"
- ":presto-hive"
- ":presto-hive -P test-hive-materialized-queries"
- ":presto-hive -P test-hive-materialized-aggregations"
- ":presto-hive -P test-hive-recoverable-execution"
- ":presto-hive -P test-hive-pushdown-filter-queries-basic"
- ":presto-hive -P test-hive-pushdown-filter-queries-advanced"
- ":presto-hive -P test-hive-repartitioning"
- ":presto-hive -P test-hive-parquet"
- ":presto-main"
- ":presto-mongodb -P test-mongo-distributed-queries"
- ":presto-redis -P test-redis-integration-smoke-test"
- ":presto-elasticsearch"
- ":presto-orc"
- ":presto-thrift-connector"
- ":presto-spark-base"
timeout-minutes: 80
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl $(echo '${{ matrix.modules }}' | cut -d' ' -f1)
- name: Maven Tests
run: ./mvnw test ${MAVEN_TEST} -pl ${{ matrix.modules }}

kudu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl presto-kudu
- name: Kudu Tests
run: |
presto-kudu/bin/run_kudu_tests.sh 3 null
presto-kudu/bin/run_kudu_tests.sh 1 ""
presto-kudu/bin/run_kudu_tests.sh 1 presto::

spark-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl presto-kudu
- name: Maven Tests
run: $RETRY ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl presto-spark-launcher,presto-spark-package,presto-spark-testing -P test-presto-spark-integration-smoke-test
14 changes: 14 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: cleanup

on:
schedule:
- cron: '*/5 * * * *'

jobs:
cancel:
runs-on: ubuntu-latest
steps:
- uses: n1hility/cancel-previous-runs@2e3c1893986568a2197c41957b9c809cbcf1a61e
with:
token: ${{ github.token }}
workflow: ci.yml
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.facebook.airlift</groupId>
<artifactId>airbase</artifactId>
<version>100</version>
<version>101</version>
Comment thread
aweisberg marked this conversation as resolved.
Outdated
</parent>

<groupId>com.facebook.presto</groupId>
Expand Down Expand Up @@ -54,7 +54,7 @@
<dep.jdbi3.version>3.4.0</dep.jdbi3.version>
<dep.oracle.version>19.3.0.0</dep.oracle.version>
<dep.drift.version>1.32</dep.drift.version>
<dep.joda.version>2.10.5</dep.joda.version>
<dep.joda.version>2.10.6</dep.joda.version>
<dep.tempto.version>1.50</dep.tempto.version>
<dep.testng.version>6.10</dep.testng.version>
<dep.assertj-core.version>3.8.0</dep.assertj-core.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2236,3 +2236,4 @@
2227 Asia/Famagusta
2228 Europe/Saratov
2229 Asia/Qostanay
2230 America/Nuuk
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public int compare(TimeZoneKey left, TimeZoneKey right)
hasher.putString(timeZoneKey.getId(), StandardCharsets.UTF_8);
}
// Zone file should not (normally) be changed, so let's make this more difficult
assertEquals(hasher.hash().asLong(), -972834036790299986L, "zone-index.properties file contents changed!");
assertEquals(hasher.hash().asLong(), -3809591333307967388L, "zone-index.properties file contents changed!");
}

public void assertTimeZoneNotSupported(String zoneId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public HiveClientConfig setRecursiveDirWalkerEnabled(boolean recursiveDirWalkerE

public DateTimeZone getDateTimeZone()
{
return DateTimeZone.forTimeZone(TimeZone.getTimeZone(timeZone));
return DateTimeZone.forID(timeZone);
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@

import java.io.IOException;
import java.math.BigDecimal;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -902,7 +903,7 @@ protected void setupHive(String connectorId, String databaseName, String timeZon
"layout",
Optional.empty(),
false));
timeZone = DateTimeZone.forTimeZone(TimeZone.getTimeZone(timeZoneId));
timeZone = DateTimeZone.forTimeZone(TimeZone.getTimeZone(ZoneId.of(timeZoneId)));
}

protected final void setup(String host, int port, String databaseName, String timeZone)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.airlift.units.Duration;
import org.testng.annotations.Test;

import java.time.ZoneId;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -262,7 +263,7 @@ public void testExplicitPropertyMappings()
.build();

HiveClientConfig expected = new HiveClientConfig()
.setTimeZone(nonDefaultTimeZone().toTimeZone().getID())
.setTimeZone(TimeZone.getTimeZone(ZoneId.of(nonDefaultTimeZone().getID())).getID())
.setMaxSplitSize(new DataSize(256, Unit.MEGABYTE))
.setMaxPartitionsPerScan(123)
.setMaxOutstandingSplits(10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.testng.annotations.Test;

import java.io.File;
import java.time.ZoneId;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -105,7 +106,7 @@ public void setup()
metastore,
HDFS_ENVIRONMENT,
new HivePartitionManager(FUNCTION_AND_TYPE_MANAGER, HIVE_CLIENT_CONFIG),
DateTimeZone.forTimeZone(TimeZone.getTimeZone(HIVE_CLIENT_CONFIG.getTimeZone())),
DateTimeZone.forTimeZone(TimeZone.getTimeZone(ZoneId.of(HIVE_CLIENT_CONFIG.getTimeZone()))),
true,
false,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
Expand Down Expand Up @@ -110,7 +111,7 @@
public class TestPrestoDriver
{
private static final DateTimeZone ASIA_ORAL_ZONE = DateTimeZone.forID("Asia/Oral");
private static final GregorianCalendar ASIA_ORAL_CALENDAR = new GregorianCalendar(ASIA_ORAL_ZONE.toTimeZone());
private static final GregorianCalendar ASIA_ORAL_CALENDAR = new GregorianCalendar(TimeZone.getTimeZone(ZoneId.of(ASIA_ORAL_ZONE.getID())));
private static final String TEST_CATALOG = "test_catalog";

private TestingPrestoServer server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableList;
import io.airlift.slice.Slice;
import io.airlift.slice.Slices;
import org.testng.SkipException;
import org.testng.annotations.Test;

import java.util.Collections;
Expand Down Expand Up @@ -117,6 +118,9 @@ public void testNewBlockBuilderLike()
@Test
public void testNewBlockBuilderLikeForLargeBlockBuilder()
{
if (true) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you instead disable it in the @Test annotation like@Test(enabled = false). That's how we usually disable things

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it doesn't show up in the count as skipped?
Originally that is what I did, but then it hid the fact we were skipping a test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting. maybe we should be doing that in general then.

throw new SkipException("https://github.com/prestodb/presto/issues/15653 - Skipped because it OOMs");
}
List<Type> channels = ImmutableList.of(VARCHAR);
PageBuilder pageBuilder = new PageBuilder(channels);
BlockBuilder largeVarcharBlockBuilder = pageBuilder.getBlockBuilder(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,6 @@ private static long millisUtc(OffsetTime offsetTime)

private static SqlTimestampWithTimeZone toTimestampWithTimeZone(DateTime dateTime)
{
return new SqlTimestampWithTimeZone(dateTime.getMillis(), dateTime.getZone().toTimeZone());
return new SqlTimestampWithTimeZone(dateTime.getMillis(), getTimeZoneKey(dateTime.getZone().getID()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.ZoneId;
import java.util.Collections;
import java.util.List;
import java.util.TimeZone;
Expand Down Expand Up @@ -1896,7 +1897,7 @@ private static SqlDate sqlDate(String dateString)
throws ParseException
{
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
dateFormat.setTimeZone(TimeZone.getTimeZone(ZoneId.of("UTC")));
return new SqlDate(toIntExact(TimeUnit.MILLISECONDS.toDays(dateFormat.parse(dateString).getTime())));
}
}
Loading