Package org.rumbledb.types
Class NeutralItemType
java.lang.Object
org.rumbledb.types.NeutralItemType
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable,Serializable,ItemType
Neutral element ItemType for aggregation operations.
This type serves as the neutral element in Spark aggregation operations
and ensures that any real ItemType combined with it returns the real ItemType.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBePromotedTo(ItemType itemType) booleanTests for itemType equality.getName()Returns the SparkSQL type of the item type for use in a query.intbooleanhasName()Tests for QName.booleanbooleanbooleanisCompatibleWithDataFrames(RumbleRuntimeConfiguration configuration) Checks compatibility with DataFrames.booleanbooleanbooleanbooleanbooleanbooleanisStaticallyCastableAs(ItemType other) Check at static time if [this] could be casted to [other] item type, requires [this] to be an atomic typebooleanisSubtypeOf(ItemType superType) booleanbooleanbooleanvoidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidresolve(DynamicContext context, ExceptionMetadata metadata) voidresolve(StaticContext context, ExceptionMetadata metadata) toString()voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.rumbledb.types.ItemType
findLeastCommonSuperTypeLax, getArrayContentFacet, getBoundedFacet, getCardinalityFacet, getCastingPrimitiveType, getClosedFacet, getConstraintsFacet, getEnumerationFacet, getExplicitTimezoneFacet, getFractionDigitsFacet, getIdentifierString, getLengthFacet, getLexicalSpacePatterns, getMapKeyItemType, getMapValueSequenceType, getMaxExclusiveFacet, getMaxInclusiveFacet, getMaxLengthFacet, getMemberSequenceType, getMinExclusiveFacet, getMinInclusiveFacet, getMinLengthFacet, getNumericFacet, getObjectContentFacet, getOrderedFacet, getPatternFacet, getPrimitiveType, getSignature, getTotalDigitsFacet, getTypes, getWhitespaceFacet, isCastingPrimitive, isEqualTo, isMapItemType, isNodeItemType, isPrimitive, isXQueryArrayItemType
-
Constructor Details
-
NeutralItemType
public NeutralItemType()
-
-
Method Details
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
writein interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
readin interfacecom.esotericsoftware.kryo.KryoSerializable
-
equals
Description copied from interface:ItemTypeTests for itemType equality. -
hasName
public boolean hasName()Description copied from interface:ItemTypeTests for QName. -
getName
-
isSubtypeOf
- Specified by:
isSubtypeOfin interfaceItemType- Parameters:
superType- another item type- Returns:
- true if [this] is a subtype of [superType], any type is considered a subtype of itself. If [this] has a name, then this is determined strictly based on the hierarchy. If [this] does not have a name, then this is determined based on facets.
-
findLeastCommonSuperTypeWith
- Specified by:
findLeastCommonSuperTypeWithin interfaceItemType- Parameters:
other- another item type- Returns:
- the common supertype between [this] and [other], that would be the LCA in the item type tree of [this] and [other] (does not take into account union types as common ancestor, but only the type tree)
-
getTypeTreeDepth
public int getTypeTreeDepth()- Specified by:
getTypeTreeDepthin interfaceItemType- Returns:
- an int representing the depth of the item type in the type tree ('item' is the root with depth 0)
-
getBaseType
- Specified by:
getBaseTypein interfaceItemType- Returns:
- the base type for a type, return null for the topmost item type
-
getAllowedFacets
- Specified by:
getAllowedFacetsin interfaceItemType- Returns:
- a set containing the allowed facets for restricting the type
-
toString
-
isResolved
public boolean isResolved()- Specified by:
isResolvedin interfaceItemType
-
isCompatibleWithDataFrames
Description copied from interface:ItemTypeChecks compatibility with DataFrames.- Specified by:
isCompatibleWithDataFramesin interfaceItemType- Returns:
- true if compatible with DataFrames and false otherwise.
-
getSparkSQLType
Description copied from interface:ItemTypeReturns the SparkSQL type of the item type for use in a query.- Specified by:
getSparkSQLTypein interfaceItemType- Returns:
- String representing the SparkSQL type of the item type.
-
isTopmostItemType
public boolean isTopmostItemType()- Specified by:
isTopmostItemTypein interfaceItemType- Returns:
- true it [this] is the topmost item type.
-
isAtomicItemType
public boolean isAtomicItemType()- Specified by:
isAtomicItemTypein interfaceItemType- Returns:
- true it [this] is a subtype of an atomic item type.
-
isObjectItemType
public boolean isObjectItemType()- Specified by:
isObjectItemTypein interfaceItemType- Returns:
- true it [this] is an object item type.
-
isArrayItemType
public boolean isArrayItemType()- Specified by:
isArrayItemTypein interfaceItemType- Returns:
- true it [this] is an array item type.
-
isJsonItemType
public boolean isJsonItemType()- Specified by:
isJsonItemTypein interfaceItemType- Returns:
- test if [this] is a subptype of a json item type
-
isUnionType
public boolean isUnionType()- Specified by:
isUnionTypein interfaceItemType
-
isFunctionItemType
public boolean isFunctionItemType()- Specified by:
isFunctionItemTypein interfaceItemType- Returns:
- true it [this] is a function item type.
-
isNumeric
public boolean isNumeric() -
isStaticallyCastableAs
Description copied from interface:ItemTypeCheck at static time if [this] could be casted to [other] item type, requires [this] to be an atomic type- Specified by:
isStaticallyCastableAsin interfaceItemType- Parameters:
other- a strict subtype of atomic item type to which we are trying to cast- Returns:
- true if it is possible at static time to cast [this] to [other], false otherwise
-
canBePromotedTo
- Specified by:
canBePromotedToin interfaceItemType- Parameters:
itemType- another item type- Returns:
- true if [this] can be promoted to [itemType]
-
isUserDefined
public boolean isUserDefined()- Specified by:
isUserDefinedin interfaceItemType- Returns:
- [true] if it is a user-defined type, false otherwise
-
resolve
-
resolve
-