Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1571#discussion_r154086819 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/table/TableInfo.java --- @@ -24,13 +24,23 @@ import java.io.DataOutputStream; import java.io.IOException; import java.io.Serializable; -import java.util.*; +import java.util.ArrayList; --- End diff -- keep as `import java.util.*;` --- |
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/1571#discussion_r154087247 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/table/TableInfo.java --- @@ -341,4 +351,268 @@ public static TableInfo deserialize(byte[] bytes) throws IOException { return parentRelationIdentifiers; } + public static TableInfoBuilder builder() { + return new TableInfo.TableInfoBuilder(); + } + + public static class TableInfoBuilder { --- End diff -- Can you move to new file, looks more code in inner class --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1571 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2006/ --- |
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/1571#discussion_r154116141 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/TableProperty.java --- @@ -0,0 +1,209 @@ +/* + * 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; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.datatype.DataTypes; +import org.apache.carbondata.core.metadata.datatype.StructField; +import org.apache.carbondata.core.metadata.datatype.StructType; +import org.apache.carbondata.core.metadata.schema.table.MalformedCarbonCommandException; +import org.apache.carbondata.core.util.CarbonUtil; + +/** + * This class encapsulate the definition of sortColumns, dictionaryColumns, noInvertedIndexColumns + * in the table. + * These columns are extracted from schema and table property map when creating instance + * of this class. + * It is used when creating table and alter table add column. + */ +public class TableProperty { --- End diff -- 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/1571#discussion_r154116722 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/TableProperty.java --- @@ -0,0 +1,209 @@ +/* + * 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; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.apache.carbondata.core.constants.CarbonCommonConstants; +import org.apache.carbondata.core.metadata.datatype.DataType; +import org.apache.carbondata.core.metadata.datatype.DataTypes; +import org.apache.carbondata.core.metadata.datatype.StructField; +import org.apache.carbondata.core.metadata.datatype.StructType; +import org.apache.carbondata.core.metadata.schema.table.MalformedCarbonCommandException; +import org.apache.carbondata.core.util.CarbonUtil; + +/** + * This class encapsulate the definition of sortColumns, dictionaryColumns, noInvertedIndexColumns + * in the table. + * These columns are extracted from schema and table property map when creating instance + * of this class. + * It is used when creating table and alter table add column. + */ +public class TableProperty { + + private Map<String, String> tableProperties; + private List<String> sortColumns; + private List<String> noInvertedIndexColumns; + private List<String> dictionaryColumns; + + /** + * This is called in case of create table + */ + public TableProperty(StructType schema, Map<String, String> tableProperties) + throws MalformedCarbonCommandException { + if (tableProperties == null) { + throw new IllegalArgumentException("table property should not be null"); + } + this.tableProperties = tableProperties; + this.noInvertedIndexColumns = extractNoInvertedIndexColumns(); + this.dictionaryColumns = extractDictionaryColumns(); + this.sortColumns = extractSortColumns(schema); + } + + /** + * This is called in case of alter table add column + */ + public TableProperty( + List<StructField> newFields, + List<String> existingSortColumns, + Map<String, String> existingTableProperties, + Map<String, String> alterTableProperties) { + if (existingSortColumns == null) { + throw new IllegalArgumentException("sort columns should not be null"); + } + if (existingTableProperties == null) { + throw new IllegalArgumentException("table property should not be null"); + } + + // update the existing table property according to alter table property + for (Map.Entry<String, String> entry : alterTableProperties.entrySet()) { + String newValue = entry.getValue(); + String existingValue = existingTableProperties.get(entry.getKey()); + if (existingValue != null) { + existingTableProperties.put(entry.getKey(), existingValue + "," + newValue); --- End diff -- This is called in case of alter table add column, it need to be updated in the existing table property. I will add comment for it. --- |
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/1571#discussion_r154117051 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/datatype/ArrayType.java --- @@ -30,4 +30,13 @@ public boolean isComplexType() { return true; } + + @Override + public int getNumOfChild() { + return 1; --- End diff -- I checked master code, it seems like this only --- |
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/1571#discussion_r154118903 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/table/ColumnTableRelation.java --- @@ -0,0 +1,55 @@ +/* + * 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; + +public class ColumnTableRelation { + private String parentColumnName; + private String parentColumnId; + private String parentTableName; + private String parentDatabaseName; + private String parentTableId; + + public ColumnTableRelation(String parentColumnName, String parentColumnId, String parentTableName, --- End diff -- This class is moved directly from `case class ColumnTableRelation` in carbonTableSchemaCommon.scala in master I can change two member variables to `ParentColumnTableRelation`, but still not very intuitive. Any suggestion? --- |
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/1571#discussion_r154120304 --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/table/TableInfo.java --- @@ -341,4 +351,268 @@ public static TableInfo deserialize(byte[] bytes) throws IOException { return parentRelationIdentifiers; } + public static TableInfoBuilder builder() { + return new TableInfo.TableInfoBuilder(); + } + + public static class TableInfoBuilder { --- End diff -- I prefer this style because they are used together (TableInfo and TableInfoBuilder), some style is used for TableSchema also --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1571 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1618/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1571 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2011/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1571 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2013/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1571 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1621/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1571 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1632/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1571 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2023/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1571 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1634/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1571 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2025/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1571 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2026/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1571 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1635/ --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:
https://github.com/apache/carbondata/pull/1571 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1571 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1636/ --- |
Free forum by Nabble | Edit this page |