All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.spark.connector.util.CodecRegistryUtil.scala Maven / Gradle / Ivy

The newest version!
package com.datastax.spark.connector.util

import com.datastax.oss.driver.api.core.`type`.DataType
import com.datastax.oss.driver.api.core.`type`.codec.TypeCodec
import com.datastax.oss.driver.api.core.`type`.codec.registry.CodecRegistry


object CodecRegistryUtil {
  def codecFor(registry: CodecRegistry, cqlType: DataType, value: AnyRef) : TypeCodec[AnyRef] = {
    if(value==null) registry.codecFor(cqlType)
    else registry.codecFor(cqlType, value)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy