You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2025/11/21 13:42:10 UTC
[XS] Change in asterixdb[phoenix]: [NO ISSUE][EXT] Handling "null" option for missing values
From Ritik Raj <ri...@couchbase.com>:
Ritik Raj has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20596?usp=email )
Change subject: [NO ISSUE][EXT] Handling "null" option for missing values
......................................................................
[NO ISSUE][EXT] Handling "null" option for missing values
- user model changes: no
- storage format changes: no
- interface changes: no
Ext-ref: MB-69495
Change-Id: Id1f4ee636b4818ef97005b7e7a2f7bad2520634b
---
M asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/ACSVRecordPrinter.java
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/96/20596/1
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/ACSVRecordPrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/ACSVRecordPrinter.java
index f84e206..fb560a8 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/ACSVRecordPrinter.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/ACSVRecordPrinter.java
@@ -134,15 +134,17 @@
}
boolean isNullable = false;
+ boolean isMissable = false;
IAType expectedIAType = expectedFieldTypes.get(expectedFieldNames.indexOf(actualFieldName));
ATypeTag expectedType = expectedIAType.getTypeTag();
if (expectedType.equals(ATypeTag.UNION)) {
AUnionType unionType = (AUnionType) expectedIAType;
expectedType = unionType.getActualType().getTypeTag();
isNullable = unionType.isNullableType();
+ isMissable = unionType.isMissableType();
}
- if (actualValueType.equals(ATypeTag.MISSING)) {
+ if (actualValueType.equals(ATypeTag.MISSING) && !isMissable) {
warnMismatchType("field '" + actualFieldName + "' cannot be missing");
return false;
}
@@ -152,6 +154,11 @@
return false;
}
+ if (actualValueType.equals(ATypeTag.MISSING)) {
+ recordSchemaDetails.put(actualFieldName, ATypeTag.MISSING);
+ continue;
+ }
+
if (actualValueType.equals(ATypeTag.NULL)) {
recordSchemaDetails.put(actualFieldName, ATypeTag.NULL);
continue;
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20596?usp=email
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: asterixdb
Gerrit-Branch: phoenix
Gerrit-Change-Id: Id1f4ee636b4818ef97005b7e7a2f7bad2520634b
Gerrit-Change-Number: 20596
Gerrit-PatchSet: 1
Gerrit-Owner: Ritik Raj <ri...@couchbase.com>