You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by ramandeep30 <gi...@git.apache.org> on 2017/06/07 11:54:29 UTC

[GitHub] carbondata pull request #1005: [CARBONDATA-1139] Added testcases for CarbonH...

GitHub user ramandeep30 opened a pull request:

    https://github.com/apache/carbondata/pull/1005

    [CARBONDATA-1139] Added testcases for CarbonHiveRecordReader

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ramandeep30/incubator-carbondata CARBONDATA-1139

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/1005.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1005
    
----
commit 8238c20e824037c03ded7fb2bdbd5baa46a67775
Author: raman <ra...@knoldus.in>
Date:   2017-06-07T11:29:34Z

    Added testcases for CarbonHiveRecordReader

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #1005: [CARBONDATA-1139] Added testcases for CarbonH...

Posted by cenyuhai <gi...@git.apache.org>.
Github user cenyuhai commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1005#discussion_r132841087
  
    --- Diff: integration/hive/src/test/java/org/apache/carbondata/hive/TestCarbonHiveRecordReader.java ---
    @@ -0,0 +1,687 @@
    +/*
    + * 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.hive;
    +
    +import mockit.Mock;
    +import mockit.MockUp;
    +import org.apache.carbondata.core.datastore.DataRefNode;
    +import org.apache.carbondata.core.datastore.IndexKey;
    +import org.apache.carbondata.core.datastore.block.BlockIndex;
    +import org.apache.carbondata.core.datastore.block.SegmentProperties;
    +import org.apache.carbondata.core.datastore.block.TableBlockInfo;
    +import org.apache.carbondata.core.datastore.impl.btree.BTreeDataRefNodeFinder;
    +import org.apache.carbondata.core.datastore.impl.btree.BTreeNonLeafNode;
    +import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier;
    +import org.apache.carbondata.core.metadata.CarbonTableIdentifier;
    +import org.apache.carbondata.core.metadata.ColumnarFormatVersion;
    +import org.apache.carbondata.core.metadata.blocklet.DataFileFooter;
    +import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
    +import org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension;
    +import org.apache.carbondata.core.metadata.schema.table.column.ColumnSchema;
    +import org.apache.carbondata.core.reader.CarbonFooterReaderV3;
    +import org.apache.carbondata.core.reader.CarbonHeaderReader;
    +import org.apache.carbondata.core.reader.ThriftReader;
    +import org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo;
    +import org.apache.carbondata.core.scan.executor.util.QueryUtil;
    +import org.apache.carbondata.core.scan.model.QueryModel;
    +import org.apache.carbondata.core.scan.processor.impl.DataBlockIteratorImpl;
    +import org.apache.carbondata.core.util.CarbonUtil;
    +import org.apache.carbondata.core.util.DataFileFooterConverterV3;
    +import org.apache.carbondata.core.util.path.CarbonStorePath;
    +import org.apache.carbondata.core.util.path.CarbonTablePath;
    +import org.apache.carbondata.format.FileFooter3;
    +import org.apache.carbondata.format.FileHeader;
    +import org.apache.carbondata.hadoop.readsupport.CarbonReadSupport;
    +import org.apache.carbondata.hadoop.readsupport.impl.DictionaryDecodeReadSupport;
    +import org.apache.hadoop.hive.common.type.HiveDecimal;
    +import org.apache.hadoop.hive.conf.HiveConf;
    +import org.apache.hadoop.hive.serde.serdeConstants;
    +import org.apache.hadoop.hive.serde2.io.DateWritable;
    +import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
    +import org.apache.hadoop.hive.serde2.io.TimestampWritable;
    +import org.apache.hadoop.io.*;
    +import org.apache.hadoop.mapred.InputSplit;
    +import org.apache.hadoop.mapred.JobConf;
    +import org.apache.spark.sql.types.Decimal;
    +import org.junit.BeforeClass;
    +import org.junit.Test;
    +
    +import java.io.IOException;
    +import java.lang.reflect.Field;
    +import java.sql.Date;
    +import java.sql.Timestamp;
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import static org.junit.Assert.*;
    +
    +public class TestCarbonHiveRecordReader {
    +
    +    private static CarbonHiveRecordReader carbonHiveRecordReader;
    +    private static QueryModel queryModel;
    +    private static CarbonReadSupport carbonReadSupport;
    +    private static InputSplit inputSplit;
    +    private static JobConf jobConf;
    +    private static HiveConf configuration;
    +    private static CarbonStorePath path;
    +    private static String[] locations;
    +    private static ColumnarFormatVersion version;
    +    private static CarbonTableIdentifier carbonTableIdentifier;
    +    private static Void avoid;
    +
    +    @BeforeClass
    +    public static void setUp() throws IOException {
    +        carbonTableIdentifier = new CarbonTableIdentifier("Default", "Sample", "t1");
    +        queryModel = new QueryModel();
    +        carbonReadSupport = new DictionaryDecodeReadSupport();
    +        inputSplit = new CarbonHiveInputSplit();
    +        jobConf = new JobConf();
    +        configuration = new HiveConf();
    +        path = new CarbonStorePath("CarbonStorePath");
    +        locations = new String[]{"location1, location2, location3"};
    +        version = ColumnarFormatVersion.V3;
    +        jobConf.set("hive.io.file.readcolumn.ids", "0,1");
    +        jobConf.set("hive.io.file.readcolumn.names", "id,name");
    +        jobConf.set(serdeConstants.LIST_COLUMN_TYPES, "int,string");
    +
    +        new MockUp<CarbonTablePath.DataFileUtil>() {
    +            @Mock
    +            public String getTaskNo(String carbonDataFileName) {
    +                return "CarbondataFileName";
    +            }
    +
    +        };
    +
    +        new MockUp<QueryModel>() {
    --- End diff --
    
    why just new a object ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #1005: [CARBONDATA-1139] Added testcases for CarbonH...

Posted by cenyuhai <gi...@git.apache.org>.
Github user cenyuhai commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1005#discussion_r132841101
  
    --- Diff: integration/hive/src/test/java/org/apache/carbondata/hive/TestCarbonHiveRecordReader.java ---
    @@ -0,0 +1,687 @@
    +/*
    + * 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.hive;
    +
    +import mockit.Mock;
    +import mockit.MockUp;
    +import org.apache.carbondata.core.datastore.DataRefNode;
    +import org.apache.carbondata.core.datastore.IndexKey;
    +import org.apache.carbondata.core.datastore.block.BlockIndex;
    +import org.apache.carbondata.core.datastore.block.SegmentProperties;
    +import org.apache.carbondata.core.datastore.block.TableBlockInfo;
    +import org.apache.carbondata.core.datastore.impl.btree.BTreeDataRefNodeFinder;
    +import org.apache.carbondata.core.datastore.impl.btree.BTreeNonLeafNode;
    +import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier;
    +import org.apache.carbondata.core.metadata.CarbonTableIdentifier;
    +import org.apache.carbondata.core.metadata.ColumnarFormatVersion;
    +import org.apache.carbondata.core.metadata.blocklet.DataFileFooter;
    +import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
    +import org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension;
    +import org.apache.carbondata.core.metadata.schema.table.column.ColumnSchema;
    +import org.apache.carbondata.core.reader.CarbonFooterReaderV3;
    +import org.apache.carbondata.core.reader.CarbonHeaderReader;
    +import org.apache.carbondata.core.reader.ThriftReader;
    +import org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo;
    +import org.apache.carbondata.core.scan.executor.util.QueryUtil;
    +import org.apache.carbondata.core.scan.model.QueryModel;
    +import org.apache.carbondata.core.scan.processor.impl.DataBlockIteratorImpl;
    +import org.apache.carbondata.core.util.CarbonUtil;
    +import org.apache.carbondata.core.util.DataFileFooterConverterV3;
    +import org.apache.carbondata.core.util.path.CarbonStorePath;
    +import org.apache.carbondata.core.util.path.CarbonTablePath;
    +import org.apache.carbondata.format.FileFooter3;
    +import org.apache.carbondata.format.FileHeader;
    +import org.apache.carbondata.hadoop.readsupport.CarbonReadSupport;
    +import org.apache.carbondata.hadoop.readsupport.impl.DictionaryDecodeReadSupport;
    +import org.apache.hadoop.hive.common.type.HiveDecimal;
    +import org.apache.hadoop.hive.conf.HiveConf;
    +import org.apache.hadoop.hive.serde.serdeConstants;
    +import org.apache.hadoop.hive.serde2.io.DateWritable;
    +import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
    +import org.apache.hadoop.hive.serde2.io.TimestampWritable;
    +import org.apache.hadoop.io.*;
    +import org.apache.hadoop.mapred.InputSplit;
    +import org.apache.hadoop.mapred.JobConf;
    +import org.apache.spark.sql.types.Decimal;
    +import org.junit.BeforeClass;
    +import org.junit.Test;
    +
    +import java.io.IOException;
    +import java.lang.reflect.Field;
    +import java.sql.Date;
    +import java.sql.Timestamp;
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import static org.junit.Assert.*;
    +
    +public class TestCarbonHiveRecordReader {
    +
    +    private static CarbonHiveRecordReader carbonHiveRecordReader;
    +    private static QueryModel queryModel;
    +    private static CarbonReadSupport carbonReadSupport;
    +    private static InputSplit inputSplit;
    +    private static JobConf jobConf;
    +    private static HiveConf configuration;
    +    private static CarbonStorePath path;
    +    private static String[] locations;
    +    private static ColumnarFormatVersion version;
    +    private static CarbonTableIdentifier carbonTableIdentifier;
    +    private static Void avoid;
    +
    +    @BeforeClass
    +    public static void setUp() throws IOException {
    +        carbonTableIdentifier = new CarbonTableIdentifier("Default", "Sample", "t1");
    +        queryModel = new QueryModel();
    +        carbonReadSupport = new DictionaryDecodeReadSupport();
    +        inputSplit = new CarbonHiveInputSplit();
    +        jobConf = new JobConf();
    +        configuration = new HiveConf();
    +        path = new CarbonStorePath("CarbonStorePath");
    +        locations = new String[]{"location1, location2, location3"};
    +        version = ColumnarFormatVersion.V3;
    +        jobConf.set("hive.io.file.readcolumn.ids", "0,1");
    +        jobConf.set("hive.io.file.readcolumn.names", "id,name");
    +        jobConf.set(serdeConstants.LIST_COLUMN_TYPES, "int,string");
    +
    +        new MockUp<CarbonTablePath.DataFileUtil>() {
    +            @Mock
    +            public String getTaskNo(String carbonDataFileName) {
    +                return "CarbondataFileName";
    +            }
    +
    +        };
    +
    +        new MockUp<QueryModel>() {
    +            @Mock
    +            public AbsoluteTableIdentifier getAbsoluteTableIdentifier() {
    +                CarbonTableIdentifier carbonTableIdentifier = new CarbonTableIdentifier("db", "mytable", "id");
    +                return new AbsoluteTableIdentifier("", carbonTableIdentifier);
    +            }
    +
    +            //new MockUp<QueryModel>() {
    --- End diff --
    
    please remove unused code


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #1005: [CARBONDATA-1139] Added testcases for CarbonHiveReco...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1005
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2268/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #1005: [CARBONDATA-1139] Added testcases for CarbonHiveReco...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/1005
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #1005: [CARBONDATA-1139] Added testcases for CarbonHiveReco...

Posted by cenyuhai <gi...@git.apache.org>.
Github user cenyuhai commented on the issue:

    https://github.com/apache/carbondata/pull/1005
  
    Is Shivangi and anubhav100  your colleagues?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata pull request #1005: [CARBONDATA-1139] Added testcases for CarbonH...

Posted by ramandeep30 <gi...@git.apache.org>.
Github user ramandeep30 closed the pull request at:

    https://github.com/apache/carbondata/pull/1005


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] carbondata issue #1005: [CARBONDATA-1139] Added testcases for CarbonHiveReco...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/1005
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/carbondata-pr-spark-1.6/141/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---