presto-main/src/main/java/io/prestosql/type/BooleanOperators.java/BooleanOperators/castToTinyint
class BooleanOperators:    @ScalarOperator(CAST)
    @SqlType(StandardTypes.TINYINT)
    public static long castToTinyint(@SqlType(StandardTypes.BOOLEAN) boolean value)
    {
        return value ? 1 : 0;
    }