Return-Path: X-Original-To: apmail-spark-dev-archive@minotaur.apache.org Delivered-To: apmail-spark-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2A1B17277 for ; Sat, 27 Sep 2014 03:09:00 +0000 (UTC) Received: (qmail 79895 invoked by uid 500); 27 Sep 2014 03:08:59 -0000 Delivered-To: apmail-spark-dev-archive@spark.apache.org Received: (qmail 79787 invoked by uid 500); 27 Sep 2014 03:08:59 -0000 Mailing-List: contact dev-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@spark.apache.org Received: (qmail 78768 invoked by uid 99); 27 Sep 2014 03:08:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Sep 2014 03:08:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lian.cs.zju@gmail.com designates 209.85.192.170 as permitted sender) Received: from [209.85.192.170] (HELO mail-pd0-f170.google.com) (209.85.192.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Sep 2014 03:08:31 +0000 Received: by mail-pd0-f170.google.com with SMTP id y13so13805972pdi.15 for ; Fri, 26 Sep 2014 20:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=kAVpxWx6oC+5aQ4iQjTSZc6P5ARrUS4rRMAOGPy2WYU=; b=j5WNK8V7BRA4BcBko5Koh3Z7vwrC1PzmHlhZObd4sihxq3QOxDJ5rMNEJ3stfZptLg EcOi95jZsXsk+MS/me9AR1cKem7iy3GUQXEhu1TtyZGpz0eiVc+p4JXnhyaMvq6w5Yf5 DohEn5qfncxpE5qlA5BEJWqLzhlYSkAwjQQaffUHOyoC+ZqNrSAQU+KSJsFbCjGrTgb3 7Y82KESuVQ013sN4NgzS0IF/l9CWzyiNsJnzXtviZR3Bbu7WF/qG0EYECPmKFCK8wY2n gLILD9H4gPdnDL6C3j+aqEyrR7rt2Cfqa5av7a5SYYhhvJD0ncTaluTtCjwTXWzA48Gb DFGw== X-Received: by 10.69.18.139 with SMTP id gm11mr25513300pbd.94.1411787309832; Fri, 26 Sep 2014 20:08:29 -0700 (PDT) Received: from lian-laptop.local ([116.251.221.75]) by mx.google.com with ESMTPSA id x3sm6170702pdp.53.2014.09.26.20.08.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2014 20:08:28 -0700 (PDT) Message-ID: <54262A28.3090504@gmail.com> Date: Sat, 27 Sep 2014 11:08:24 +0800 From: Cheng Lian User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Du Li , "dev@spark.apache.org" CC: "user@spark.apache.org" Subject: Re: SparkSQL: map type MatchError when inserting into Hive table References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Would you mind to provide the DDL of this partitioned table together with the query you tried? The stacktrace suggests that the query was trying to cast a map into something else, which is not supported in Spark SQL. And I doubt whether Hive support casting a complex type to some other type. On 9/27/14 7:48 AM, Du Li wrote: > Hi, > > I was loading data into a partitioned table on Spark 1.1.0 > beeline-thriftserver. The table has complex data types such as map string> and array>. The query is like �insert overwrite > table a partition (�) select �� and the select clause worked if run > separately. However, when running the insert query, there was an error as > follows. > > The source code of Cast.scala seems to only handle the primitive data > types, which is perhaps why the MatchError was thrown. > > I just wonder if this is still work in progress, or I should do it > differently. > > Thanks, > Du > > > ---- > scala.MatchError: MapType(StringType,StringType,true) (of class > org.apache.spark.sql.catalyst.types.MapType) > > org.apache.spark.sql.catalyst.expressions.Cast.cast$lzycompute(Cast.scala:2 > 47) > org.apache.spark.sql.catalyst.expressions.Cast.cast(Cast.scala:247) > org.apache.spark.sql.catalyst.expressions.Cast.eval(Cast.scala:263) > > org.apache.spark.sql.catalyst.expressions.Alias.eval(namedExpressions.scala > :84) > > org.apache.spark.sql.catalyst.expressions.InterpretedMutableProjection.appl > y(Projection.scala:66) > > org.apache.spark.sql.catalyst.expressions.InterpretedMutableProjection.appl > y(Projection.scala:50) > scala.collection.Iterator$$anon$11.next(Iterator.scala:328) > scala.collection.Iterator$$anon$11.next(Iterator.scala:328) > > org.apache.spark.sql.hive.execution.InsertIntoHiveTable.org$apache$spark$sq > l$hive$execution$InsertIntoHiveTable$$writeToFile$1(InsertIntoHiveTable.sca > la:149) > > org.apache.spark.sql.hive.execution.InsertIntoHiveTable$$anonfun$saveAsHive > File$1.apply(InsertIntoHiveTable.scala:158) > > org.apache.spark.sql.hive.execution.InsertIntoHiveTable$$anonfun$saveAsHive > File$1.apply(InsertIntoHiveTable.scala:158) > org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:62) > org.apache.spark.scheduler.Task.run(Task.scala:54) > > org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:177) > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1 > 145) > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: > 615) > java.lang.Thread.run(Thread.java:722) > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@spark.apache.org > For additional commands, e-mail: user-help@spark.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org For additional commands, e-mail: dev-help@spark.apache.org