carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kunal642 <...@git.apache.org>
Subject [GitHub] carbondata pull request #1420: [CARBONDATA-1596] Fixed IntermediateFileMerge...
Date Thu, 19 Oct 2017 09:23:01 GMT
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1420#discussion_r145643832
  
    --- Diff: processing/src/test/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMergerTest.java
---
    @@ -0,0 +1,104 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.carbondata.processing.sort.sortdata;
    +
    +import java.io.File;
    +import java.io.IOException;
    +import java.math.BigDecimal;
    +
    +import org.apache.carbondata.core.metadata.datatype.DataType;
    +import org.apache.carbondata.core.metadata.datatype.DataTypes;
    +import org.apache.carbondata.processing.sort.exception.CarbonSortKeyAndGroupByException;
    +
    +import mockit.Mock;
    +import mockit.MockUp;
    +import org.junit.AfterClass;
    +import org.junit.Assert;
    +import org.junit.BeforeClass;
    +import org.junit.Test;
    +
    +public class IntermediateFileMergerTest {
    +
    +  private static IntermediateFileMerger intermediateFileMerger;
    +  private static File file2;
    +  private static File file1;
    +  private static File outputFile;
    +
    +  @BeforeClass public static void setUp() {
    +    SortParameters sortParameters = new SortParameters();
    +    sortParameters.setMeasureColCount(1);
    +    sortParameters.setNoDictionaryDimnesionColumn(new boolean[] { false });
    +    sortParameters.setPrefetch(false);
    +    sortParameters.setSortFileCompressionEnabled(false);
    +    sortParameters.setFileWriteBufferSize(2);
    +    sortParameters.setMeasureDataType(new DataType[] { DataTypes.DECIMAL });
    --- End diff --
    
    yes. While merging the sort temp files the following code was throwing the error.
    (byte[]) NonDictionaryUtil.getMeasure(fieldIndex, row);
    The fix is to use the DataTypeUtil.bigDecimalToByte to convert bigDecimal value to byte[].


---

Mime
View raw message