From issues-return-97981-archive-asf-public=cust-asf.ponee.io@carbondata.apache.org Mon Nov 30 08:03:14 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 219A9180674 for ; Mon, 30 Nov 2020 09:03:14 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 92D5F64FE2 for ; Mon, 30 Nov 2020 08:03:13 +0000 (UTC) Received: (qmail 80473 invoked by uid 500); 30 Nov 2020 08:03:13 -0000 Mailing-List: contact issues-help@carbondata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.apache.org Delivered-To: mailing list issues@carbondata.apache.org Received: (qmail 80453 invoked by uid 99); 30 Nov 2020 08:03:12 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Nov 2020 08:03:12 +0000 From: =?utf-8?q?GitBox?= To: issues@carbondata.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bcarbondata=5D_Zhangshunyu_commented_on_a_change_in?= =?utf-8?q?_pull_request_=234020=3A_=5BCARBONDATA-4054=5D_Support_data_size_?= =?utf-8?q?control_for_minor_compaction?= Message-ID: <160672339286.15632.3684908642456844967.asfpy@gitbox.apache.org> Date: Mon, 30 Nov 2020 08:03:12 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: Zhangshunyu commented on a change in pull request #4020: URL: https://github.com/apache/carbondata/pull/4020#discussion_r532405803 ########## File path: integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala ########## @@ -292,6 +293,33 @@ object CommonUtil { } } + /** + * This method will validate the minor compaction size specified by the user + * the property is used while doing minor compaction + * + * @param tableProperties + */ + def validateMinorCompactionSize(tableProperties: Map[String, String]): Unit = { + var minorCompactionSize: Integer = 0 + val tblPropName = CarbonCommonConstants.TABLE_MINOR_COMPACTION_SIZE + if (tableProperties.get(tblPropName).isDefined) { + val minorCompactionSizeStr: String = + parsePropertyValueStringInMB(tableProperties(tblPropName)) + try { + minorCompactionSize = Integer.parseInt(minorCompactionSizeStr) + } catch { + case e: NumberFormatException => + throw new MalformedCarbonCommandException(s"Invalid $tblPropName value found: " + + s"$minorCompactionSizeStr, only int value greater than 0 is supported.") Review comment: @ajantha-bhat 0 is not supported, will add check ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org