private def toProperties()

in core/src/main/scala/org/apache/spark/sql/eventhubs/EventHubsWriteTask.scala [118:131]


  private def toProperties(unsafeMap: UnsafeMapData): Option[Map[String, String]] = {
    if (unsafeMap == null) {
      None
    } else {
      val keys = unsafeMap.keyArray()
      val values = unsafeMap.valueArray()
      Some((0 until keys.numElements).map { i =>
        if (keys.isNullAt(i)) throw new IllegalStateException("Properties cannot have a null key")
        if (values.isNullAt(i))
          throw new IllegalStateException("Properties cannot have a null value")
        keys.getUTF8String(i).toString -> values.getUTF8String(i).toString
      }.toMap)
    }
  }