From dev-return-34805-archive-asf-public=cust-asf.ponee.io@drill.apache.org Tue Jan 9 23:28:47 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id DE2A218072F for ; Tue, 9 Jan 2018 23:28:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CDCD1160C17; Tue, 9 Jan 2018 22:28:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4684C160C2D for ; Tue, 9 Jan 2018 23:28:47 +0100 (CET) Received: (qmail 84901 invoked by uid 500); 9 Jan 2018 22:28:46 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 84777 invoked by uid 99); 9 Jan 2018 22:28:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jan 2018 22:28:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B275BE01EC; Tue, 9 Jan 2018 22:28:41 +0000 (UTC) From: paul-rogers To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #1059: DRILL-5851: Empty table during a join operation wi... Content-Type: text/plain Message-Id: <20180109222843.B275BE01EC@git1-us-west.apache.org> Date: Tue, 9 Jan 2018 22:28:41 +0000 (UTC) Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/1059#discussion_r160542798 --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestNestedLoopJoin.java --- @@ -333,4 +339,55 @@ public void testNlJoinWithLargeRightInputSuccess() throws Exception { test(RESET_JOIN_OPTIMIZATION); } } + + private static void buildFile(String fileName, String[] data, File testDir) throws IOException { + try(PrintWriter out = new PrintWriter(new FileWriter(new File(testDir, fileName)))) { + for (String line : data) { + out.println(line); + } + } + } + + public static void testWithEmptyJoin(File testDir, String joinType, + String joinPattern, long result) throws Exception { + buildFile("dept.json", new String[0], testDir); + String query = String.format(testEmptyJoin, joinType); + testPlanMatchingPatterns(query, new String[]{joinPattern}, new String[]{}); + testBuilder() + .sqlQuery(query) + .unOrdered() + .baselineColumns("cnt") + .baselineValues(result) + .build().run(); + } + + @Test + public void testNestedLeftJoinWithEmptyTable() throws Exception { + try { + test(DISABLE_NLJ_SCALAR); + testWithEmptyJoin(dirTestWatcher.getRootDir(), "left outer", nlpattern, 1155L); + } finally { + test(RESET_HJ); --- End diff -- Please use `client.resetSessionOption(...)`. ---