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 87728200CC9 for ; Mon, 3 Jul 2017 07:50:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 85954160BFE; Mon, 3 Jul 2017 05:50:03 +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 CC632160BEE for ; Mon, 3 Jul 2017 07:50:02 +0200 (CEST) Received: (qmail 21333 invoked by uid 500); 3 Jul 2017 05:50:02 -0000 Mailing-List: contact issues-help@hivemall.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hivemall.incubator.apache.org Delivered-To: mailing list issues@hivemall.incubator.apache.org Received: (qmail 21324 invoked by uid 99); 3 Jul 2017 05:50:02 -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, 03 Jul 2017 05:50:02 +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 825AEC0332 for ; Mon, 3 Jul 2017 05:50:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.21 X-Spam-Level: X-Spam-Status: No, score=-99.21 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100, WEIRD_QUOTING=0.001] autolearn=disabled 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 vjqNHY8v3Z2A for ; Mon, 3 Jul 2017 05:50:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D1CFE5F254 for ; Mon, 3 Jul 2017 05:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 52B61E0637 for ; Mon, 3 Jul 2017 05:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0A0AF20D11 for ; Mon, 3 Jul 2017 05:50:00 +0000 (UTC) Date: Mon, 3 Jul 2017 05:50:00 +0000 (UTC) From: "Takeshi Yamamuro (JIRA)" To: issues@hivemall.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVEMALL-61) Support a function to convert a comma-separated string into typed data and vice versa MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 03 Jul 2017 05:50:03 -0000 [ https://issues.apache.org/jira/browse/HIVEMALL-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071948#comment-16071948 ] Takeshi Yamamuro commented on HIVEMALL-61: ------------------------------------------ This issue has already fixed in https://github.com/apache/incubator-hivemall/pull/62/files, so I'll close this as fixed. Thanks, [~Downchuck], the suggestion. Yea, we intend to support any functionality (that vanilla spark does not support) for easy-to-use. Can you file a new jira for that? Thanks again! > Support a function to convert a comma-separated string into typed data and vice versa > ------------------------------------------------------------------------------------- > > Key: HIVEMALL-61 > URL: https://issues.apache.org/jira/browse/HIVEMALL-61 > Project: Hivemall > Issue Type: New Feature > Reporter: Takeshi Yamamuro > Priority: Minor > > Currently, spark does not have this features (IMO this feature will not appear as first-class ones in Spark) it is useful for ETL before ML processing. > e.x.) > {code} > scala> val ds1 = Seq("""1,abc""").toDS() > ds1: org.apache.spark.sql.Dataset[String] = [value: string] > scala> val schema = new StructType().add("a", IntegerType).add("b", StringType) > schema: org.apache.spark.sql.types.StructType = StructType(StructField(a,IntegerType,true), StructField(b,StringType,true)) > scala> val ds2 = ds1.select(from_csv($"value", schema)) > ds2: org.apache.spark.sql.DataFrame = [csvtostruct(value): struct] > scala> ds2.printSchema > root > |-- csvtostruct(value): struct (nullable = true) > | |-- a: integer (nullable = true) > | |-- b: string (nullable = true) > scala> ds2.show > +------------------+ > |csvtostruct(value)| > +------------------+ > | [1,abc]| > +------------------+ > {code} > A related discussion is here: https://github.com/apache/spark/pull/13300#issuecomment-261962773 -- This message was sent by Atlassian JIRA (v6.4.14#64029)