Class NullableArrayUtils
- java.lang.Object
-
- com.apple.foundationdb.relational.util.NullableArrayUtils
-
@API(EXPERIMENTAL) public final class NullableArrayUtils extends java.lang.Object
A Utils class that holds logic related to nullable arrays. Nullable Arrays are arrays that, if unset, will be NULL. Non-nullable arrays are arrays that, if unset, will be empty list.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REPEATED_FIELD_NAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getRepeatedFieldName()
static boolean
isWrappedArrayDescriptor(Descriptors.Descriptor descriptor)
static boolean
isWrappedArrayDescriptor(java.lang.String fieldName, Descriptors.Descriptor parentDescriptor)
static RecordMetaDataProto.KeyExpression
wrapArray(RecordMetaDataProto.KeyExpression keyExpression, com.apple.foundationdb.record.query.plan.cascades.typing.Type.Record record, boolean containsNullableArray)
Adds the wrapped array structure in key expressions if the schema doesn't contain non-nullable array.static RecordMetaDataProto.KeyExpression
wrapArray(RecordMetaDataProto.KeyExpression keyExpression, Descriptors.Descriptor parentDescriptor, boolean containsNullableArray)
-
-
-
Field Detail
-
REPEATED_FIELD_NAME
public static final java.lang.String REPEATED_FIELD_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRepeatedFieldName
public static java.lang.String getRepeatedFieldName()
-
isWrappedArrayDescriptor
public static boolean isWrappedArrayDescriptor(java.lang.String fieldName, Descriptors.Descriptor parentDescriptor)
-
isWrappedArrayDescriptor
public static boolean isWrappedArrayDescriptor(@Nonnull Descriptors.Descriptor descriptor)
-
wrapArray
public static RecordMetaDataProto.KeyExpression wrapArray(RecordMetaDataProto.KeyExpression keyExpression, com.apple.foundationdb.record.query.plan.cascades.typing.Type.Record record, boolean containsNullableArray)
Adds the wrapped array structure in key expressions if the schema doesn't contain non-nullable array. For example, reviews.rating will change to reviews.values.rating- Parameters:
keyExpression
- The key expression to modify.record
- The record of the table.containsNullableArray
- true if nullable arrays are to be found, otherwise false.- Returns:
- modified key expression where any nullable array is wrapped. TODO Add the wrapped array structure for nullable arrays.
-
wrapArray
public static RecordMetaDataProto.KeyExpression wrapArray(RecordMetaDataProto.KeyExpression keyExpression, Descriptors.Descriptor parentDescriptor, boolean containsNullableArray)
-
-