use of io.prestosql.spi.block.SingleMapBlock in project hetu-core by openlookeng.
the class MapElementAtFunction method elementAt.
@UsedByGeneratedCode
public static Object elementAt(MethodHandle keyEqualsMethod, Type keyType, Type valueType, Block map, long key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition = mapBlock.seekKeyExact(key);
if (valuePosition == -1) {
return null;
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of io.prestosql.spi.block.SingleMapBlock in project hetu-core by openlookeng.
the class MapElementAtFunction method elementAt.
@UsedByGeneratedCode
public static Object elementAt(MethodHandle keyEqualsMethod, Type keyType, Type valueType, Block map, double key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition = mapBlock.seekKeyExact(key);
if (valuePosition == -1) {
return null;
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of io.prestosql.spi.block.SingleMapBlock in project hetu-core by openlookeng.
the class MapElementAtFunction method elementAt.
@UsedByGeneratedCode
public static Object elementAt(MethodHandle keyEqualsMethod, Type keyType, Type valueType, Block map, Slice key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition = mapBlock.seekKeyExact(key);
if (valuePosition == -1) {
return null;
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of io.prestosql.spi.block.SingleMapBlock in project hetu-core by openlookeng.
the class MapSubscriptOperator method subscript.
@UsedByGeneratedCode
public static Object subscript(boolean legacyMissingKey, MissingKeyExceptionFactory missingKeyExceptionFactory, MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode, Type valueType, ConnectorSession session, Block map, boolean key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition = mapBlock.seekKeyExact(key);
if (valuePosition == -1) {
if (legacyMissingKey) {
return null;
}
throw missingKeyExceptionFactory.create(session, key);
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
use of io.prestosql.spi.block.SingleMapBlock in project hetu-core by openlookeng.
the class MapSubscriptOperator method subscript.
@UsedByGeneratedCode
public static Object subscript(boolean legacyMissingKey, MissingKeyExceptionFactory missingKeyExceptionFactory, MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode, Type valueType, ConnectorSession session, Block map, Object key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition = mapBlock.seekKeyExact((Block) key);
if (valuePosition == -1) {
if (legacyMissingKey) {
return null;
}
throw missingKeyExceptionFactory.create(session, key);
}
return readNativeValue(valueType, mapBlock, valuePosition);
}
Aggregations