From issues-return-181665-archive-asf-public=cust-asf.ponee.io@spark.apache.org Mon Jan 15 11:50:06 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id A53B7180657 for ; Mon, 15 Jan 2018 11:50:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 95133160C45; Mon, 15 Jan 2018 10:50:06 +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 DBBCB160C25 for ; Mon, 15 Jan 2018 11:50:05 +0100 (CET) Received: (qmail 89881 invoked by uid 500); 15 Jan 2018 10:50:05 -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 89868 invoked by uid 99); 15 Jan 2018 10:50:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jan 2018 10:50:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8038218070D for ; Mon, 15 Jan 2018 10:50:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -108.711 X-Spam-Level: X-Spam-Status: No, score=-108.711 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id SUkizL-iQUGI for ; Mon, 15 Jan 2018 10:50:03 +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 908845F2FD for ; Mon, 15 Jan 2018 10:50:03 +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 1D361E095C for ; Mon, 15 Jan 2018 10:50:03 +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 59F3D21304 for ; Mon, 15 Jan 2018 10:50:00 +0000 (UTC) Date: Mon, 15 Jan 2018 10:50:00 +0000 (UTC) From: "zhoukang (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (SPARK-23076) When we call cache() on ShuffleRowRDD, we will get an error result MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 zhoukang created SPARK-23076: -------------------------------- Summary: When we call cache() on ShuffleRowRDD, we will get an error result Key: SPARK-23076 URL: https://issues.apache.org/jira/browse/SPARK-23076 Project: Spark Issue Type: Bug Components: SQL Affects Versions: 2.1.0 Reporter: zhoukang For query below: {code:java} select * from csv_demo limit 3; {code} The correct result should be: 0: jdbc:hive2://10.108.230.228:10000/> select * from csv_demo limit 3; +----------+------+--+ | _c0 | _c1 | +----------+------+--+ | Joe | 20 | | Tom | 30 | | Hyukjin | 25 | +----------+------+--+ However,when we call cache on ShuffleRowRDD(or RDD which depends on ShuffleRowRDD in one stage): Then result will be error: 0: jdbc:hive2://xxx/> select * from csv_demo limit 3; +----------+------+--+ | _c0 | _c1 | +----------+------+--+ | Hyukjin | 25 | | Hyukjin | 25 | | Hyukjin | 25 | +----------+------+--+ The reason why this happen is that: UnsafeRow which generated by ShuffleRowRDD#compute will use the same under byte buffer I print some log below to explain this: Modify UnsafeRow.toString() {code:java} // This is for debugging @Override public String toString() { StringBuilder build = new StringBuilder("["); for (int i = 0; i < sizeInBytes; i += 8) { if (i != 0) build.append(','); build.append(java.lang.Long.toHexString(Platform.getLong(baseObject, baseOffset + i))); } build.append(","+baseObject+","+baseOffset+']'); // Print baseObject and baseOffset here return build.toString(); }{code} 2018-01-12,22:08:47,441 INFO org.apache.spark.sql.execution.ShuffledRowRDD: Read value: [0,1800000003,2000000002,656f4a,3032,[B@6225ec90,16] 2018-01-12,22:08:47,445 INFO org.apache.spark.sql.execution.ShuffledRowRDD: Read value: [0,1800000003,2000000002,6d6f54,3033,[B@6225ec90,16] 2018-01-12,22:08:47,448 INFO org.apache.spark.sql.execution.ShuffledRowRDD: Read value: [0,1800000007,2000000002,6e696a6b757948,3532,[B@6225ec90,16] -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org