From f7247e1bb78b87d9f13ad5ff54707ccce3446e5a Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 19 Jul 2024 15:13:17 +0000 Subject: [PATCH] use entryset --- .../org/apache/druid/quidem/Launcher.java | 8 ++++--- .../sql/calcite/CalciteTableAppendTest.java | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/quidem-it/src/main/java/org/apache/druid/quidem/Launcher.java b/quidem-it/src/main/java/org/apache/druid/quidem/Launcher.java index a3b8a19eeb9..b185084e0a7 100644 --- a/quidem-it/src/main/java/org/apache/druid/quidem/Launcher.java +++ b/quidem-it/src/main/java/org/apache/druid/quidem/Launcher.java @@ -31,6 +31,7 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; +import java.util.Map.Entry; import java.util.Properties; import java.util.concurrent.TimeUnit; @@ -82,9 +83,10 @@ public class Launcher { String quidemUri = System.getProperty(QUIDEM_URI, "druidtest:///"); Properties p = System.getProperties(); - for (Object string : p.keySet()) { - if (string.toString().startsWith("quidem")) { - log.info("[%s] -> %s", string, p.get(string)); + for (Entry entry : p.entrySet()) { + Object key = entry.getKey(); + if (key.toString().startsWith("quidem")) { + log.info("[%s] -> %s", key, entry.getValue()); } } log.info("Starting Quidem with URI[%s]", quidemUri); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java index 8b6170cbfaa..0f72925b85e 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java @@ -216,6 +216,29 @@ public class CalciteTableAppendTest extends BaseCalciteQueryTest .run(); } + @Test + public void testAppendCompatibleColumns2() + { + // dim3 has different type (string/long) in foo/foo2 + testBuilder() + .sql("select u.dim3,f.dim3 from TABLE(APPEND('foo','foo')) u join foo f on u.dim3 is not distinct from f.dim3") + .expectedResults( + ResultMatchMode.RELAX_NULLS, + ImmutableList.of( + new Object[] {"11"}, + new Object[] {"12"}, + new Object[] {"10"}, + new Object[] {"[\"a\",\"b\"]"}, + new Object[] {"[\"b\",\"c\"]"}, + new Object[] {"d"}, + new Object[] {""}, + new Object[] {null}, + new Object[] {null} + ) + ) + .run(); + } + @Test public void testAppendNoTableIsInvalid() {