Class DynamoDBFieldResolver
- java.lang.Object
-
- com.amazonaws.athena.connectors.dynamodb.resolver.DynamoDBFieldResolver
-
- All Implemented Interfaces:
FieldResolver
public class DynamoDBFieldResolver extends Object implements FieldResolver
-
-
Field Summary
-
Fields inherited from interface com.amazonaws.athena.connector.lambda.data.FieldResolver
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description DynamoDBFieldResolver(DDBRecordMetadata recordMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getFieldValue(org.apache.arrow.vector.types.pojo.Field field, Object originalValue)
Return the field value from a complex structure or list.Object
getMapKey(org.apache.arrow.vector.types.pojo.Field field, Object originalValue)
Allow for additional logic to be apply for the retrieval of map keys If not overwritten, the default behavior is to assume a standard map with no special logic where the key is NOT a complex valueObject
getMapValue(org.apache.arrow.vector.types.pojo.Field field, Object originalValue)
Allow for additional logic to be apply for the retrieval of map values If not overwritten, the default behavior is to assume a standard map with no special logic and return the value directly
-
-
-
Constructor Detail
-
DynamoDBFieldResolver
public DynamoDBFieldResolver(DDBRecordMetadata recordMetadata)
-
-
Method Detail
-
getFieldValue
public Object getFieldValue(org.apache.arrow.vector.types.pojo.Field field, Object originalValue) throws RuntimeException
Return the field value from a complex structure or list.- Specified by:
getFieldValue
in interfaceFieldResolver
- Parameters:
field
- is the field that we would like to extract from the provided value.originalValue
- is the original value object.- Returns:
- the field's value as a List for a LIST field type, a Map for a STRUCT field type, or the actual value if neither of the above.
- Throws:
IllegalArgumentException
- if originalValue is not an instance of Map.RuntimeException
- if the fieldName does not exist in originalValue, or if the fieldType is a STRUCT and the fieldValue is not instance of Map.
-
getMapKey
public Object getMapKey(org.apache.arrow.vector.types.pojo.Field field, Object originalValue)
Description copied from interface:FieldResolver
Allow for additional logic to be apply for the retrieval of map keys If not overwritten, the default behavior is to assume a standard map with no special logic where the key is NOT a complex value- Specified by:
getMapKey
in interfaceFieldResolver
- Parameters:
field
- The field that we would like to extract from the provided value.originalValue
- The complex value we'd like to extract the provided field from.- Returns:
- The value to use for the given field.
-
getMapValue
public Object getMapValue(org.apache.arrow.vector.types.pojo.Field field, Object originalValue)
Description copied from interface:FieldResolver
Allow for additional logic to be apply for the retrieval of map values If not overwritten, the default behavior is to assume a standard map with no special logic and return the value directly- Specified by:
getMapValue
in interfaceFieldResolver
- Parameters:
field
- The field that we would like to extract from the provided value.originalValue
- The complex value we'd like to extract the provided field from.- Returns:
- The value to use for the given field.
-
-