class LongType extends DataType<Long> implements FixedWidthType, Streamer<Long> {

    public static final LongType INSTANCE = new LongType();
    public static final int ID = 10;
    public static final int PRECISION = 64;
    public static final int LONG_SIZE = (int) RamUsageEstimator.shallowSizeOfInstance(Long.class);
    private static final StorageSupport<Long> STORAGE = new StorageSupport<>(
        true,
        true,
        new LongEqQuery()
    ) {

        @Override
        public ValueIndexer<Long> valueIndexer(RelationName table,
                                               Reference ref,
                                               Function<String, FieldType> getFieldType,
                                               Function<ColumnIdent, Reference> getRef) {
            return new LongIndexer(ref, getFieldType.apply(ref.storageIdent()));
        }
    };

    @Override
    public int id() {
        return ID;
    }

    @Override
    public Precedence precedence() {
        return Precedence.LONG;
    }

    @Override
    public String getName() {
        return "bigint";
    }

    @Override
    public Integer numericPrecision() {
        return PRECISION;
    }

    @Override
    public Streamer<Long> streamer() {
        return this;
    }

    @Override
    public Long implicitCast(Object value) throws IllegalArgumentException, ClassCastException {
        if (value == null) {
            return null;
        } else if (value instanceof Long l) {
            return l;
        } else if (value instanceof String str) {
            return Long.valueOf(str);
        } else if (value instanceof BigDecimal bigDecimalValue) {
            var max = BigDecimal.valueOf(Long.MAX_VALUE).toBigInteger();
            var min = BigDecimal.valueOf(Long.MIN_VALUE).toBigInteger();
            if (max.compareTo(bigDecimalValue.toBigInteger()) <= 0
                || min.compareTo(bigDecimalValue.toBigInteger()) >= 0) {
                throw new IllegalArgumentException(getName() + " value out of range: " + value);
            }
            return ((BigDecimal) value).longValue();
        } else if (value instanceof Number number) {
            return number.longValue();
        } else {
            throw new ClassCastException("Can't cast '" + value + "' to " + getName());
        }
    }

    @Override
    public Long sanitizeValue(Object value) {<FILL_FUNCTION_BODY>}

    @Override
    public int compare(Long val1, Long val2) {
        return Long.compare(val1, val2);
    }

    @Override
    public Long readValueFrom(StreamInput in) throws IOException {
        return in.readBoolean() ? null : in.readLong();
    }

    @Override
    public void writeValueTo(StreamOutput out, Long v) throws IOException {
        out.writeBoolean(v == null);
        if (v != null) {
            out.writeLong(v);
        }
    }

    @Override
    public int fixedSize() {
        return LONG_SIZE;
    }

    @Override
    public StorageSupport<Long> storageSupport() {
        return STORAGE;
    }

    @Override
    public ColumnStatsSupport<Long> columnStatsSupport() {
        return ColumnStatsSupport.singleValued(Long.class, LongType.this);
    }

    @Override
    public long valueBytes(Long value) {
        return LONG_SIZE;
    }
}

        if (value == null) {
            return null;
        } else if (value instanceof Long l) {
            return l;
        } else {
            return ((Number) value).longValue();
        }
    
<methods>public non-sealed void <init>() ,public void addMappingOptions(Map<java.lang.String,java.lang.Object>) ,public java.lang.Integer characterMaximumLength() ,public ColumnStatsSupport<java.lang.Long> columnStatsSupport() ,public int compareTo(DataType<?>) ,public boolean equals(java.lang.Object) ,public java.lang.Long explicitCast(java.lang.Object, io.crate.metadata.settings.SessionSettings) throws java.lang.IllegalArgumentException, java.lang.ClassCastException,public abstract java.lang.String getName() ,public List<DataType<?>> getTypeParameters() ,public io.crate.types.TypeSignature getTypeSignature() ,public int hashCode() ,public abstract int id() ,public java.lang.Long implicitCast(java.lang.Object) throws java.lang.IllegalArgumentException, java.lang.ClassCastException,public boolean isConvertableTo(DataType<?>, boolean) ,public java.lang.Integer numericPrecision() ,public abstract io.crate.types.DataType.Precedence precedence() ,public boolean precedes(DataType<?>) ,public long ramBytesUsed() ,public abstract java.lang.Long sanitizeValue(java.lang.Object) ,public StorageSupport<? super java.lang.Long> storageSupport() ,public final StorageSupport<? super java.lang.Long> storageSupportSafe() ,public abstract Streamer<java.lang.Long> streamer() ,public ColumnType<io.crate.sql.tree.Expression> toColumnType(io.crate.sql.tree.ColumnPolicy, Supplier<List<ColumnDefinition<io.crate.sql.tree.Expression>>>) ,public java.lang.String toString() ,public abstract long valueBytes(java.lang.Long) ,public java.lang.Long valueForInsert(java.lang.Long) ,public final ValueIndexer<? super java.lang.Long> valueIndexer(io.crate.metadata.RelationName, io.crate.metadata.Reference, Function<java.lang.String,FieldType>, Function<io.crate.metadata.ColumnIdent,io.crate.metadata.Reference>) ,public void writeTo(org.elasticsearch.common.io.stream.StreamOutput) throws java.io.IOException<variables>