From 64d4090632a77b8607adb5bfc225bd1ada762cd4 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Thu, 5 Sep 2019 10:35:34 +0200 Subject: [PATCH] Disable tests broken by Hive breaking changes --- .../io/prestosql/plugin/hive/TestHive.java | 29 +++++++++++++++++++ .../TestAllDatatypesFromHiveConnector.java | 13 ++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/presto-hive-hadoop2/src/test/java/io/prestosql/plugin/hive/TestHive.java b/presto-hive-hadoop2/src/test/java/io/prestosql/plugin/hive/TestHive.java index 17463aab11cb..493673871bab 100644 --- a/presto-hive-hadoop2/src/test/java/io/prestosql/plugin/hive/TestHive.java +++ b/presto-hive-hadoop2/src/test/java/io/prestosql/plugin/hive/TestHive.java @@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkState; import static java.lang.Integer.parseInt; import static java.util.Objects.requireNonNull; +import static org.assertj.core.api.Assertions.assertThatThrownBy; public class TestHive extends AbstractTestHive @@ -72,4 +73,32 @@ public void testGetPartitionSplitsTableOfflinePartition() super.testGetPartitionSplitsTableOfflinePartition(); } + + @Override + public void testTypesRcBinary() + throws Exception + { + if (getHiveVersionMajor() >= 3) { + // TODO (https://github.com/prestosql/presto/issues/1218) requires https://issues.apache.org/jira/browse/HIVE-22167 + assertThatThrownBy(super::testTypesRcBinary) + .isInstanceOf(AssertionError.class) + .hasMessage("expected [2011-05-06 01:23:09.123] but found [2011-05-06 07:08:09.123]"); + return; + } + super.testTypesRcBinary(); + } + + @Override + public void testTypesParquet() + throws Exception + { + if (getHiveVersionMajor() >= 3) { + // TODO (https://github.com/prestosql/presto/issues/1218) requires https://issues.apache.org/jira/browse/HIVE-21002 + assertThatThrownBy(super::testTypesParquet) + .isInstanceOf(AssertionError.class) + .hasMessage("expected [2011-05-06 01:23:09.123] but found [2011-05-06 07:08:09.123]"); + return; + } + super.testTypesParquet(); + } } diff --git a/presto-product-tests/src/main/java/io/prestosql/tests/hive/TestAllDatatypesFromHiveConnector.java b/presto-product-tests/src/main/java/io/prestosql/tests/hive/TestAllDatatypesFromHiveConnector.java index e9678b6bb53f..2d118c3ab1f1 100644 --- a/presto-product-tests/src/main/java/io/prestosql/tests/hive/TestAllDatatypesFromHiveConnector.java +++ b/presto-product-tests/src/main/java/io/prestosql/tests/hive/TestAllDatatypesFromHiveConnector.java @@ -13,7 +13,6 @@ */ package io.prestosql.tests.hive; -import io.prestosql.tempto.ProductTest; import io.prestosql.tempto.Requirement; import io.prestosql.tempto.Requirements; import io.prestosql.tempto.RequirementsProvider; @@ -65,7 +64,7 @@ import static java.sql.JDBCType.VARCHAR; public class TestAllDatatypesFromHiveConnector - extends ProductTest + extends HiveProductTest { public static final class TextRequirements implements RequirementsProvider @@ -276,7 +275,10 @@ public void testSelectAllDatatypesAvro() 234.567, new BigDecimal("346"), new BigDecimal("345.67800"), - Timestamp.valueOf(LocalDateTime.of(2015, 5, 10, 12, 15, 35, 123_000_000)), + getHiveVersionMajor() < 3 + ? Timestamp.valueOf(LocalDateTime.of(2015, 5, 10, 12, 15, 35, 123_000_000)) + // TODO (https://github.com/prestosql/presto/issues/1218) requires https://issues.apache.org/jira/browse/HIVE-21002 + : Timestamp.valueOf(LocalDateTime.of(2015, 5, 10, 18, 0, 35, 123_000_000)), Date.valueOf("2015-05-10"), "ala ma kota", "ala ma kot", @@ -395,7 +397,10 @@ public void testSelectAllDatatypesParquetFile() 234.567, new BigDecimal("346"), new BigDecimal("345.67800"), - Timestamp.valueOf(LocalDateTime.of(2015, 5, 10, 12, 15, 35, 123_000_000)), + getHiveVersionMajor() < 3 + ? Timestamp.valueOf(LocalDateTime.of(2015, 5, 10, 12, 15, 35, 123_000_000)) + // TODO (https://github.com/prestosql/presto/issues/1218) requires https://issues.apache.org/jira/browse/HIVE-21002 + : Timestamp.valueOf(LocalDateTime.of(2015, 5, 10, 18, 0, 35, 123_000_000)), "ala ma kota", "ala ma kot", "ala ma ",