From 39f24ddc2182b26fbcc6e0420bf0a59186c32146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20S=C3=A3o=20Marcos?= Date: Wed, 16 Dec 2015 13:33:14 +0000 Subject: [PATCH] added test for querying native/unsupported data types in Postgres and updated release notes; Refs #4082 --- presto-docs/src/main/sphinx/release.rst | 1 + .../src/main/sphinx/release/release-0.131.rst | 8 ++++++++ .../TestPostgreSqlDistributedQueries.java | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 presto-docs/src/main/sphinx/release/release-0.131.rst diff --git a/presto-docs/src/main/sphinx/release.rst b/presto-docs/src/main/sphinx/release.rst index d4ab2592de7d..2df13b21b14a 100644 --- a/presto-docs/src/main/sphinx/release.rst +++ b/presto-docs/src/main/sphinx/release.rst @@ -5,6 +5,7 @@ Release Notes .. toctree:: :maxdepth: 1 + release/release-0.131 release/release-0.130 release/release-0.129 release/release-0.128 diff --git a/presto-docs/src/main/sphinx/release/release-0.131.rst b/presto-docs/src/main/sphinx/release/release-0.131.rst new file mode 100644 index 000000000000..35e1e59cc5a1 --- /dev/null +++ b/presto-docs/src/main/sphinx/release/release-0.131.rst @@ -0,0 +1,8 @@ +============= +Release 0.131 +============= + +General Changes +--------------- + +* Fallback to varchar for unkown Jdbc data types. diff --git a/presto-postgresql/src/test/java/com/facebook/presto/plugin/postgresql/TestPostgreSqlDistributedQueries.java b/presto-postgresql/src/test/java/com/facebook/presto/plugin/postgresql/TestPostgreSqlDistributedQueries.java index 54ec652f4484..a35ba71c12e0 100644 --- a/presto-postgresql/src/test/java/com/facebook/presto/plugin/postgresql/TestPostgreSqlDistributedQueries.java +++ b/presto-postgresql/src/test/java/com/facebook/presto/plugin/postgresql/TestPostgreSqlDistributedQueries.java @@ -27,6 +27,7 @@ import static com.facebook.presto.plugin.postgresql.PostgreSqlQueryRunner.createPostgreSqlQueryRunner; import static io.airlift.testing.Closeables.closeAllRuntimeException; +import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; @@ -78,6 +79,24 @@ public void testViews() execute("DROP VIEW IF EXISTS tpch.test_view"); } + @Test + public void testSelectNativeDataTypeColumn() + throws Exception + { + execute("CREATE TABLE tpch.test_other_data_type (_foo UUID)"); + assertTrue(queryRunner.tableExists(getSession(), "test_other_data_type")); + + execute("INSERT INTO tpch.test_other_data_type VALUES ('00000000-0000-0000-0000-000000000000')"); + assertEquals( + queryRunner + .execute(getSession(), "SELECT _foo from test_other_data_type") + .getRowCount(), + 1); + + execute("DROP TABLE IF EXISTS tpch.test_other_data_type"); + assertFalse(queryRunner.tableExists(getSession(), "test_other_data_type")); + } + private void execute(String sql) throws SQLException {