use of com.facebook.presto.common.block.SingleMapBlock in project presto by prestodb.
the class MapElementAtFunction method elementAt.
@UsedByGeneratedCode
public static Object elementAt(MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode, Type valueType, Block map, long key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition;
try {
valuePosition = mapBlock.seekKeyExact(key, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode);
} catch (NotSupportedException e) {
throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
}
if (valuePosition == -1) {
return null;
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of com.facebook.presto.common.block.SingleMapBlock in project presto by prestodb.
the class MapElementAtFunction method elementAt.
@UsedByGeneratedCode
public static Object elementAt(MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode, Type valueType, Block map, boolean key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition;
try {
valuePosition = mapBlock.seekKeyExact(key, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode);
} catch (NotSupportedException e) {
throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
}
if (valuePosition == -1) {
return null;
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of com.facebook.presto.common.block.SingleMapBlock in project presto by prestodb.
the class MapSubscriptOperator method subscript.
@UsedByGeneratedCode
public static Object subscript(boolean legacyMissingKey, MissingKeyExceptionFactory missingKeyExceptionFactory, MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode, Type valueType, SqlFunctionProperties properties, Block map, long key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition;
try {
valuePosition = mapBlock.seekKeyExact(key, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode);
} catch (NotSupportedException e) {
throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
}
if (valuePosition == -1) {
if (legacyMissingKey) {
return null;
}
throw missingKeyExceptionFactory.create(properties, key);
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of com.facebook.presto.common.block.SingleMapBlock in project presto by prestodb.
the class MapSubscriptOperator method subscript.
@UsedByGeneratedCode
public static Object subscript(boolean legacyMissingKey, MissingKeyExceptionFactory missingKeyExceptionFactory, MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode, Type valueType, SqlFunctionProperties properties, Block map, double key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition;
try {
valuePosition = mapBlock.seekKeyExact(key, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode);
} catch (NotSupportedException e) {
throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
}
if (valuePosition == -1) {
if (legacyMissingKey) {
return null;
}
throw missingKeyExceptionFactory.create(properties, key);
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of com.facebook.presto.common.block.SingleMapBlock in project presto by prestodb.
the class MapSubscriptOperator method subscript.
@UsedByGeneratedCode
public static Object subscript(boolean legacyMissingKey, MissingKeyExceptionFactory missingKeyExceptionFactory, MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode, Type valueType, SqlFunctionProperties properties, Block map, boolean key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition;
try {
valuePosition = mapBlock.seekKeyExact(key, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode);
} catch (NotSupportedException e) {
throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
}
if (valuePosition == -1) {
if (legacyMissingKey) {
return null;
}
throw missingKeyExceptionFactory.create(properties, key);
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
Aggregations