From user-zh-return-1463-archive-asf-public=cust-asf.ponee.io@flink.apache.org Mon Nov 11 12:40:18 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 80036180629 for ; Mon, 11 Nov 2019 13:40:18 +0100 (CET) Received: (qmail 31466 invoked by uid 500); 11 Nov 2019 12:40:17 -0000 Mailing-List: contact user-zh-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-zh@flink.apache.org Delivered-To: mailing list user-zh@flink.apache.org Received: (qmail 31454 invoked by uid 99); 11 Nov 2019 12:40:17 -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; Mon, 11 Nov 2019 12:40:17 +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 8E869C1012 for ; Mon, 11 Nov 2019 12:40:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id w4cNgUocHfjk for ; Mon, 11 Nov 2019 12:40:14 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::12e; helo=mail-lf1-x12e.google.com; envelope-from=shenleifighting@gmail.com; receiver= Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 5098D7DD7F for ; Mon, 11 Nov 2019 12:40:14 +0000 (UTC) Received: by mail-lf1-x12e.google.com with SMTP id j26so2635633lfh.7 for ; Mon, 11 Nov 2019 04:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=359u0PlR4t24WPYgi4GieHUIK2i+yVHv4eoK+X2sb18=; b=k+brXmZjREdjvpYuQx2iWLSUTawECeyu0o/ubSaXuBedCOUSLcUMfBSlOdBVxpLNMg 0lUIhdRGkCP4uuA6MABQwpnAek9xi7O1vwW1dlBz5VhUfYY0SxJdd04Jpn0zN4yqQhpC cbUmRb3dqHm3IzS1TifgQRlVzkCKOdePlp4x66VSIgyVskUO114zRaGBKQALdmK62UmJ 7FSEzeOP/FHQBEnoJYpL0qhUQ2Bfght+3QXOYYfawO1GHxx300XrzMQULzQxFcYxptYM gmqAUOMrpulkBHjA5u3TnMjwhIpednLivykLIxjjhY+uCA1c/jEfUuZ1163yWeN76pDq yWXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=359u0PlR4t24WPYgi4GieHUIK2i+yVHv4eoK+X2sb18=; b=QzJnjmbAySJpqmykGFffFCTlcGfDZZ19htsfRfcjul2Z2pcHzgn55MDRBdnu7kBOxL OIop7FUxt2LWd2v+qvbysjlfm8+W8MRLSV9NrIrxMm7eFBRxLdy2pu9iTl7C2PrclDZ5 RPcfcEe0HnStPhAPkqwwAJuhGLV+fV7M+Sm99q244HW5jhwxvw5Dwx+ofzgHl5YFqJvQ YqA5zGoi9FzHJ+IjI8Rs5J5PP/M3h8a+DIf49JoW1D6ODczfjbuKokm0Fq1Cx5pkEi5S w3tdUxV6BtZPOIZnpsPJdbS3XkZzOq5caclsZ1uOAhER2OBtVB56WvsAITgdX8Bureu1 8lvA== X-Gm-Message-State: APjAAAXI2JijzoFlwB1u1DqqYKAuEfTwfh5yYabHgDPHqyqqYw9mZv9/ mazo8YQUb8HAL4KhLf9NdSPSWduk8PBnqLx/jC1HwapJ X-Google-Smtp-Source: APXvYqzU6bh1FauacBDn8pI/1IvhbZ6pwBsP3k7hu2P6HOSp3eUMT9cBWFAElau1KIFy7gid+1A/GuGRf7HelJd+Aek= X-Received: by 2002:a19:4848:: with SMTP id v69mr15366690lfa.6.1573476013244; Mon, 11 Nov 2019 04:40:13 -0800 (PST) MIME-Version: 1.0 References: <2019111117522801857714@163.com> In-Reply-To: <2019111117522801857714@163.com> From: LakeShen Date: Mon, 11 Nov 2019 20:40:05 +0800 Message-ID: Subject: =?UTF-8?B?UmU6IGZsaW5rIFNjYWxhckZ1bmN0aW9uIOmHjeWGmSBnZXRQYXJhbWV0ZXJUeXBlcyA=?= =?UTF-8?B?5pa55rOV5LiN55Sf5pWI?= To: user-zh@flink.apache.org Content-Type: multipart/alternative; boundary="000000000000d504760597116e12" --000000000000d504760597116e12 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable getParameterTypes =E4=B8=8D=E7=94=A8=E9=87=8D=E5=86=99 rockeycui@163.com =E4=BA=8E 2019=E5=B9=B411=E6=9C=8811= =E6=97=A5=E5=91=A8=E4=B8=80 =E4=B8=8B=E5=8D=885:52=E5=86=99=E9=81=93=EF=BC= =9A > > =E5=A4=A7=E5=AE=B6=E5=A5=BD=EF=BC=9A > =E6=88=91=E5=9C=A8 tableapi =E4=B8=AD=E4=BD=BF=E7=94=A8=E8=87=AA=E5= =AE=9A=E4=B9=89 UDF =EF=BC=8C=E5=85=B6=E4=B8=AD ScalarFunction =E5=9C=A8 = =E9=87=8D=E5=86=99 getParameterTypes > =E5=90=8E=EF=BC=8C=E8=AF=AD=E6=B3=95=E8=AF=AD=E4=B9=89=E6=A3=80=E6=9F=A5= =E5=B9=B6=E6=B2=A1=E6=9C=89=E7=94=9F=E6=95=88=EF=BC=8C=E8=80=8C=E6=98=AF=E4= =BB=BB=E5=8A=A1=E5=90=AF=E5=8A=A8=E5=90=8E=E6=8A=A5=E5=87=BA=E9=94=99=E8=AF= =AF=EF=BC=88=E9=87=8D=E7=82=B9 TableFunction =E6=AD=A3=E5=B8=B8=E7=94=9F=E6= =95=88=EF=BC=8C=E6=80=80=E7=96=91=E6=98=AF ScalarFunction =E8=BF=99=E8=BE= =B9=E7=9A=84 > bug=EF=BC=89=E3=80=82 > ScalarFunction =E5=A6=82=E4=B8=8B=EF=BC=9A > public class Fun extends ScalarFunction { > > public Object eval(Object... params) { > return "fun"; > } > > @Override > public TypeInformation[] getParameterTypes(Class[] signature) { > return new RowTypeInfo(Types.LONG).getFieldTypes(); > } > } > main=E6=96=B9=E6=B3=95 > public static void main(String[] args) throws Exception { > StreamExecutionEnvironment env =3D > StreamExecutionEnvironment.getExecutionEnvironment(); > StreamTableEnvironment tableEnv =3D StreamTableEnvironment.create(env= ); > DataStreamSource stringDataStreamSource =3D env.fromElements( > "1001,adc0:x,1000000", > "1002,adc1:x,1000000", > "1003,adc2:x,1000000", > "1004,adc3:x,1000000", > "1005,adc4:x,1000000", > "1006,adc5:x,1000000" > ); > TypeInformation[] types =3D new TypeInformation[]{Types.LONG, > Types.STRING, Types.LONG}; > RowTypeInfo typeInformation =3D new RowTypeInfo( > types, > new String[]{"id", "url", "clickTime"}); > > DataStream stream =3D > stringDataStreamSource.map(....).returns(typeInformation); > > tableEnv.registerFunction("fun", new Fun()); > tableEnv.registerDataStream("user_click_info", stream, > String.join(",", typeInformation.getFieldNames())); > > String sql =3D " select *,fun(url) from user_click_info"; > Table table =3D tableEnv.sqlQuery(sql); > DataStream result =3D tableEnv.toAppendStream(table, Row.class); > result.print(); > table.printSchema(); > tableEnv.execute("test"); > } > =E5=8F=AF=E4=BB=A5=E7=9C=8B=E5=88=B0 url =E5=AE=9A=E4=B9=89=E4=B8=BA stri= ng =E7=B1=BB=E5=9E=8B=EF=BC=8CFun =E6=96=B9=E6=B3=95=E6=89=BE=E9=82=A3=E4= =B8=AA=E5=8F=82=E6=95=B0=E5=A3=B0=E6=98=8E=E4=B8=BA long =E7=B1=BB=E5=9E=8B= =EF=BC=8C=E6=AD=A4=E6=97=B6=E5=BA=94=E8=AF=A5=E6=8A=A5=E5=87=BA=E8=AF=AD=E6= =B3=95=E8=AF=AD=E4=B9=89=E9=94=99=E8=AF=AF=EF=BC=8C=E5=AE=9E=E9=99=85=E6=8A= =A5=E9=94=99=E6=83=85=E5=86=B5=E5=A6=82=E4=B8=8B=EF=BC=9A > > Exception in thread "main" > org.apache.flink.runtime.client.JobExecutionException: Job execution fail= ed. > at > org.apache.flink.runtime.jobmaster.JobResult.toJobExecutionResult(JobResu= lt.java:146) > at > org.apache.flink.runtime.minicluster.MiniCluster.executeJobBlocking(MiniC= luster.java:626) > at > org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute= (LocalStreamEnvironment.java:117) > at > org.apache.flink.table.planner.delegation.StreamExecutor.execute(StreamEx= ecutor.java:46) > at > org.apache.flink.table.api.internal.TableEnvironmentImpl.execute(TableEnv= ironmentImpl.java:410) > at > com.rock.flink19.tablefunction.TableFunctionTest.main(TableFunctionTest.j= ava:77) > Caused by: java.lang.RuntimeException: Could not instantiate generated > class 'StreamExecCalc$11' > at > org.apache.flink.table.runtime.generated.GeneratedClass.newInstance(Gener= atedClass.java:67) > at > org.apache.flink.table.runtime.operators.CodeGenOperatorFactory.createStr= eamOperator(CodeGenOperatorFactory.java:47) > at > org.apache.flink.streaming.runtime.tasks.OperatorChain.createChainedOpera= tor(OperatorChain.java:428) > at > org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollec= tor(OperatorChain.java:354) > at > org.apache.flink.streaming.runtime.tasks.OperatorChain.createChainedOpera= tor(OperatorChain.java:418) > at > org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollec= tor(OperatorChain.java:354) > at > org.apache.flink.streaming.runtime.tasks.OperatorChain.createChainedOpera= tor(OperatorChain.java:418) > at > org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollec= tor(OperatorChain.java:354) > at > org.apache.flink.streaming.runtime.tasks.OperatorChain.(OperatorCha= in.java:144) > at > org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.jav= a:373) > at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:705) > at org.apache.flink.runtime.taskmanager.Task.run(Task.java:530) > at java.lang.Thread.run(Thread.java:748) > Caused by: org.apache.flink.api.common.InvalidProgramException: Table > program cannot be compiled. This is a bug. Please file an issue. > at > org.apache.flink.table.runtime.generated.CompileUtils.doCompile(CompileUt= ils.java:81) > at > org.apache.flink.table.runtime.generated.CompileUtils.compile(CompileUtil= s.java:65) > at > org.apache.flink.table.runtime.generated.GeneratedClass.compile(Generated= Class.java:78) > at > org.apache.flink.table.runtime.generated.GeneratedClass.newInstance(Gener= atedClass.java:65) > ... 12 more > Caused by: org.codehaus.commons.compiler.CompileException: Line 101, > Column 187: Cannot cast "org.apache.flink.table.dataformat.BinaryString" = to > "java.lang.Long" > at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12124) > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5049) > at org.codehaus.janino.UnitCompiler.access$8600(UnitCompiler.java:215) > at org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:4416) > at org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:4394) > at org.codehaus.janino.Java$Cast.accept(Java.java:4887) > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4394) > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5055) > at org.codehaus.janino.UnitCompiler.access$8100(UnitCompiler.java:215) > at > org.codehaus.janino.UnitCompiler$16$1.visitParenthesizedExpression(UnitCo= mpiler.java:4407) > at > org.codehaus.janino.UnitCompiler$16$1.visitParenthesizedExpression(UnitCo= mpiler.java:4398) > at org.codehaus.janino.Java$ParenthesizedExpression.accept(Java.java:4913= ) > at org.codehaus.janino.UnitCompiler$16.visitLvalue(UnitCompiler.java:4398= ) > at org.codehaus.janino.UnitCompiler$16.visitLvalue(UnitCompiler.java:4394= ) > at org.codehaus.janino.Java$Lvalue.accept(Java.java:4137) > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4394) > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:557= 5) > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:4714) > at org.codehaus.janino.UnitCompiler.access$8800(UnitCompiler.java:215) > at > org.codehaus.janino.UnitCompiler$16.visitConditionalExpression(UnitCompil= er.java:4418) > at > org.codehaus.janino.UnitCompiler$16.visitConditionalExpression(UnitCompil= er.java:4394) > at org.codehaus.janino.Java$ConditionalExpression.accept(Java.java:4504) > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4394) > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:557= 5) > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:553= 5) > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5505) > at org.codehaus.janino.UnitCompiler.access$9700(UnitCompiler.java:215) > at > org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler= .java:4432) > at > org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler= .java:4394) > at org.codehaus.janino.Java$NewInitializedArray.accept(Java.java:5362) > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4394) > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:557= 5) > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5165) > at org.codehaus.janino.UnitCompiler.access$9100(UnitCompiler.java:215) > at > org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.ja= va:4421) > at > org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.ja= va:4394) > at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5062) > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4394) > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:557= 5) > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5019) > at org.codehaus.janino.UnitCompiler.access$8600(UnitCompiler.java:215) > at org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:4416) > at org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:4394) > at org.codehaus.janino.Java$Cast.accept(Java.java:4887) > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4394) > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:557= 5) > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2580) > at org.codehaus.janino.UnitCompiler.access$2700(UnitCompiler.java:215) > at > org.codehaus.janino.UnitCompiler$6.visitLocalVariableDeclarationStatement= (UnitCompiler.java:1503) > at > org.codehaus.janino.UnitCompiler$6.visitLocalVariableDeclarationStatement= (UnitCompiler.java:1487) > at > org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.ja= va:3511) > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1487) > at > org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1567= ) > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3388) > at > org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java= :1357) > at > org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java= :1330) > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:822) > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:432) > at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:215) > at > org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(Uni= tCompiler.java:411) > at > org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(Uni= tCompiler.java:406) > at > org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1= 414) > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:406) > at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:378) > at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:237) > at > org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.ja= va:465) > at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:216) > at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:207) > at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80) > at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:75) > at > org.apache.flink.table.runtime.generated.CompileUtils.doCompile(CompileUt= ils.java:78) > ... 15 more > > > rockeycui@163.com > --000000000000d504760597116e12--