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 D398D200CD3 for ; Fri, 14 Jul 2017 06:19:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D219516D404; Fri, 14 Jul 2017 04:19:09 +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 2412B16D400 for ; Fri, 14 Jul 2017 06:19:08 +0200 (CEST) Received: (qmail 9084 invoked by uid 500); 14 Jul 2017 04:19:08 -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 9075 invoked by uid 99); 14 Jul 2017 04:19:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2017 04:19:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D25971A06BA for ; Fri, 14 Jul 2017 04:19:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 1I0LTQANYscy for ; Fri, 14 Jul 2017 04:19:06 +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 480555F24B for ; Fri, 14 Jul 2017 04:19:05 +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 92546E0069 for ; Fri, 14 Jul 2017 04:19:02 +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 E54C724711 for ; Fri, 14 Jul 2017 04:19:01 +0000 (UTC) Date: Fri, 14 Jul 2017 04:19:00 +0000 (UTC) From: "Hyukjin Kwon (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SPARK-21413) Multiple projections with CASE WHEN fails to execute generated codes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 14 Jul 2017 04:19:10 -0000 [ https://issues.apache.org/jira/browse/SPARK-21413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hyukjin Kwon updated SPARK-21413: --------------------------------- Summary: Multiple projections with CASE WHEN fails to execute generated codes (was: Multiple projections with CASE WHEN fails to generate codes) > Multiple projections with CASE WHEN fails to execute generated codes > -------------------------------------------------------------------- > > Key: SPARK-21413 > URL: https://issues.apache.org/jira/browse/SPARK-21413 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.3.0 > Reporter: Hyukjin Kwon > > Scala codes to reproduce > {code} > import org.apache.spark.sql.functions._ > import org.apache.spark.sql.types._ > import org.apache.spark.sql.Row > val schema = StructType(StructField("fieldA", IntegerType) :: Nil) > var df = spark.createDataFrame(spark.sparkContext.parallelize(Seq(Row(1))), schema) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df.show() > {code} > Note that, I could not reproduce this with local relation. > {code} > import org.apache.spark.sql.functions._ > var df = Seq(1).toDF("fieldA") > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df = df.withColumn("fieldA", when($"fieldA" === 0, null).otherwise($"fieldA")) > df.show() > {code} > Calling {{explain()}} on the dataframe in the former case shows a huge case-when projection and {{show()}} fails with the exception as below: > {code} > ... > Caused by: org.codehaus.janino.JaninoRuntimeException: Code of method "apply_0$(Lorg/apache/spark/sql/catalyst/expressions/GeneratedClass$SpecificUnsafeProjection;Lorg/apache/spark/sql/catalyst/InternalRow;)V" of class "org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection" grows beyond 64 KB > at org.codehaus.janino.CodeContext.makeSpace(CodeContext.java:949) > at org.codehaus.janino.CodeContext.write(CodeContext.java:839) > at org.codehaus.janino.UnitCompiler.writeOpcode(UnitCompiler.java:11081) > at org.codehaus.janino.UnitCompiler.pushConstant(UnitCompiler.java:9674) > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:4911) > at org.codehaus.janino.UnitCompiler.access$7700(UnitCompiler.java:206) > at org.codehaus.janino.UnitCompiler$12.visitIntegerLiteral(UnitCompiler.java:3776) > ... > {code} -- 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