From issues-return-26130-apmail-kylin-issues-archive=kylin.apache.org@kylin.apache.org Mon Apr 22 01:14:02 2019 Return-Path: X-Original-To: apmail-kylin-issues-archive@minotaur.apache.org Delivered-To: apmail-kylin-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 345F619F5A for ; Mon, 22 Apr 2019 01:14:02 +0000 (UTC) Received: (qmail 12708 invoked by uid 500); 22 Apr 2019 01:14:01 -0000 Delivered-To: apmail-kylin-issues-archive@kylin.apache.org Received: (qmail 12649 invoked by uid 500); 22 Apr 2019 01:14:01 -0000 Mailing-List: contact issues-help@kylin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.apache.org Delivered-To: mailing list issues@kylin.apache.org Received: (qmail 12640 invoked by uid 99); 22 Apr 2019 01:14:01 -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; Mon, 22 Apr 2019 01:14:01 +0000 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 7D18EE282F for ; Mon, 22 Apr 2019 01:14:00 +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 3A003256EB for ; Mon, 22 Apr 2019 01:14:00 +0000 (UTC) Date: Mon, 22 Apr 2019 01:14:00 +0000 (UTC) From: "Shaofeng SHI (JIRA)" To: issues@kylin.apache.org Message-ID: In-Reply-To: References: Subject: =?utf-8?Q?[jira]_[Commented]_(KYLIN-2849)_duplicate_segment=EF=BC=8Ccan?= =?utf-8?Q?not_be_deleted_and_data_cannot_be_refreshed_and_merged?= 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/KYLIN-2849?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1682= 2816#comment-16822816 ]=20 Shaofeng SHI commented on KYLIN-2849: ------------------------------------- [~hejian999] hejian, please open a new Jira with the necessary information,= like your REST request, the error trace in kylin.log, etc. Thanks! > duplicate segment=EF=BC=8Ccannot be deleted and data cannot be refreshed = and merged > -------------------------------------------------------------------------= -- > > Key: KYLIN-2849 > URL: https://issues.apache.org/jira/browse/KYLIN-2849 > Project: Kylin > Issue Type: Bug > Components: Job Engine, Metadata, REST Service > Affects Versions: v2.0.0 > Environment: hadoop=EF=BC=9Ahadoop-2.6.0-cdh5.8.2 > hive =EF=BC=9A2.1.0 > hbase=EF=BC=9A0.98 > Reporter: scott.zhai > Assignee: Dong Li > Priority: Major > Labels: scope > Fix For: v2.3.0 > > Attachments: kylin-1.png, kylin-2.png > > > cube duplicate segments=E3=80=82 > cannot be deleted and data cannot be refreshed and merged > {code} > try > curl -X DELETE "http://127.0.0.1:7070/kylin/api/cubes/Remain_Cube_2/segs/= 20170822000000_20170823000000" -H "Authorization: Basic QURNSU46S1lMSU4=3D= " -H "Content-Type: application/json;charset=3DUTF-8" > Cannot delete segment '20170822000000_20170823000000' as it is neither th= e first nor the last segment.","stacktrace":"org.apache.kylin.rest.exceptio= n.InternalErrorException: Cannot delete segment '20170822000000_20170823000= 000' as it is neither the first nor the last segment > {code} > =E6=9A=82=E6=97=B6=E8=A7=A3=E5=86=B3=E5=8A=9E=E6=B3=95=EF=BC=9A > {code} > public CubeInstance deleteSegment(CubeInstance cube, String segmentName) = throws IOException { > if (!segmentName.equals(cube.getSegments().get(0).getName()) && != segmentName.equals(cube.getSegments().get(cube.getSegments().size() - 1).ge= tName())) { > //throw new IllegalArgumentException("Cannot delete segment '= " + segmentName + "' as it is neither the first nor the last segment."); > } > CubeSegment toDelete =3D null; > for (CubeSegment seg : cube.getSegments()) { > if (seg.getName().equals(segmentName)) { > toDelete =3D seg; > } > } > if (toDelete =3D=3D null) { > throw new IllegalArgumentException("Cannot find segment '" + = segmentName + "'"); > } > if (toDelete.getStatus() !=3D SegmentStatusEnum.READY) { > //throw new IllegalArgumentException("Cannot delete segment '= " + segmentName + "' as its status is not READY. Discard the on-going job f= or it."); > } > CubeUpdate update =3D new CubeUpdate(cube); > update.setToRemoveSegs(new CubeSegment[] { toDelete }); > return CubeManager.getInstance(getConfig()).updateCube(update); > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)