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 7DC8020049D for ; Wed, 9 Aug 2017 22:41:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7C2E9161110; Wed, 9 Aug 2017 20:41:05 +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 C333D16A0F7 for ; Wed, 9 Aug 2017 22:41:04 +0200 (CEST) Received: (qmail 59552 invoked by uid 500); 9 Aug 2017 20:41:04 -0000 Mailing-List: contact issues-help@systemml.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@systemml.apache.org Delivered-To: mailing list issues@systemml.apache.org Received: (qmail 59543 invoked by uid 99); 9 Aug 2017 20:41:04 -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; Wed, 09 Aug 2017 20:41:04 +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 8B4ED1A0BF1 for ; Wed, 9 Aug 2017 20:41:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 1A1tbFTMZ-sw for ; Wed, 9 Aug 2017 20:41:02 +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 234AE5FE21 for ; Wed, 9 Aug 2017 20:41:02 +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 9643CE0E66 for ; Wed, 9 Aug 2017 20:41:01 +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 D8D6524181 for ; Wed, 9 Aug 2017 20:41:00 +0000 (UTC) Date: Wed, 9 Aug 2017 20:41:00 +0000 (UTC) From: "Matthias Boehm (JIRA)" To: issues@systemml.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (SYSTEMML-1822) java.lang.ArrayStoreException with for-loop inside UDF MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 09 Aug 2017 20:41:05 -0000 [ https://issues.apache.org/jira/browse/SYSTEMML-1822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias Boehm closed SYSTEMML-1822. ------------------------------------ > java.lang.ArrayStoreException with for-loop inside UDF > ------------------------------------------------------ > > Key: SYSTEMML-1822 > URL: https://issues.apache.org/jira/browse/SYSTEMML-1822 > Project: SystemML > Issue Type: Bug > Reporter: Gus Jenkins > Assignee: Matthias Boehm > Fix For: SystemML 1.0 > > > Hey I'm working on something and came upon a bug. I boiled the problem down to the following. If I run the following code, it works fine. But if I run the latter code with a simple for-loop in the UDF, I get an error. This actually may be the same case with any loop. Please see below. I also included the error message. > {code} > discrete_samples = function(matrix[double] weights) return(double ix){ > ix = 0.00 > } > weights = matrix(1, rows = 5, cols = 1) > ix = discrete_samples(weights) > print("Index here: " + ix) > {code} > {code} > discrete_samples = function(matrix[double] weights) return(double ix){ > ix = 0.00 > for(j in 1:5){ > print("Hello") > } > } > weights = matrix(1, rows = 5, cols = 1) > ix = discrete_samples(weights) > print("Index here: " + ix) > {code} > {code} > stcs-mbp:spark-2.1.1-bin-hadoop2.7 stc$ spark-submit SystemML.jar -f /Users/stc/Desktop/systemml/scripts/algorithms/test.dml > log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell). > log4j:WARN Please initialize the log4j system properly. > log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. > Exception in thread "main" org.apache.sysml.api.DMLException: java.lang.ArrayStoreException: java.lang.Integer > at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:533) > at org.apache.sysml.api.DMLScript.main(DMLScript.java:233) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:743) > at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:187) > at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:212) > at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:126) > at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) > Caused by: java.lang.ArrayStoreException: java.lang.Integer > at java.util.AbstractCollection.toArray(AbstractCollection.java:196) > at org.apache.sysml.hops.ipa.FunctionCallSizeInfo.toString(FunctionCallSizeInfo.java:306) > at java.lang.String.valueOf(String.java:2994) > at java.lang.StringBuilder.append(StringBuilder.java:131) > at org.apache.sysml.hops.ipa.InterProceduralAnalysis.analyzeProgram(InterProceduralAnalysis.java:181) > at org.apache.sysml.parser.DMLTranslator.rewriteHopsDAG(DMLTranslator.java:269) > at org.apache.sysml.api.DMLScript.execute(DMLScript.java:761) > at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:506) > ... 10 more > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)