This is an automated email from the ASF dual-hosted git repository.
preetham02 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new 6cf4f4f71d [NO ISSUE][EXT] Handling "null" option for missing values
in CSV
6cf4f4f71d is described below
commit 6cf4f4f71d69a39fc3ee6901a08fda9d76d6fab0
Author: Ritik Raj <[email protected]>
AuthorDate: Fri Nov 21 17:12:05 2025 +0530
[NO ISSUE][EXT] Handling "null" option for missing values in CSV
- user model changes: no
- storage format changes: no
- interface changes: no
Ext-ref: MB-69495
Change-Id: Id1f4ee636b4818ef97005b7e7a2f7bad2520634b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20596
Tested-by: Ritik Raj <[email protected]>
Reviewed-by: Murtadha Hubail <[email protected]>
---
.../asterix/om/pointables/printer/csv/ACSVRecordPrinter.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
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 f84e2062fe..fb560a857c 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 @@ public class ACSVRecordPrinter extends ARecordPrinter {
}
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 @@ public class ACSVRecordPrinter extends ARecordPrinter {
return false;
}
+ if (actualValueType.equals(ATypeTag.MISSING)) {
+ recordSchemaDetails.put(actualFieldName, ATypeTag.MISSING);
+ continue;
+ }
+
if (actualValueType.equals(ATypeTag.NULL)) {
recordSchemaDetails.put(actualFieldName, ATypeTag.NULL);
continue;