GitHub user ravipesala opened a pull request:
https://github.com/apache/carbondata/pull/2100 [WIP] Save the datamaps to system folder of warehouse. Be sure to do all of the following checklist to help us incorporate your contribution quickly and easily: - [ ] Any interfaces changed? - [ ] Any backward compatibility impacted? - [ ] Document update required? - [ ] Testing done Please provide details on - Whether new unit test cases have been added or why no new tests are required? - How it is tested? Please attach test report. - Is it a performance related change? Please attach the performance test report. - Any additional information to help reviewers in testing this change. - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ravipesala/incubator-carbondata savedatamap-master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/carbondata/pull/2100.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 #2100 ---- ---- --- |
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2100 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4071/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3347/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4573/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3352/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4579/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2100 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4076/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3358/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4584/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2100 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4080/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3362/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2100 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4590/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2100 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4087/ --- |
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/2100#discussion_r177138251 --- Diff: core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java --- @@ -1618,6 +1618,11 @@ */ public static final String CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT_DEFAULT = "200"; + /** + * System older location to store system level data like datamap schema and status files. + */ + public static final String CARBON_SYSTEM_FOLDER_LOCATION = "carbon.system.folder.location"; --- End diff -- It is better to add default value in this class also --- |
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/2100#discussion_r177138455 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/DataMapCatalog.java --- @@ -0,0 +1,51 @@ +/* + * 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 org.apache.carbondata.core.metadata.schema.table.DataMapSchema; + +/** + * This is the interface for inmemory catalog registry for datamap. + * @since 1.4.0 + */ +public interface DataMapCatalog<T> { --- End diff -- annotate it with InterfaceAudience --- |
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/2100#discussion_r177139569 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/IndexDataMapProvider.java --- @@ -115,4 +118,9 @@ private DataMapFactory getDataMapFactoryByShortName(String providerName) } return dataMapFactory; } + + @Override public DataMapCatalog createDataMapCatalog() { --- End diff -- move @Override to previous line --- |
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/2100#discussion_r177139860 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/table/DiskBasedDMSchemaStorageProvider.java --- @@ -0,0 +1,143 @@ +/* + * 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.metadata.schema.table; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.datastore.filesystem.CarbonFile; +import org.apache.carbondata.core.datastore.filesystem.CarbonFileFilter; +import org.apache.carbondata.core.datastore.impl.FileFactory; +import org.apache.carbondata.core.util.CarbonUtil; + +import com.google.gson.Gson; + +/** + * Stores datamap schema in disk as json format + */ +public class DiskBasedDMSchemaStorageProvider implements DataMapSchemaStorageProvider { + + private String storePath; + + public DiskBasedDMSchemaStorageProvider(String storePath) { + this.storePath = storePath; + } + + @Override public void saveSchema(DataMapSchema dataMapSchema) throws IOException { --- End diff -- move @Override to previous line, please follow this --- |
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/2100#discussion_r177140390 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala --- @@ -150,34 +150,39 @@ class CarbonSpark2SqlParser extends CarbonDDLSqlParser { */ protected lazy val createDataMap: Parser[LogicalPlan] = CREATE ~> DATAMAP ~> opt(IF ~> NOT ~> EXISTS) ~ ident ~ - (ON ~ TABLE) ~ (ident <~ ".").? ~ ident ~ + opt(ontable) ~ (USING ~> stringLit) ~ (DMPROPERTIES ~> "(" ~> repsep(loadOptions, ",") <~ ")").? ~ (AS ~> restInput).? <~ opt(";") ^^ { - case ifnotexists ~ dmname ~ ontable ~ dbName ~ tableName ~ className ~ dmprops ~ query => + case ifnotexists ~ dmname ~ tableIdent ~ className ~ dmprops ~ query => + val map = dmprops.getOrElse(List[(String, String)]()).toMap[String, String] - CarbonCreateDataMapCommand( - dmname, TableIdentifier(tableName, dbName), className, map, query, ifnotexists.isDefined) + CarbonCreateDataMapCommand(dmname, tableIdent, className, map, query, ifnotexists.isDefined) + } + + protected lazy val ontable: Parser[TableIdentifier] = + ON ~> TABLE ~> (ident <~ ".").? ~ ident ^^ { + case dbName ~ tableName => + TableIdentifier(tableName, dbName) } /** * The below syntax is used to drop the datamap. * DROP DATAMAP IF EXISTS datamapName ON TABLE tablename */ protected lazy val dropDataMap: Parser[LogicalPlan] = - DROP ~> DATAMAP ~> opt(IF ~> EXISTS) ~ ident ~ (ON ~ TABLE) ~ - (ident <~ ".").? ~ ident <~ opt(";") ^^ { - case ifexists ~ dmname ~ ontable ~ dbName ~ tableName => - CarbonDropDataMapCommand(dmname, ifexists.isDefined, dbName, tableName) + DROP ~> DATAMAP ~> opt(IF ~> EXISTS) ~ ident ~ opt(ontable) <~ opt(";") ^^ { + case ifexists ~ dmname ~ tableIdent => + CarbonDropDataMapCommand(dmname, ifexists.isDefined, tableIdent) } /** * The syntax of show datamap is used to show datamaps on the table * SHOW DATAMAP ON TABLE tableName --- End diff -- modify this description also: `SHOW DATAMAP [ON TABLE] tableName` --- |
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/2100#discussion_r177140617 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala --- @@ -150,34 +150,39 @@ class CarbonSpark2SqlParser extends CarbonDDLSqlParser { */ protected lazy val createDataMap: Parser[LogicalPlan] = CREATE ~> DATAMAP ~> opt(IF ~> NOT ~> EXISTS) ~ ident ~ - (ON ~ TABLE) ~ (ident <~ ".").? ~ ident ~ + opt(ontable) ~ (USING ~> stringLit) ~ (DMPROPERTIES ~> "(" ~> repsep(loadOptions, ",") <~ ")").? ~ (AS ~> restInput).? <~ opt(";") ^^ { - case ifnotexists ~ dmname ~ ontable ~ dbName ~ tableName ~ className ~ dmprops ~ query => + case ifnotexists ~ dmname ~ tableIdent ~ className ~ dmprops ~ query => + val map = dmprops.getOrElse(List[(String, String)]()).toMap[String, String] - CarbonCreateDataMapCommand( - dmname, TableIdentifier(tableName, dbName), className, map, query, ifnotexists.isDefined) + CarbonCreateDataMapCommand(dmname, tableIdent, className, map, query, ifnotexists.isDefined) + } + + protected lazy val ontable: Parser[TableIdentifier] = + ON ~> TABLE ~> (ident <~ ".").? ~ ident ^^ { + case dbName ~ tableName => + TableIdentifier(tableName, dbName) } /** * The below syntax is used to drop the datamap. * DROP DATAMAP IF EXISTS datamapName ON TABLE tablename */ protected lazy val dropDataMap: Parser[LogicalPlan] = - DROP ~> DATAMAP ~> opt(IF ~> EXISTS) ~ ident ~ (ON ~ TABLE) ~ - (ident <~ ".").? ~ ident <~ opt(";") ^^ { - case ifexists ~ dmname ~ ontable ~ dbName ~ tableName => - CarbonDropDataMapCommand(dmname, ifexists.isDefined, dbName, tableName) + DROP ~> DATAMAP ~> opt(IF ~> EXISTS) ~ ident ~ opt(ontable) <~ opt(";") ^^ { + case ifexists ~ dmname ~ tableIdent => + CarbonDropDataMapCommand(dmname, ifexists.isDefined, tableIdent) } /** * The syntax of show datamap is used to show datamaps on the table * SHOW DATAMAP ON TABLE tableName */ protected lazy val showDataMap: Parser[LogicalPlan] = - SHOW ~> DATAMAP ~> ON ~> TABLE ~> (ident <~ ".").? ~ ident <~ opt(";") ^^ { - case databaseName ~ tableName => - CarbonDataMapShowCommand(convertDbNameToLowerCase(databaseName), tableName.toLowerCase()) + SHOW ~> DATAMAP ~> opt(ontable) <~ opt(";") ^^ { --- End diff -- should n't it be show datamaps --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2100#discussion_r177647165 --- Diff: core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java --- @@ -1618,6 +1618,11 @@ */ public static final String CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT_DEFAULT = "200"; + /** + * System older location to store system level data like datamap schema and status files. + */ + public static final String CARBON_SYSTEM_FOLDER_LOCATION = "carbon.system.folder.location"; --- End diff -- The default value is under warehouse/store path so it can change as per driver. So we cannot keep the standard value here --- |
Free forum by Nabble | Edit this page |