From commits-return-12725-archive-asf-public=cust-asf.ponee.io@hudi.apache.org Sat Mar 7 03:08:32 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 A1BD218067E for ; Sat, 7 Mar 2020 04:08:32 +0100 (CET) Received: (qmail 89697 invoked by uid 500); 7 Mar 2020 03:08:20 -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 86780 invoked by uid 99); 7 Mar 2020 03:08:11 -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; Sat, 07 Mar 2020 03:08:11 +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 DD02DE3149 for ; Sat, 7 Mar 2020 03:08:10 +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 8E49E7825D1 for ; Fri, 6 Mar 2020 19:49:00 +0000 (UTC) Date: Fri, 6 Mar 2020 19:49:00 +0000 (UTC) From: "Prashant Wason (Jira)" To: commits@hudi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (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 Prashant Wason created HUDI-667: ----------------------------------- Summary: HoodieTestDataGenerator does not delete keys correctl= y Key: HUDI-667 URL: https://issues.apache.org/jira/browse/HUDI-667 Project: Apache Hudi (incubating) Issue Type: Bug Reporter: Prashant Wason HoodieTestDataGenerator is used to generate sample data for unit-tests. It = allows generating HoodieRecords for insert/update/delete. It maintains the = 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 ran= domly. 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 deletion= ), the HashMap will be: 0 -> KeyPartition1 2 -> KeyPartition3 =C2=A0 Now if we issue a insertBatch() then the insert is=C2=A0existingKeys.put(ex= istingKeys.size(), KeyPartition3) which will overwrite the KeyPartition3 al= ready in the map rather than actually inserting a new entry in the map. -- This message was sent by Atlassian Jira (v8.3.4#803005)