Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2310#discussion_r188849650 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/DataMapUtil.java --- @@ -0,0 +1,132 @@ +/* + * 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.core.datamap; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.List; + +import org.apache.carbondata.common.logging.LogService; +import org.apache.carbondata.common.logging.LogServiceFactory; +import org.apache.carbondata.core.datamap.dev.expr.DataMapExprWrapper; +import org.apache.carbondata.core.indexstore.ExtendedBlocklet; +import org.apache.carbondata.core.indexstore.PartitionSpec; +import org.apache.carbondata.core.indexstore.blockletindex.BlockletDataMapFactory; +import org.apache.carbondata.core.metadata.schema.table.CarbonTable; +import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf; +import org.apache.carbondata.core.statusmanager.SegmentStatusManager; +import org.apache.carbondata.core.util.ObjectSerializationUtil; + +import org.apache.hadoop.conf.Configuration; + +public class DataMapUtil { + + private static final String DATA_MAP_DSTR = "mapreduce.input.carboninputformat.datamapdstr"; + + private static final LogService LOGGER = + LogServiceFactory.getLogService(DataMapUtil.class.getName()); + + /** + * This method set DataMapJob if configured + * + * @param conf + * @throws IOException + */ + public static void setDataMapJobIfConfigured(Configuration conf) throws IOException { + String className = "org.apache.carbondata.spark.rdd.SparkDataMapJob"; + setDataMapJob(conf, createDataMapJob(className)); + } + + /** + * Creates instance for the DataMap Job class + * + * @param className + * @return + */ + public static Object createDataMapJob(String className) { + try { + return Class.forName(className).getDeclaredConstructors()[0].newInstance(); + } catch (Exception e) { + LOGGER.error(e); + return null; + } + } + + public static void setDataMapJob(Configuration configuration, Object dataMapJob) + throws IOException { + if (dataMapJob != null) { + String toString = ObjectSerializationUtil.convertObjectToString(dataMapJob); + configuration.set(DATA_MAP_DSTR, toString); + } + } + + public static DataMapJob getDataMapJob(Configuration configuration) throws IOException { + String jobString = configuration.get(DATA_MAP_DSTR); + if (jobString != null) { + return (DataMapJob) ObjectSerializationUtil.convertStringToObject(jobString); + } + return null; + } + + public static void executeDataMapJobForClearingDataMaps(CarbonTable carbonTable) + throws IOException { + String dataMapJobClassName = "org.apache.carbondata.spark.rdd.SparkDataMapJob"; + DataMapJob dataMapJob = (DataMapJob) createDataMapJob(dataMapJobClassName); + String className = "org.apache.carbondata.core.datamap.DistributableDataMapFormat"; + SegmentStatusManager ssm = new SegmentStatusManager(carbonTable.getAbsoluteTableIdentifier()); + List<Segment> validSegments = ssm.getValidAndInvalidSegments().getValidSegments(); + DataMapExprWrapper dataMapExprWrapper = null; + if (DataMapStoreManager.getInstance().getAllDataMap(carbonTable).size() > 0) { + DataMapChooser dataMapChooser = new DataMapChooser(carbonTable); + dataMapExprWrapper = dataMapChooser.getAllDataMapsForClear(carbonTable); + } else { + return; + } + DistributableDataMapFormat dataMapFormat = --- End diff -- So won't it fai in line 100, if you don't do null check? --- |
In reply to this post by qiuchenjian-2
Github user akashrn5 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2310#discussion_r188869927 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/DataMapUtil.java --- @@ -0,0 +1,132 @@ +/* + * 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.core.datamap; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.List; + +import org.apache.carbondata.common.logging.LogService; +import org.apache.carbondata.common.logging.LogServiceFactory; +import org.apache.carbondata.core.datamap.dev.expr.DataMapExprWrapper; +import org.apache.carbondata.core.indexstore.ExtendedBlocklet; +import org.apache.carbondata.core.indexstore.PartitionSpec; +import org.apache.carbondata.core.indexstore.blockletindex.BlockletDataMapFactory; +import org.apache.carbondata.core.metadata.schema.table.CarbonTable; +import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf; +import org.apache.carbondata.core.statusmanager.SegmentStatusManager; +import org.apache.carbondata.core.util.ObjectSerializationUtil; + +import org.apache.hadoop.conf.Configuration; + +public class DataMapUtil { + + private static final String DATA_MAP_DSTR = "mapreduce.input.carboninputformat.datamapdstr"; + + private static final LogService LOGGER = + LogServiceFactory.getLogService(DataMapUtil.class.getName()); + + /** + * This method set DataMapJob if configured + * + * @param conf + * @throws IOException + */ + public static void setDataMapJobIfConfigured(Configuration conf) throws IOException { + String className = "org.apache.carbondata.spark.rdd.SparkDataMapJob"; + setDataMapJob(conf, createDataMapJob(className)); + } + + /** + * Creates instance for the DataMap Job class + * + * @param className + * @return + */ + public static Object createDataMapJob(String className) { + try { + return Class.forName(className).getDeclaredConstructors()[0].newInstance(); + } catch (Exception e) { + LOGGER.error(e); + return null; + } + } + + public static void setDataMapJob(Configuration configuration, Object dataMapJob) + throws IOException { + if (dataMapJob != null) { + String toString = ObjectSerializationUtil.convertObjectToString(dataMapJob); + configuration.set(DATA_MAP_DSTR, toString); + } + } + + public static DataMapJob getDataMapJob(Configuration configuration) throws IOException { + String jobString = configuration.get(DATA_MAP_DSTR); + if (jobString != null) { + return (DataMapJob) ObjectSerializationUtil.convertStringToObject(jobString); + } + return null; + } + + public static void executeDataMapJobForClearingDataMaps(CarbonTable carbonTable) + throws IOException { + String dataMapJobClassName = "org.apache.carbondata.spark.rdd.SparkDataMapJob"; + DataMapJob dataMapJob = (DataMapJob) createDataMapJob(dataMapJobClassName); + String className = "org.apache.carbondata.core.datamap.DistributableDataMapFormat"; + SegmentStatusManager ssm = new SegmentStatusManager(carbonTable.getAbsoluteTableIdentifier()); + List<Segment> validSegments = ssm.getValidAndInvalidSegments().getValidSegments(); + DataMapExprWrapper dataMapExprWrapper = null; + if (DataMapStoreManager.getInstance().getAllDataMap(carbonTable).size() > 0) { + DataMapChooser dataMapChooser = new DataMapChooser(carbonTable); + dataMapExprWrapper = dataMapChooser.getAllDataMapsForClear(carbonTable); + } else { + return; + } + DistributableDataMapFormat dataMapFormat = --- End diff -- no, if there are no datamaps present, it will return --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5932/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4777/ --- |
In reply to this post by qiuchenjian-2
Github user akashrn5 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2310#discussion_r188889978 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/DataMapUtil.java --- @@ -0,0 +1,132 @@ +/* + * 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.core.datamap; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.List; + +import org.apache.carbondata.common.logging.LogService; +import org.apache.carbondata.common.logging.LogServiceFactory; +import org.apache.carbondata.core.datamap.dev.expr.DataMapExprWrapper; +import org.apache.carbondata.core.indexstore.ExtendedBlocklet; +import org.apache.carbondata.core.indexstore.PartitionSpec; +import org.apache.carbondata.core.indexstore.blockletindex.BlockletDataMapFactory; +import org.apache.carbondata.core.metadata.schema.table.CarbonTable; +import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf; +import org.apache.carbondata.core.statusmanager.SegmentStatusManager; +import org.apache.carbondata.core.util.ObjectSerializationUtil; + +import org.apache.hadoop.conf.Configuration; + +public class DataMapUtil { + + private static final String DATA_MAP_DSTR = "mapreduce.input.carboninputformat.datamapdstr"; + + private static final LogService LOGGER = + LogServiceFactory.getLogService(DataMapUtil.class.getName()); + + /** + * This method set DataMapJob if configured + * + * @param conf + * @throws IOException + */ + public static void setDataMapJobIfConfigured(Configuration conf) throws IOException { + String className = "org.apache.carbondata.spark.rdd.SparkDataMapJob"; + setDataMapJob(conf, createDataMapJob(className)); + } + + /** + * Creates instance for the DataMap Job class + * + * @param className + * @return + */ + public static Object createDataMapJob(String className) { --- End diff -- this will be called from CarbonInputFormatUtil in function setDataMapJobIfConfigured, so we can keep it public --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2310 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4962/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5935/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4780/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5937/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4782/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2310 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4965/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5941/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2310 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4967/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4786/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2310 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4968/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4789/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2310 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5945/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2310 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4972/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2310 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4974/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2310 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4984/ --- |
Free forum by Nabble | Edit this page |