addFunctionIfNeeded(functions, inputType, ByteType.instance, Number::byteValue); addFunctionIfNeeded(functions, inputType, ShortType.instance, Number::shortValue); addFunctionIfNeeded(functions, inputType, Int32Type.instance, Number::intValue); addFunctionIfNeeded(functions, inputType, LongType.instance, Number::longValue); addFunctionIfNeeded(functions, inputType, FloatType.instance, Number::floatValue); addFunctionIfNeeded(functions, inputType, DoubleType.instance, Number::doubleValue); addFunctionIfNeeded(functions, inputType, DecimalType.instance, p -> BigDecimal.valueOf(p.doubleValue())); addFunctionIfNeeded(functions, inputType, IntegerType.instance, p -> BigInteger.valueOf(p.longValue())); functions.add(CastAsTextFunction.create(inputType, AsciiType.instance)); functions.add(CastAsTextFunction.create(inputType, UTF8Type.instance));
addFunctionIfNeeded(functions, inputType, ByteType.instance, Number::byteValue); addFunctionIfNeeded(functions, inputType, ShortType.instance, Number::shortValue); addFunctionIfNeeded(functions, inputType, Int32Type.instance, Number::intValue); addFunctionIfNeeded(functions, inputType, LongType.instance, Number::longValue); addFunctionIfNeeded(functions, inputType, FloatType.instance, Number::floatValue); addFunctionIfNeeded(functions, inputType, DoubleType.instance, Number::doubleValue); addFunctionIfNeeded(functions, inputType, DecimalType.instance, getDecimalConversionFunction(inputType)); addFunctionIfNeeded(functions, inputType, IntegerType.instance, p -> BigInteger.valueOf(p.longValue())); functions.add(CastAsTextFunction.create(inputType, AsciiType.instance)); functions.add(CastAsTextFunction.create(inputType, UTF8Type.instance));
addFunctionIfNeeded(functions, inputType, ByteType.instance, Number::byteValue); addFunctionIfNeeded(functions, inputType, ShortType.instance, Number::shortValue); addFunctionIfNeeded(functions, inputType, Int32Type.instance, Number::intValue); addFunctionIfNeeded(functions, inputType, LongType.instance, Number::longValue); addFunctionIfNeeded(functions, inputType, FloatType.instance, Number::floatValue); addFunctionIfNeeded(functions, inputType, DoubleType.instance, Number::doubleValue); addFunctionIfNeeded(functions, inputType, DecimalType.instance, getDecimalConversionFunction(inputType)); addFunctionIfNeeded(functions, inputType, IntegerType.instance, p -> BigInteger.valueOf(p.longValue())); functions.add(CastAsTextFunction.create(inputType, AsciiType.instance)); functions.add(CastAsTextFunction.create(inputType, UTF8Type.instance));