[GitHub] carbondata pull request #2758: [CARBONDATA-2972] Debug Logs and function add...

2018-09-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/carbondata/pull/2758


---


[GitHub] carbondata pull request #2758: [CARBONDATA-2972] Debug Logs and function add...

2018-09-26 Thread manishnalla1994
Github user manishnalla1994 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2758#discussion_r220553863
  
--- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoder.java
 ---
@@ -78,6 +78,14 @@ public DataType getTargetDataType(ColumnPage inputPage) {
 }
   }
 
+  public Encoding getEncodingType() {
+List currEncodingList = getEncodingList();
+if (CarbonUtil.isEncodedWithMeta(currEncodingList)) {
+  return currEncodingList.get(0);
+}
+return null;
--- End diff --

This function will only return value in case of Adaptive Encoding, for any 
other case it will return null. Also we just want the first element of the list 
to check the type of encoding.


---


[GitHub] carbondata pull request #2758: [CARBONDATA-2972] Debug Logs and function add...

2018-09-26 Thread jackylk
Github user jackylk commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2758#discussion_r220542843
  
--- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoder.java
 ---
@@ -78,6 +78,14 @@ public DataType getTargetDataType(ColumnPage inputPage) {
 }
   }
 
+  public Encoding getEncodingType() {
+List currEncodingList = getEncodingList();
+if (CarbonUtil.isEncodedWithMeta(currEncodingList)) {
+  return currEncodingList.get(0);
+}
+return null;
--- End diff --

better not returning null, why not return the list itself?


---


[GitHub] carbondata pull request #2758: [CARBONDATA-2972] Debug Logs and function add...

2018-09-26 Thread manishgupta88
Github user manishgupta88 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2758#discussion_r220531471
  
--- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoder.java
 ---
@@ -78,6 +78,13 @@ public DataType getTargetDataType(ColumnPage inputPage) {
 }
   }
 
+  public Encoding getTypeOfEncoding() {
+if (CarbonUtil.isEncodedWithMeta(getEncodingList())) {
+  return getEncodingList().get(0);
--- End diff --

1. `getEncodingList()` is called 2 times. Hold its value in one variable 
and use at both the places
2. Change the method name from `getTypeOfEncoding()` to `getEncodingType()`


---