@SamzaSqlUdfMethod(params = {SamzaSqlFieldType.ANY, SamzaSqlFieldType.STRING}, returns = SamzaSqlFieldType.STRING)
  public String execute(Object currentFieldOrValue, String fieldName) {
    currentFieldOrValue = getSqlField(currentFieldOrValue, fieldName);

    if (currentFieldOrValue != null) {
      return currentFieldOrValue.toString();
    }

    return null;
  }
UDF that extracts a field value from a nested SamzaSqlRelRecord by recursively following a query path.
Note that the root object must be a SamzaSqlRelRecord.

Syntax for field specification:
<ul>
 <li> SamzaSqlRelRecord/Map: <code> field.subfield </code> </li>
 <li> Array: <code> field[index] </code> </li>
 <li> Scalar types: <code> field </code> </li>
</ul>

Example query: <code> pageViewEvent.requestHeader.properties.cookies[3].sessionKey </code>

Above query extracts the sessionKey field from below nested record:

  pageViewEvent (SamzaSqlRelRecord)
    - requestHeader (SamzaSqlRelRecord)
      - properties (Map)
        - cookies (Array)
          - sessionKey (Scalar)
samza-sql/src/main/java/org/apache/samza/sql/fn/GetSqlFieldUdf.java