From commits-return-13342-archive-asf-public=cust-asf.ponee.io@hudi.apache.org Fri Mar 13 16:33:04 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 71525180665 for ; Fri, 13 Mar 2020 17:33:04 +0100 (CET) Received: (qmail 16932 invoked by uid 500); 13 Mar 2020 16:33:02 -0000 Mailing-List: contact commits-help@hudi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hudi.apache.org Delivered-To: mailing list commits@hudi.apache.org Received: (qmail 16881 invoked by uid 99); 13 Mar 2020 16:33:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2020 16:33:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4FCBDE2ED7 for ; Fri, 13 Mar 2020 16:33:02 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id BAB6E78231E for ; Fri, 13 Mar 2020 16:33:00 +0000 (UTC) Date: Fri, 13 Mar 2020 16:33:00 +0000 (UTC) From: "sivabalan narayanan (Jira)" To: commits@hudi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HUDI-667) HoodieTestDataGenerator does not delete keys correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HUDI-667?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] sivabalan narayanan resolved HUDI-667. -------------------------------------- Fix Version/s: 0.6.0 Resolution: Fixed > HoodieTestDataGenerator does not delete keys correctly > ------------------------------------------------------ > > Key: HUDI-667 > URL: https://issues.apache.org/jira/browse/HUDI-667 > Project: Apache Hudi (incubating) > Issue Type: Bug > Reporter: Prashant Wason > Assignee: sivabalan narayanan > Priority: Minor > Labels: pull-request-available > Fix For: 0.6.0 > > Original Estimate: 1h > Time Spent: 20m > Remaining Estimate: 40m > > HoodieTestDataGenerator is used to generate sample data for unit-tests. I= t allows generating HoodieRecords for insert/update/delete. It maintains th= e record keys in a HashMap. > private final Map existingKeys; > There are two issues in the implementation: > # Delete from existingKeys uses KeyPartition rather than Integer keys > # Inserting records after deletes is not correctly handled > The implementation uses the Integer key so that values can be looked up r= andomly. Assume three values were inserted, then the HashMap will hold: > 0 -> KeyPartition1 > 1 -> KeyPartition2 > 2 -> KeyPartition3 > Now if we delete KeyPartition2=C2=A0 (generate a random record for deleti= on), the HashMap will be: > 0 -> KeyPartition1 > 2 -> KeyPartition3 > =C2=A0 > Now if we issue a insertBatch() then the insert is=C2=A0existingKeys.put(= existingKeys.size(), KeyPartition3) which will overwrite the KeyPartition3 = already in the map rather than actually inserting a new entry in the map. -- This message was sent by Atlassian Jira (v8.3.4#803005)