public void setRawMetadata(final int index, final char[] src, final int offset, final int length) throws IOException { if (length == 0) { if (!NonTaggedFormatUtil.isOptional(metaTypes[index])) { throw new RuntimeDataException(ErrorCode.INPUT_RECORD_RECORD_WITH_METADATA_AND_PK_NULL_IN_NON_OPTIONAL, index); } fieldValueBufferOutputs[index].writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG); } else { fieldValueBufferOutputs[index].writeByte(fieldTypeTags[index]); valueParsers[index].parse(src, offset, length, fieldValueBufferOutputs[index]); } }
public static Pair<IAType, Boolean> getNonNullableType(IAType keyType) { boolean nullable = false; IAType actualKeyType = keyType; if (NonTaggedFormatUtil.isOptional(keyType)) { actualKeyType = ((AUnionType) keyType).getActualType(); nullable = true; } return new Pair<>(actualKeyType, nullable); }
public IAType getClosedFieldType(ARecordType recordType, int fieldId) { IAType aType = recordType.getFieldTypes()[fieldId]; if (NonTaggedFormatUtil.isOptional(aType)) { // optional field: add the embedded non-null type tag aType = ((AUnionType) aType).getActualType(); } return aType; }
/** * Check if the type is optional boolean or not * * @param type * @return true if it is; false otherwise. */ private boolean isPossibleBoolean(IAType type) { IAType checkingType = type; while (NonTaggedFormatUtil.isOptional(checkingType)) { IAType actualType = ((AUnionType) checkingType).getActualType(); if (actualType.getTypeTag() == ATypeTag.BOOLEAN || actualType.getTypeTag() == ATypeTag.ANY) { return true; } checkingType = actualType; } return false; }
if (NonTaggedFormatUtil.isOptional(subRecordType)) { return true; return subRecordType == null || NonTaggedFormatUtil.isOptional(subRecordType);
if (NonTaggedFormatUtil.isOptional(reqTypes[i])) { reqTypeInside = ((AUnionType) reqTypes[i]).getActualType(); if (NonTaggedFormatUtil.isOptional(inputTypes[i])) { if (!NonTaggedFormatUtil.isOptional(reqTypes[i])) {
if (fieldPermutation[i] < 0) { IAType t = cachedReqType.getFieldTypes()[i]; if (!NonTaggedFormatUtil.isOptional(t)) {
if (NonTaggedFormatUtil.isOptional(indexedKeyType)) { indexedKeyType = ((AUnionType) indexedKeyType).getActualType();
if (NonTaggedFormatUtil.isOptional(reqFieldType)) { IAType itemType = ((AUnionType) reqFieldType).getActualType(); reqFieldType = itemType; if (NonTaggedFormatUtil.isOptional(fieldType)) { IAType itemType = ((AUnionType) fieldType).getActualType(); if (reqFieldType.equals(itemType)) { if (!NonTaggedFormatUtil.isOptional(reqFieldType)) { continue; if (NonTaggedFormatUtil.isOptional(reqFieldType)) {
if (!NonTaggedFormatUtil.isOptional(secondaryKeyType) && !forceFilter) { continue;
if (NonTaggedFormatUtil.isOptional(fieldTypes[i])) {
ATypeTag tag = type.getTypeTag(); if (tag == ATypeTag.UNION) { if (NonTaggedFormatUtil.isOptional(type)) { throw new RuntimeDataException(ErrorCode.PARSER_HIVE_NOT_SUPPORT_NON_OP_UNION);
ATypeTag ftypeTag = fieldTypes[i].getTypeTag(); if (NonTaggedFormatUtil.isOptional(fieldTypes[i])) {
while (NonTaggedFormatUtil.isOptional(inputRecordType)) {
while (NonTaggedFormatUtil.isOptional(inputRecordType)) {
if (!NonTaggedFormatUtil.isOptional(recordType.getFieldTypes()[i])) { throw new RuntimeDataException(ErrorCode.PARSER_DELIMITED_NONOPTIONAL_NULL, cursor.recordCount, cursor.fieldCount);
for (int i = 0; i < m; i++) { IAType ti = recType.getFieldTypes()[i]; if (NonTaggedFormatUtil.isOptional(ti)) { ti = ((AUnionType) ti).getActualType(); nullable[i] = true;
recBuilder.addField(fieldNameBuffer, fieldValueBuffer); } else if (NonTaggedFormatUtil.isOptional(fieldType)) { if (fieldValueBuffer.getByteArray()[0] != ATypeTag.MISSING.serialize()) { recBuilder.addField(fieldId, fieldValueBuffer);
fieldType = recType.getFieldTypes()[i]; boolean fieldIsNullable = false; if (NonTaggedFormatUtil.isOptional(fieldType)) { fieldIsNullable = true; fieldType = ((AUnionType) fieldType).getActualType();
if (NonTaggedFormatUtil.isOptional(fieldType)) { fieldType = ((AUnionType) fieldType).getActualType();