Class SafeJsonSerializer

Object
org.apache.spark.sql.streaming.SafeJsonSerializer

public class SafeJsonSerializer extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.json4s.JValue
    safeDecimalToJValue(double value)
    Convert BigDecimal to JValue while handling empty or infinite values
    static org.json4s.JValue
    safeDoubleToJValue(double value)
    Convert Double to JValue while handling empty or infinite values
    static <T> org.json4s.JValue
    safeMapToJValue(Map<String,T> map, scala.Function1<T,org.json4s.JValue> valueToJValue)
    Convert map to JValue while handling empty maps.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SafeJsonSerializer

      public SafeJsonSerializer()
  • Method Details

    • safeDoubleToJValue

      public static org.json4s.JValue safeDoubleToJValue(double value)
      Convert Double to JValue while handling empty or infinite values
    • safeMapToJValue

      public static <T> org.json4s.JValue safeMapToJValue(Map<String,T> map, scala.Function1<T,org.json4s.JValue> valueToJValue)
      Convert map to JValue while handling empty maps. Also, this sorts the keys.
    • safeDecimalToJValue

      public static org.json4s.JValue safeDecimalToJValue(double value)
      Convert BigDecimal to JValue while handling empty or infinite values