Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DFB32200D1B for ; Thu, 12 Oct 2017 08:41:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DE1CD1609E8; Thu, 12 Oct 2017 06:41:19 +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 3029D1609CD for ; Thu, 12 Oct 2017 08:41:19 +0200 (CEST) Received: (qmail 36846 invoked by uid 500); 12 Oct 2017 06:41:18 -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 36834 invoked by uid 99); 12 Oct 2017 06:41:17 -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; Thu, 12 Oct 2017 06:41:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5328DDFCB5; Thu, 12 Oct 2017 06:41:15 +0000 (UTC) From: ilooner To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #984: DRILL-5783 Made a unit test for generated Priority ... Content-Type: text/plain Message-Id: <20171012064116.5328DDFCB5@git1-us-west.apache.org> Date: Thu, 12 Oct 2017 06:41:15 +0000 (UTC) archived-at: Thu, 12 Oct 2017 06:41:20 -0000 Github user ilooner commented on a diff in the pull request: https://github.com/apache/drill/pull/984#discussion_r144205146 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java --- @@ -335,20 +333,32 @@ private void purge() throws SchemaChangeException { logger.debug("Took {} us to purge", watch.elapsed(TimeUnit.MICROSECONDS)); } - public PriorityQueue createNewPriorityQueue(FragmentContext context, List orderings, - VectorAccessible batch, MappingSet mainMapping, MappingSet leftMapping, MappingSet rightMapping) - throws ClassTransformationException, IOException, SchemaChangeException{ - CodeGenerator cg = CodeGenerator.get(PriorityQueue.TEMPLATE_DEFINITION, context.getFunctionRegistry(), context.getOptions()); + private PriorityQueue createNewPriorityQueue(VectorAccessible batch, int limit) + throws SchemaChangeException, ClassTransformationException, IOException { + return createNewPriorityQueue(context.getOptionSet(), context.getFunctionRegistry(), context.getDrillbitContext().getCompiler(), + config.getOrderings(), batch, unionTypeEnabled, codegenDump, limit, oContext.getAllocator(), schema.getSelectionVectorMode()); + } + + public static PriorityQueue createNewPriorityQueue( + OptionSet optionSet, FunctionLookupContext functionLookupContext, CodeCompiler codeCompiler, + List orderings, VectorAccessible batch, boolean unionTypeEnabled, boolean codegenDump, + int limit, BufferAllocator allocator, SelectionVectorMode mode) + throws ClassTransformationException, IOException, SchemaChangeException { + final MappingSet mainMapping = new MappingSet((String) null, null, ClassGenerator.DEFAULT_SCALAR_MAP, ClassGenerator.DEFAULT_SCALAR_MAP); + final MappingSet leftMapping = new MappingSet("leftIndex", null, ClassGenerator.DEFAULT_SCALAR_MAP, ClassGenerator.DEFAULT_SCALAR_MAP); + final MappingSet rightMapping = new MappingSet("rightIndex", null, ClassGenerator.DEFAULT_SCALAR_MAP, ClassGenerator.DEFAULT_SCALAR_MAP); --- End diff -- Reverted it back to the way it was ---