Return-Path: X-Original-To: apmail-flink-user-archive@minotaur.apache.org Delivered-To: apmail-flink-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5359619AC6 for ; Wed, 16 Mar 2016 05:37:07 +0000 (UTC) Received: (qmail 989 invoked by uid 500); 16 Mar 2016 05:37:07 -0000 Delivered-To: apmail-flink-user-archive@flink.apache.org Received: (qmail 901 invoked by uid 500); 16 Mar 2016 05:37:06 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flink.apache.org Delivered-To: mailing list user@flink.apache.org Received: (qmail 891 invoked by uid 99); 16 Mar 2016 05:37:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Mar 2016 05:37:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AFE04C0316 for ; Wed, 16 Mar 2016 05:37:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.279 X-Spam-Level: * X-Spam-Status: No, score=1.279 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=olacabs-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id INN1BT2xC0BF for ; Wed, 16 Mar 2016 05:37:03 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 0FF9F5FB5F for ; Wed, 16 Mar 2016 05:37:04 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id h198so11123717lfh.0 for ; Tue, 15 Mar 2016 22:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=olacabs-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=XlO7sMjk/dd7ExM4Z2/BBC4YVI5e5TCNFK9rKmjC6pA=; b=tb6lE42cT6BW1y001zqCcNmUxnrW09SSlUW/ntELa7Pz0NVC1ZOfDerWfucIdl6ZYL Aa/9ONB6oc/bFYCHwTMmF1Tp8Zh8Tri2i8dp9qFs6nAEcAXwWleE0RpK7Zo4UqQEHNGf gu6f8UEp2GEJ2a+qJz5aNZROe3AC6EspOlTtn8gfDEz3RIaA63IOg5Qi0pU90GoFarUE 2lMuCoh5CWsMgOg2y18BTYaOD5139FFAXd3b74G6UQh/F8uzXVMn5bNPQj3czTJMu73R 97lETx4IXGbvMahWg6LrSn/1+dt62RbSdEaD8G9HPWQkEBjy3fCsd3pdRUn7iqpFRvs2 GbHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=XlO7sMjk/dd7ExM4Z2/BBC4YVI5e5TCNFK9rKmjC6pA=; b=cuVzZLFNpzmcpDJUmOQO9xS2qHOYiBDVOGsKNNhOs/qPRoWiCCNEaxDTIOWzVENce0 7LJt0nVqkb/rsnoq7Ajx8SmUezYfJ3/smTzbykq7OT4eJq3a1UIzGniqQxF39WvZZPPS mJCIlmmlE6tG7dMyfIKXjujS26hIRZvMJ65DNfkTK9HT1Tl5eJ8a9PfXgGrXrdFiAROG AkxC9DYpKJQCWWqkCzpn20l+qLWCsxFfCmjv9hXvbrCUwgivH52wfsW5E3J+So0hgNpR ANz/XWoYyo5tAikgFAsPdlxJ4JklifWJo6hMNUIP1iuTOQi49ssUS8NtOAxMy1lZCM/4 2Wew== X-Gm-Message-State: AD7BkJJT207CQYL9zKtKIaAlxk4SBHTN5x3afnUwRtCDve6+lUwvLnm3vRXuOHcWCxkUY68U03pB/84vvYSo72Y7 MIME-Version: 1.0 X-Received: by 10.25.84.1 with SMTP id i1mr652321lfb.2.1458106622773; Tue, 15 Mar 2016 22:37:02 -0700 (PDT) Received: by 10.112.188.229 with HTTP; Tue, 15 Mar 2016 22:37:02 -0700 (PDT) In-Reply-To: References: Date: Wed, 16 Mar 2016 11:07:02 +0530 Message-ID: Subject: Re: how to convert DataStream to DataSet From: Balaji Rajagopalan To: user@flink.apache.org Content-Type: multipart/alternative; boundary=001a11419b184ba08e052e23e7d5 --001a11419b184ba08e052e23e7d5 Content-Type: text/plain; charset=UTF-8 There was a similar question before the answer was to use org.apache.flink.api.common.io.OutputFormat to do the conversion. On Tue, Mar 15, 2016 at 7:48 PM, subash basnet wrote: > Hello all, > > In WikipediaAnalysis.java we get *result *of type *DataStream Long>>*, > > I would want to convert *result* to *newResult* of type > *DataSet>*, > > So tried the following: > DataSet>newResult = result.map(new getResult()); > > public static final class getResult implements MapFunction Long>, Tuple1> { > > @Override > public Tuple1 map(Tuple2 value) { > return new Tuple1(value.f1 + ""); > } > } > > But there is type mismatch, with error as: > *Type mismatch: cannot convert from > SingleOutputStreamOperator> to DataSet>* > > > Best Regards, > Subash Basnet > --001a11419b184ba08e052e23e7d5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
There was a similar question before the answer was to use = org.apache.flink.api.common.io.OutputFormat to do the conversion.=C2=A0

On Tue, Mar 15,= 2016 at 7:48 PM, subash basnet <yasubash@gmail.com> wrote:=
Hello all,

In WikipediaAnalysis.java we get result of type=C2=A0DataS= tream<Tuple2<String, Long>>,

I wou= ld want to convert result=C2=A0to newResult=C2=A0of type=C2= =A0DataSet<Tuple1<String>>,

So = tried the following:=C2=A0
DataSet<Tuple1<String>>new= Result =3D result.map(new getResult());

p= ublic static final class getResult implements MapFunction<Tuple2<Stri= ng, Long>, Tuple1<String>> {

@Override
public Tuple1<String> map(Tuple2<Strin= g, Long> value) {
return new Tuple1<String>(value.f1 + "");
}
}

But there is type = mismatch, with error as:
Type mismatch: cannot convert from SingleOut= putStreamOperator<Tuple1<String>> to DataSet<Tuple1<Strin= g>>


Best Regards,
Subash Basnet

--001a11419b184ba08e052e23e7d5--