You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/09/18 14:17:47 UTC

[GitHub] [carbondata] vikramahuja1001 commented on a change in pull request #3354: [CARBONDATA-3489] Optimized the comparator instances in sort

vikramahuja1001 commented on a change in pull request #3354: [CARBONDATA-3489] Optimized the comparator instances in sort
URL: https://github.com/apache/carbondata/pull/3354#discussion_r325702576
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/util/comparator/Comparator.java
 ##########
 @@ -25,24 +25,34 @@
 
 public final class Comparator {
 
+  //Comparators are made static so that only one instance is generated
+  private static SerializableComparator Boolean  = new BooleanSerializableComparator();
+  private static SerializableComparator Int = new IntSerializableComparator();
+  private static SerializableComparator Short = new ShortSerializableComparator();
+  private static SerializableComparator Double = new DoubleSerializableComparator();
+  private static SerializableComparator Float = new FloatSerializableComparator();
+  private static SerializableComparator Long = new LongSerializableComparator();
+  private static SerializableComparator Decimal  = new BigDecimalSerializableComparator();
+  private static SerializableComparator Byte = new ByteArraySerializableComparator();
+
   public static SerializableComparator getComparator(DataType dataType) {
 
 Review comment:
   getComparatorByDataTypeForMeasure method is been used extensively in the codebase making the refactoring difficult and thus cannot be merged, I am in turn using the other function in the first function.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services