You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by GitBox <gi...@apache.org> on 2021/09/16 05:30:42 UTC

[GitHub] [carbondata] ShreelekhyaG commented on a change in pull request #4218: [CARBONDATA-4285] Alter add complex columns with global sort compaction is failed

ShreelekhyaG commented on a change in pull request #4218:
URL: https://github.com/apache/carbondata/pull/4218#discussion_r709785985



##########
File path: processing/src/main/java/org/apache/carbondata/processing/datatypes/PrimitiveDataType.java
##########
@@ -412,16 +412,18 @@ private void updateValueToByteStream(DataOutputStream dataOutputStream, byte[] v
     dataOutputStream.write(value);
   }
 
-  private void updateNullValue(DataOutputStream dataOutputStream, BadRecordLogHolder logHolder)
-      throws IOException {
+  private void updateNullValue(Object input, DataOutputStream dataOutputStream,
+      BadRecordLogHolder logHolder) throws IOException {
     CarbonUtil.updateNullValueBasedOnDatatype(dataOutputStream, this.carbonDimension.getDataType());
-    String message = logHolder.getColumnMessageMap().get(carbonDimension.getColName());
-    if (null == message) {
-      message = CarbonDataProcessorUtil
-          .prepareFailureReason(carbonDimension.getColName(), carbonDimension.getDataType());
-      logHolder.getColumnMessageMap().put(carbonDimension.getColName(), message);
+    if (null == input) {
+      String message = logHolder.getColumnMessageMap().get(carbonDimension.getColName());
+      if (null == message) {
+        message = CarbonDataProcessorUtil
+            .prepareFailureReason(carbonDimension.getColName(), carbonDimension.getDataType());
+        logHolder.getColumnMessageMap().put(carbonDimension.getColName(), message);
+        logHolder.setReason(message);

Review comment:
       can move setReason to line 426 after closing one if case of (null == message)

##########
File path: processing/src/main/java/org/apache/carbondata/processing/datatypes/ArrayDataType.java
##########
@@ -171,13 +171,13 @@ public boolean getIsColumnDictionary() {
   }
 
   @Override
-  public void writeByteArray(ArrayObject input, DataOutputStream dataOutputStream,
+  public void writeByteArray(Object input, DataOutputStream dataOutputStream,
       BadRecordLogHolder logHolder, Boolean isWithoutConverter) throws IOException {
-    if (input == null) {
+    if (input == null || input.equals("\\N")) {

Review comment:
       check if we could get `SERIALIZATION_NULL_FORMAT ` while creating complex type from FieldEncoderFactory




-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@carbondata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org