@Description("encode value as a 32-bit 2's complement big endian varbinary")
    @ScalarFunction("to_big_endian_32")
    @SqlType(StandardTypes.VARBINARY)
    public static Slice toBigEndian32(@SqlType(StandardTypes.INTEGER) long value)
    {
        Slice slice = Slices.allocate(Integer.BYTES);
        slice.setInt(0, Integer.reverseBytes((int) value));
        return slice;
    }
@Test
    public void testToBigEndian32()
    {
        assertFunction("to_big_endian_32(0)", VARBINARY, sqlVarbinaryHex("00000000"));
        assertFunction("to_big_endian_32(1)", VARBINARY, sqlVarbinaryHex("00000001"));
        assertFunction("to_big_endian_32(2147483647)", VARBINARY, sqlVarbinaryHex("7FFFFFFF"));
        assertFunction("to_big_endian_32(-2147483647)", VARBINARY, sqlVarbinaryHex("80000001"));
    }