// This file is autogenerated, DO NOT EDIT
// sql/endpoints/rest.asciidoc:535

[source, python]
----
resp = client.sql.query(
    format="txt",
    runtime_mappings={
        "release_day_of_week": {
            "type": "keyword",
            "script": "\n        emit(doc['release_date'].value.dayOfWeekEnum.toString())\n      "
        }
    },
    query="\n    SELECT * FROM library WHERE page_count > 300 AND author = 'Frank Herbert'\n  ",
)
print(resp)
----
