@Override
  public Object getMessageKey(SamzaSqlRelMessage message) {
    SamzaSqlRelRecord keyRecord = getMessageKeyRelRecord(message);
    // If all the message key rel record values are null, return null message key.
    if (keyRecord.getFieldValues().stream().allMatch(Objects::isNull)) {
      return null;
    }
    // Using the table key converter, convert message key from rel format to the record key format.
    return relTableKeyConverter.convertToTableKeyFormat(keyRecord);
  }
This class joins incoming {@link SamzaSqlRelMessage} with records {@link KV} from a remote table with the join key
defined by the format of the table key.
samza-sql/src/main/java/org/apache/samza/sql/translator/SamzaSqlRemoteTableJoinFunction.java