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 E33D8200BA6 for ; Tue, 18 Oct 2016 17:33:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E19AE160AFB; Tue, 18 Oct 2016 15:33:59 +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 62C73160ACE for ; Tue, 18 Oct 2016 17:33:59 +0200 (CEST) Received: (qmail 47651 invoked by uid 500); 18 Oct 2016 15:33:58 -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 47615 invoked by uid 99); 18 Oct 2016 15:33:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Oct 2016 15:33:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 67D3A2C4C78 for ; Tue, 18 Oct 2016 15:33:58 +0000 (UTC) Date: Tue, 18 Oct 2016 15:33:58 +0000 (UTC) From: "Hyukjin Kwon (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (SPARK-17989) Check ascendingOrder type in sort_array function ahead MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 18 Oct 2016 15:34:00 -0000 Hyukjin Kwon created SPARK-17989: ------------------------------------ Summary: Check ascendingOrder type in sort_array function ahead Key: SPARK-17989 URL: https://issues.apache.org/jira/browse/SPARK-17989 Project: Spark Issue Type: Bug Components: SQL Reporter: Hyukjin Kwon Priority: Trivial {code} spark-sql> SELECT sort_array(array('b', 'd', 'c', 'a'), '1'); 16/10/19 00:28:54 ERROR SparkSQLDriver: Failed in [SELECT sort_array(array('b', 'd', 'c', 'a'), '1')] java.lang.ClassCastException: org.apache.spark.unsafe.types.UTF8String cannot be cast to java.lang.Boolean at scala.runtime.BoxesRunTime.unboxToBoolean(BoxesRunTime.java:85) at org.apache.spark.sql.catalyst.expressions.SortArray.nullSafeEval(collectionOperations.scala:185) at org.apache.spark.sql.catalyst.expressions.BinaryExpression.eval(Expression.scala:416) at org.apache.spark.sql.catalyst.optimizer.ConstantFolding$$anonfun$apply$1$$anonfun$applyOrElse$1.applyOrElse(expressions.scala:50) at org.apache.spark.sql.catalyst.optimizer.ConstantFolding$$anonfun$apply$1$$anonfun$applyOrElse$1.applyOrElse(expressions.scala:43) {code} I guess we should also check this in `checkInputDataTypes`. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org