From dev-return-2465-archive-asf-public=cust-asf.ponee.io@datafu.apache.org Thu Oct 8 18:59:02 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 81D6918065C for ; Thu, 8 Oct 2020 20:59:02 +0200 (CEST) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id BC4D112441B for ; Thu, 8 Oct 2020 18:59:01 +0000 (UTC) Received: (qmail 64775 invoked by uid 500); 8 Oct 2020 18:59:01 -0000 Mailing-List: contact dev-help@datafu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@datafu.apache.org Delivered-To: mailing list dev@datafu.apache.org Received: (qmail 64671 invoked by uid 99); 8 Oct 2020 18:59:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2020 18:59:01 +0000 Received: from jira2-he-de.apache.org (static.54.33.119.168.clients.your-server.de [168.119.33.54]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8CB4D40D3C for ; Thu, 8 Oct 2020 18:59:00 +0000 (UTC) Received: from jira2-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira2-he-de.apache.org (ASF Mail Server at jira2-he-de.apache.org) with ESMTP id 0D473C8008E for ; Thu, 8 Oct 2020 18:59:00 +0000 (UTC) Date: Thu, 8 Oct 2020 18:59:00 +0000 (UTC) From: "Eyal Allweil (Jira)" To: dev@datafu.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DATAFU-154) Spark Explode Array method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DATAFU-154?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Eyal Allweil updated DATAFU-154: -------------------------------- Description:=20 Spark has an [explode|https://spark.apache.org/docs/latest/api/sql/index.ht= ml#explode] method that divides an array into multiple rows. It is sometime= s convenient to divide an array into multiple columns. h5. For example, for input: |label|sentence_arr | |0.0 |[Hi, I heard, about, Spark] | |0.0 |[I wish, Java, could use, case classes] | |1.0 |[Logistic, regression, models, are neat]| h5. the output could be |label|sentence_arr |token0 |token1 |token2 |token3 | |0.0 |[Hi, I heard, about, Spark] |Hi |I heard |about |Spark | |0.0 |[I wish, Java, could use, case classes] |I wish |Java |could use|case= classes| |1.0 |[Logistic, regression, models, are neat]|Logistic|regression|models |= are neat | =C2=A0 was: Spark has an [explode|https://spark.apache.org/docs/latest/api/sql/index.ht= ml#explode] method that divides an array into multiple rows. It is sometime= s convenient to divide an array into multiple columns. =C2=A0 For example, for input +-----+----------------------------------------+ |label|sentence_arr | +-----+----------------------------------------+ |0.0 |[Hi, I heard, about, Spark] | |0.0 |[I wish, Java, could use, case classes] | |1.0 |[Logistic, regression, models, are neat]| +-----+----------------------------------------+ =C2=A0 the output could be +-----+----------------------------------------+--------+----------+-------= --+------------+ |label|sentence_arr |token0 |token1 |token2 |token3 | +-----+----------------------------------------+--------+----------+-------= --+------------+ |0.0 |[Hi, I heard, about, Spark] |Hi |I heard |about |Spark | |0.0 |[I wish, Java, could use, case classes] |I wish |Java |could use|case= classes| |1.0 |[Logistic, regression, models, are neat]|Logistic|regression|models |= are neat | +-----+----------------------------------------+--------+----------+-------= --+------------+ =C2=A0 > Spark Explode Array method > -------------------------- > > Key: DATAFU-154 > URL: https://issues.apache.org/jira/browse/DATAFU-154 > Project: DataFu > Issue Type: New Feature > Environment: {noformat} > *no* further _formatting_ is done here{noformat} > {code:java} > =C2=A0 > {code} > {code:java} > =C2=A0 > {code} > Reporter: Eyal Allweil > Priority: Major > > Spark has an [explode|https://spark.apache.org/docs/latest/api/sql/index.= html#explode] method that divides an array into multiple rows. It is someti= mes convenient to divide an array into multiple columns. > h5. For example, for input: > |label|sentence_arr | > |0.0 |[Hi, I heard, about, Spark] | > |0.0 |[I wish, Java, could use, case classes] | > |1.0 |[Logistic, regression, models, are neat]| > h5. the output could be > |label|sentence_arr |token0 |token1 |token2 |token3 | > |0.0 |[Hi, I heard, about, Spark] |Hi |I heard |about |Spark | > |0.0 |[I wish, Java, could use, case classes] |I wish |Java |could use|ca= se classes| > |1.0 |[Logistic, regression, models, are neat]|Logistic|regression|models= |are neat | > =C2=A0 -- This message was sent by Atlassian Jira (v8.3.4#803005)