protected def sendRow()

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


  protected def sendRow(
      row: InternalRow,
      sender: Client
  ): Int = {
    val projectedRow = projection(row)
    val body = projectedRow.getBinary(0)
    val partitionKey = toPartitionKey(projectedRow.getUTF8String(1))
    val partitionId = toPartitionId(projectedRow.getUTF8String(2))
    val properties = toProperties(projectedRow.getMap(3))

    require(
      partitionId.isEmpty || partitionKey.isEmpty,
      s"Both a partitionKey (${partitionKey.get}) and partition (${partitionId.get}) have been detected. Both can not be set."
    )

    val event = EventData.create(body)
    sender.send(event, partitionId, partitionKey, properties)
    event.getBytes.length
  }