use of com.facebook.presto.common.NotSupportedException 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.NotSupportedException 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.NotSupportedException 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);
}
use of com.facebook.presto.common.NotSupportedException 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, Object key) {
SingleMapBlock mapBlock = (SingleMapBlock) map;
int valuePosition;
try {
valuePosition = mapBlock.seekKeyExact((Block) 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.NotSupportedException 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, Slice 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