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 A565A200D68 for ; Thu, 14 Dec 2017 01:46:27 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A3EC4160C24; Thu, 14 Dec 2017 00:46:27 +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 E61A4160C23 for ; Thu, 14 Dec 2017 01:46:26 +0100 (CET) Received: (qmail 67541 invoked by uid 500); 14 Dec 2017 00:46:26 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 67532 invoked by uid 99); 14 Dec 2017 00:46:26 -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; Thu, 14 Dec 2017 00:46:26 +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 91A40C4DA7 for ; Thu, 14 Dec 2017 00:46:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.011 X-Spam-Level: X-Spam-Status: No, score=-100.011 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id EapsoboncTCi for ; Thu, 14 Dec 2017 00:46:25 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 9C53C5F39F for ; Thu, 14 Dec 2017 00:46:24 +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 643DBE0F55 for ; Thu, 14 Dec 2017 00:46:22 +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 D6D55212FC for ; Thu, 14 Dec 2017 00:46:19 +0000 (UTC) Date: Thu, 14 Dec 2017 00:46:19 +0000 (UTC) From: "Xiao Li (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SPARK-22771) SQL concat for binary MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 14 Dec 2017 00:46:27 -0000 [ https://issues.apache.org/jira/browse/SPARK-22771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16290160#comment-16290160 ] Xiao Li commented on SPARK-22771: --------------------------------- This looks reasonable. We should fix it. > SQL concat for binary > ---------------------- > > Key: SPARK-22771 > URL: https://issues.apache.org/jira/browse/SPARK-22771 > Project: Spark > Issue Type: Improvement > Components: SQL > Affects Versions: 2.2.1 > Reporter: Fernando Pereira > Priority: Minor > > spark.sql {{concat}} function automatically casts arguments to StringType and returns a String. > This might be the behavior of traditional databases, however in Spark there's Binary as a standard type, and concat'ing binary seems reasonable if it returns another binary sequence. > Taking the example of, e.g. Python where both {{bytes}} and {{unicode}} represent text, by concat'ing both we end up with the same type as the arguments, and in case they are intermixed (str + unicode) the most generic type is returned (unicode). > Following the same principle, I believe that when concat'ing binary it would make sense to return a binary. > In terms of Spark behavior, it would affect only the case when all arguments are binary. All other cases should remain unchanged. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org