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 3C007200D5E for ; Sat, 9 Dec 2017 03:44:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3AC16160C1F; Sat, 9 Dec 2017 02:44:33 +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 32FF0160BFD for ; Sat, 9 Dec 2017 03:44:32 +0100 (CET) Received: (qmail 70782 invoked by uid 500); 9 Dec 2017 02:44:31 -0000 Mailing-List: contact dev-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list dev@asterixdb.apache.org Received: (qmail 70770 invoked by uid 99); 9 Dec 2017 02:44:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Dec 2017 02:44:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7B8DFC237F for ; Sat, 9 Dec 2017 02:44:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.78 X-Spam-Level: X-Spam-Status: No, score=0.78 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=uci-edu.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id JtXBx4HNbwwf for ; Sat, 9 Dec 2017 02:44:29 +0000 (UTC) Received: from mail-ua0-f170.google.com (mail-ua0-f170.google.com [209.85.217.170]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id F07D45F3D1 for ; Sat, 9 Dec 2017 02:44:28 +0000 (UTC) Received: by mail-ua0-f170.google.com with SMTP id e10so8661758uah.10 for ; Fri, 08 Dec 2017 18:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uci-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=asuNJl/N1cBVUXbmF+5nqSyoi9/Ix2gp4iio9emu0AA=; b=Q23s09io/go6CoJQ+edWmZXtEoXZV/OCvATnpk+QMCVjkz0NRMonrqEdT3PAHU2Tsh 2GLcVJzCSB2Iujy+aqqAUVkVaScfp7KUJqwhOvhtDcwMjvw1Yg/I7I8FrOHba3T3mZ83 fG2AHPVtbSKFPIi8/59GII1xjL+O9nI/VHCAQP3Nm4zYUbKzNz4xeIDjyRQTo8hcQzcn cOWEFd0QWgSxikJqIY6i0LNCRA0SMaZT/VeTowcp+FL7VxqZbY4bR8v23GQJynY/pqXb 4QYRTUpF/CEEqkg9hpT/9qj+1r0ANATM5bLvVk2VdUDKfL9nGbFRMmlibXnvo6hz7vAq KjAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=asuNJl/N1cBVUXbmF+5nqSyoi9/Ix2gp4iio9emu0AA=; b=mFGqdICvIIDlXZepi09h8MIh38yDt8OZcytUT/GqSBREBaElcczu5urJINt7bSCo0V uT4Ml4AP/GeK12ftbSSIVf4egwnESsSJtpdH43YVsoktLjer7Mg4wwes08dRwbyDmmPl BAVSak90T0ay+cl54e8s2LHUbPXvq9h4Ll++SgD9cByZqZHLu4UDmbfBzlgAuNu8/PSm iW0/SPdYERvMciOChvoqr+huEADBW2WL5m2ESEJE/XEi6B8k3GoyhLba+pKARjLYFvZ9 eMIjSECt7/hvfVGGsDTcs9YnSi32uuDKum/Tb3QBoY6PwFik/tq+UnPcPHgQG456nghS U5GA== X-Gm-Message-State: AKGB3mINjfu28578qoksOuLW/H/YdaxHXOK1JvZWM+YtrYNCzNTPv8zN zmOAbZGJHjjOReY5PuaWDuqUsEc8dhBPs8OI9k8fK7gMSw== X-Google-Smtp-Source: AGs4zMatPTX64tayxaL4RKui71QYEIuCP7X5Fpc/zidcBju+Q+j+Kl9E34YoUxFb4DhWY12jSaWukoOAKMGeXRVaQgo= X-Received: by 10.159.49.211 with SMTP id w19mr19838817uad.153.1512787468338; Fri, 08 Dec 2017 18:44:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.110.197 with HTTP; Fri, 8 Dec 2017 18:44:08 -0800 (PST) In-Reply-To: References: <0D2C9C57-3ECC-4754-A2D4-BF2B31D07AEF@gmail.com> From: Ian Maxon Date: Fri, 8 Dec 2017 18:44:08 -0800 Message-ID: Subject: Re: [jira] [Commented] (ASTERIXDB-2157) Parsing metadata of UDF with UnorderedList return type To: dev@asterixdb.apache.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable archived-at: Sat, 09 Dec 2017 02:44:33 -0000 Change is up here: https://asterix-gerrit.ics.uci.edu/#/c/2211/, I'll email him and the reviewers since I am not sure whether or not he is on this list. On Fri, Dec 8, 2017 at 4:42 PM, abdullah alamoudi wrot= e: > Ian, > Let's not drop this? > > Cheers, > Abdullah. > > >> Begin forwarded message: >> >> From: abdullah alamoudi >> Subject: Re: [jira] [Commented] (ASTERIXDB-2157) Parsing metadata of UDF= with UnorderedList return type >> Date: November 7, 2017 at 8:38:47 PM PST >> To: dev@asterixdb.apache.org >> Cc: notifications@asterixdb.incubator.apache.org >> >> Hi Tomasz, >> Thanks for creating the issue and for the fix. >> >> @Ian, >> I looked at the PR and it looked good to me. How can we get this in? thr= ough Gerrit? >> >> Cheers, >> Abdullah. >> >>> On Nov 7, 2017, at 1:21 PM, Tomasz Paw=C5=82owski (JIRA) wrote: >>> >>> >>> [ https://issues.apache.org/jira/browse/ASTERIXDB-2157?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D16242901#comment-16242901 ] >>> >>> Tomasz Paw=C5=82owski commented on ASTERIXDB-2157: >>> --------------------------------------------- >>> >>> I have already created a pull request for this bug https://github.com/a= pache/asterixdb/pull/6 including a proper unit test. >>> >>>> Parsing metadata of UDF with UnorderedList return type >>>> ------------------------------------------------------ >>>> >>>> Key: ASTERIXDB-2157 >>>> URL: https://issues.apache.org/jira/browse/ASTERIXDB-215= 7 >>>> Project: Apache AsterixDB >>>> Issue Type: Bug >>>> Components: MTD - Metadata >>>> Reporter: Tomasz Paw=C5=82owski >>>> Priority: Minor >>>> Labels: easyfix, newbie >>>> >>>> While defining a library UDF with return_type representing a unordered= list (eg. {{ ASTRING }}). UDF is created with result type {{ {{ ASTRING }}= }}. >>>> This error can be replicated with libraryFunction: >>>> >>>> SCALAR >>>> test >>>> ASTRING >>>> {{ ASTRING }} >>>> org.apache.asterix.external.library.TestFactory >>>> >>>> TestFactory.java: >>>> package org.apache.asterix.external.library; >>>> import org.apache.asterix.external.api.IExternalScalarFunction; >>>> import org.apache.asterix.external.api.IFunctionFactory; >>>> public class TestFactory implements IFunctionFactory { >>>> @Override >>>> public IExternalScalarFunction getExternalFunction() { >>>> return new TestFunction(); >>>> } >>>> } >>>> // END of TestFactory.java >>>> TestFunction.java: >>>> package org.apache.asterix.external.library; >>>> import org.apache.asterix.external.api.IExternalScalarFunction; >>>> import org.apache.asterix.external.api.IFunctionHelper; >>>> import org.apache.asterix.external.library.java.JObjects; >>>> import org.apache.asterix.om.types.BuiltinType; >>>> public class TestFunction implements IExternalScalarFunction { >>>> private JObjects.JUnorderedList results; >>>> @Override >>>> public void deinitialize() {} >>>> @Override >>>> public void evaluate(IFunctionHelper functionHelper) throws Exceptio= n { >>>> JObjects.JString input =3D (JObjects.JString) functionHelper.get= Argument(0); >>>> results.reset(); >>>> JObjects.JUnorderedList test =3D new JObjects.JUnorderedList(Bui= ltinType.ASTRING); >>>> test.add(input); >>>> test.add(input); >>>> test.add(input); >>>> results.add(test); >>>> functionHelper.setResult(results); >>>> } >>>> @Override >>>> public void initialize(IFunctionHelper functionHelper) throws Except= ion{ >>>> results =3D (JObjects.JUnorderedList) functionHelper.getResultOb= ject(); >>>> } >>>> } >>>> // END of TestFunction.java >>>> And executing (AQL): >>>> use dataverse test; >>>> testlib#test("test") >>>> Which results in: >>>> {{ {{ "test", "test", "test" }} }} >>>> At the same time writing TestFunction evaluate to return {{ ASTRING }}= results in error: >>>> org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: j= ava.io.EOFException >>>> at org.apache.asterix.optimizer.rules.ConstantFoldingRule$Constant= FoldingVisitor.visitScalarFunctionCallExpression(ConstantFoldingRule.java:2= 31) >>>> at org.apache.asterix.optimizer.rules.ConstantFoldingRule$Constant= FoldingVisitor.visitScalarFunctionCallExpression(ConstantFoldingRule.java:1= 53) >>>> at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFu= nctionCallExpression.accept(ScalarFunctionCallExpression.java:55) >>>> at org.apache.asterix.optimizer.rules.ConstantFoldingRule$Constant= FoldingVisitor.transform(ConstantFoldingRule.java:163) >>>> at org.apache.hyracks.algebricks.core.algebra.operators.logical.Ab= stractAssignOperator.acceptExpressionTransform(AbstractAssignOperator.java:= 67) >>>> at org.apache.asterix.optimizer.rules.ConstantFoldingRule.rewriteP= ost(ConstantFoldingRule.java:150) >>>> at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleCo= ntroller.rewriteOperatorRef(AbstractRuleController.java:126) >>>> at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleCo= ntroller.rewriteOperatorRef(AbstractRuleController.java:100) >>>> at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleCo= ntroller.rewriteOperatorRef(AbstractRuleController.java:100) >>>> at org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers= .SequentialFixpointRuleController.rewriteWithRuleCollection(SequentialFixpo= intRuleController.java:53) >>>> at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptim= izer.runOptimizationSets(HeuristicOptimizer.java:102) >>>> at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptim= izer.optimize(HeuristicOptimizer.java:82) >>>> at org.apache.hyracks.algebricks.compiler.api.HeuristicCompilerFac= toryBuilder$1$1.optimize(HeuristicCompilerFactoryBuilder.java:90) >>>> at org.apache.asterix.api.common.APIFramework.compileQuery(APIFram= ework.java:267) >>>> at org.apache.asterix.app.translator.QueryTranslator.rewriteCompil= eQuery(QueryTranslator.java:1834) >>>> at org.apache.asterix.app.translator.QueryTranslator.lambda$handle= Query$1(QueryTranslator.java:2307) >>>> at org.apache.asterix.app.translator.QueryTranslator.createAndRunJ= ob(QueryTranslator.java:2407) >>>> at org.apache.asterix.app.translator.QueryTranslator.deliverResult= (QueryTranslator.java:2340) >>>> at org.apache.asterix.app.translator.QueryTranslator.handleQuery(Q= ueryTranslator.java:2319) >>>> at org.apache.asterix.app.translator.QueryTranslator.compileAndExe= cute(QueryTranslator.java:370) >>>> at org.apache.asterix.app.translator.QueryTranslator.compileAndExe= cute(QueryTranslator.java:253) >>>> at org.apache.asterix.api.http.server.ApiServlet.post(ApiServlet.j= ava:153) >>>> at org.apache.hyracks.http.server.AbstractServlet.handle(AbstractS= ervlet.java:78) >>>> at org.apache.hyracks.http.server.HttpRequestHandler.handle(HttpRe= questHandler.java:70) >>>> at org.apache.hyracks.http.server.HttpRequestHandler.call(HttpRequ= estHandler.java:55) >>>> at org.apache.hyracks.http.server.HttpRequestHandler.call(HttpRequ= estHandler.java:36) >>>> at java.util.concurrent.FutureTask.run(FutureTask.java:266) >>>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExe= cutor.java:1142) >>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx= ecutor.java:617) >>>> at java.lang.Thread.run(Thread.java:745) >>>> Caused by: org.apache.hyracks.api.exceptions.HyracksDataException: jav= a.io.EOFException >>>> at org.apache.hyracks.api.exceptions.HyracksDataException.create(H= yracksDataException.java:45) >>>> at org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedList= SerializerDeserializer.deserialize(AUnorderedListSerializerDeserializer.jav= a:102) >>>> at org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedList= SerializerDeserializer.deserialize(AUnorderedListSerializerDeserializer.jav= a:43) >>>> at org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedList= SerializerDeserializer.deserialize(AUnorderedListSerializerDeserializer.jav= a:96) >>>> at org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedList= SerializerDeserializer.deserialize(AUnorderedListSerializerDeserializer.jav= a:43) >>>> at org.apache.asterix.formats.nontagged.SerializerDeserializerProv= ider$1.deserialize(SerializerDeserializerProvider.java:191) >>>> at org.apache.asterix.formats.nontagged.SerializerDeserializerProv= ider$1.deserialize(SerializerDeserializerProvider.java:173) >>>> at org.apache.asterix.optimizer.rules.ConstantFoldingRule$Constant= FoldingVisitor.visitScalarFunctionCallExpression(ConstantFoldingRule.java:2= 28) >>>> ... 29 more >>>> Caused by: java.io.EOFException >>>> at java.io.DataInputStream.readInt(DataInputStream.java:392) >>>> at org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedList= SerializerDeserializer.deserialize(AUnorderedListSerializerDeserializer.jav= a:92) >>>> ... 35 more >>> >>> >>> >>> -- >>> This message was sent by Atlassian JIRA >>> (v6.4.14#64029) >> >