Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2254#discussion_r185489157 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/dev/DataMapFactory.java --- @@ -27,74 +29,124 @@ import org.apache.carbondata.core.features.TableOperation; import org.apache.carbondata.core.metadata.schema.table.CarbonTable; import org.apache.carbondata.core.metadata.schema.table.DataMapSchema; +import org.apache.carbondata.core.metadata.schema.table.column.CarbonColumn; import org.apache.carbondata.events.Event; +import org.apache.commons.lang.StringUtils; + /** - * Interface for datamap factory, it is responsible for creating the datamap. + * Interface for datamap of index type, it is responsible for creating the datamap. */ -public interface DataMapFactory<T extends DataMap> { +public abstract class DataMapFactory<T extends DataMap> { + + public static final String INDEX_COLUMNS = "INDEX_COLUMNS"; + protected CarbonTable carbonTable; + + public DataMapFactory(CarbonTable carbonTable) { + this.carbonTable = carbonTable; + } /** * Initialization of Datamap factory with the carbonTable and datamap name */ - void init(CarbonTable carbonTable, DataMapSchema dataMapSchema) + public abstract void init(DataMapSchema dataMapSchema) throws IOException, MalformedDataMapCommandException; /** * Return a new write for this datamap */ - DataMapWriter createWriter(Segment segment, String writeDirectoryPath); + public abstract DataMapWriter createWriter(Segment segment, String shardName) + throws IOException; + + public abstract DataMapRefresher createRefresher(Segment segment, String shardName) + throws IOException; /** * Get the datamap for segmentid */ - List<T> getDataMaps(Segment segment) throws IOException; + public abstract List<T> getDataMaps(Segment segment) throws IOException; /** * Get datamaps for distributable object. */ - List<T> getDataMaps(DataMapDistributable distributable) + public abstract List<T> getDataMaps(DataMapDistributable distributable) throws IOException; /** * Get all distributable objects of a segmentid * @return */ - List<DataMapDistributable> toDistributable(Segment segment); + public abstract List<DataMapDistributable> toDistributable(Segment segment); /** * * @param event */ - void fireEvent(Event event); + public abstract void fireEvent(Event event); /** * Clears datamap of the segment */ - void clear(Segment segment); + public abstract void clear(Segment segment); /** * Clear all datamaps from memory */ - void clear(); + public abstract void clear(); /** * Return metadata of this datamap */ - DataMapMeta getMeta(); + public abstract DataMapMeta getMeta(); /** * Type of datamap whether it is FG or CG */ - DataMapLevel getDataMapType(); + public abstract DataMapLevel getDataMapLevel(); /** * delete datamap data if any */ - void deleteDatamapData(); + public abstract void deleteDatamapData(); /** * This function should return true is the input operation enum will make the datamap become stale */ - boolean willBecomeStale(TableOperation operation); + public abstract boolean willBecomeStale(TableOperation operation); + + /** + * Validate INDEX_COLUMNS property and return a array containing index column name + * Following will be validated + * 1. require INDEX_COLUMNS property + * 2. INDEX_COLUMNS can't contains illegal argument(empty, blank) + * 3. INDEX_COLUMNS can't contains duplicate same columns + * 4. INDEX_COLUMNS should be exists in table columns + */ + public void validateIndexedColumns(DataMapSchema dataMapSchema, --- End diff -- ok, fixed --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2254#discussion_r185490216 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/dev/DataMapFactory.java --- @@ -27,74 +29,124 @@ import org.apache.carbondata.core.features.TableOperation; import org.apache.carbondata.core.metadata.schema.table.CarbonTable; import org.apache.carbondata.core.metadata.schema.table.DataMapSchema; +import org.apache.carbondata.core.metadata.schema.table.column.CarbonColumn; import org.apache.carbondata.events.Event; +import org.apache.commons.lang.StringUtils; + /** - * Interface for datamap factory, it is responsible for creating the datamap. + * Interface for datamap of index type, it is responsible for creating the datamap. */ -public interface DataMapFactory<T extends DataMap> { +public abstract class DataMapFactory<T extends DataMap> { + + public static final String INDEX_COLUMNS = "INDEX_COLUMNS"; + protected CarbonTable carbonTable; + + public DataMapFactory(CarbonTable carbonTable) { + this.carbonTable = carbonTable; + } /** * Initialization of Datamap factory with the carbonTable and datamap name */ - void init(CarbonTable carbonTable, DataMapSchema dataMapSchema) + public abstract void init(DataMapSchema dataMapSchema) throws IOException, MalformedDataMapCommandException; /** * Return a new write for this datamap */ - DataMapWriter createWriter(Segment segment, String writeDirectoryPath); + public abstract DataMapWriter createWriter(Segment segment, String shardName) + throws IOException; + + public abstract DataMapRefresher createRefresher(Segment segment, String shardName) + throws IOException; /** * Get the datamap for segmentid */ - List<T> getDataMaps(Segment segment) throws IOException; + public abstract List<T> getDataMaps(Segment segment) throws IOException; /** * Get datamaps for distributable object. */ - List<T> getDataMaps(DataMapDistributable distributable) + public abstract List<T> getDataMaps(DataMapDistributable distributable) throws IOException; /** * Get all distributable objects of a segmentid * @return */ - List<DataMapDistributable> toDistributable(Segment segment); + public abstract List<DataMapDistributable> toDistributable(Segment segment); /** * * @param event */ - void fireEvent(Event event); + public abstract void fireEvent(Event event); /** * Clears datamap of the segment */ - void clear(Segment segment); + public abstract void clear(Segment segment); /** * Clear all datamaps from memory */ - void clear(); + public abstract void clear(); /** * Return metadata of this datamap */ - DataMapMeta getMeta(); + public abstract DataMapMeta getMeta(); /** * Type of datamap whether it is FG or CG */ - DataMapLevel getDataMapType(); + public abstract DataMapLevel getDataMapLevel(); /** * delete datamap data if any */ - void deleteDatamapData(); + public abstract void deleteDatamapData(); /** * This function should return true is the input operation enum will make the datamap become stale */ - boolean willBecomeStale(TableOperation operation); + public abstract boolean willBecomeStale(TableOperation operation); + + /** + * Validate INDEX_COLUMNS property and return a array containing index column name + * Following will be validated + * 1. require INDEX_COLUMNS property + * 2. INDEX_COLUMNS can't contains illegal argument(empty, blank) + * 3. INDEX_COLUMNS can't contains duplicate same columns + * 4. INDEX_COLUMNS should be exists in table columns + */ + public void validateIndexedColumns(DataMapSchema dataMapSchema, + CarbonTable carbonTable) throws MalformedDataMapCommandException { + List<CarbonColumn> indexColumns = carbonTable.getIndexedColumns(dataMapSchema); + Set<String> unique = new HashSet<>(); + for (CarbonColumn indexColumn : indexColumns) { + unique.add(indexColumn.getColName()); + } + if (unique.size() != indexColumns.size()) { + throw new MalformedDataMapCommandException(INDEX_COLUMNS + " has duplicate column"); + } + } + + public static String[] getIndexColumns(DataMapSchema dataMapSchema) --- End diff -- moved to DataMapSchema --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5587/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4426/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4679/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4680/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4681/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4442/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5605/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4444/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4696/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4698/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 retest this please --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 retest sdv please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5612/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 @jackylk Please fix the build --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4451/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5622/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2254 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4705/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2254 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4462/ --- |
Free forum by Nabble | Edit this page |