Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1464#discussion_r148995599
--- Diff:
core/src/main/java/org/apache/carbondata/core/metadata/schema/table/DataMapSchema.java
---
@@ -116,6 +218,83 @@ public void setProperties(Map<String, String>
properties) {
String value = in.readUTF();
this.properties.put(key, value);
}
+ }
+ /**
+ * Below method will be used to get the columns on which aggregate
function is not applied
+ * @param columnName
+ * parent column name
+ * @return child column schema
+ */
+ public ColumnSchema getChildColBasedByParentForNonAggF(String
columnName) {
+ Set<ColumnSchema> columnSchemas =
parentToNonAggChildMapping.get(columnName);
+ if (null != columnSchemas) {
+ Iterator<ColumnSchema> iterator = columnSchemas.iterator();
+ while (iterator.hasNext()) {
+ ColumnSchema next = iterator.next();
+ if (null == next.getAggFunction() ||
next.getAggFunction().isEmpty()) {
+ return next;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Below method will be used to get the column schema based on parent
column name
+ * @param columName
+ * parent column name
+ * @return child column schmea
+ */
+ public ColumnSchema getChildColumnByParentName(String columName) {
+ List<ColumnSchema> listOfColumns = childSchema.getListOfColumns();
+ for (ColumnSchema columnSchema : listOfColumns) {
+ List<ParentColumnTableRelation> parentColumnTableRelations =
+ columnSchema.getParentColumnTableRelations();
+ if
(parentColumnTableRelations.get(0).getColumnName().equals(columName)) {
+ return columnSchema;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Below method will be used to get the child column schema based on
parent name and aggregate
+ * function applied on column
+ * @param columnName
+ * parent column name
+ * @param aggFunction
+ * aggregate function applied
+ * @return child column schema
+ */
+ public ColumnSchema getChildColByParentWithAggFun(String columnName,
--- End diff --
Better name as `getAggChildColumnByParentColName`
---