kumarvishal09 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_r325689623
##########
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:
Please merge both the methods
----------------------------------------------------------------
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:
[hidden email]
With regards,
Apache Git Services