{"id":1005231,"date":"2024-12-27T10:33:53","date_gmt":"2024-12-27T02:33:53","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1005231.html"},"modified":"2024-12-27T10:33:56","modified_gmt":"2024-12-27T02:33:56","slug":"python%e5%a6%82%e4%bd%95%e5%86%99hive","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1005231.html","title":{"rendered":"python\u5982\u4f55\u5199hive"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25081837\/4339e144-3e7a-418c-8d1b-7db3da96f0a7.webp\" alt=\"python\u5982\u4f55\u5199hive\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u5199Hive\u7684\u65b9\u5f0f\u6709\u591a\u79cd\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528PyHive\u5e93\u3001\u4f7f\u7528Hive JDBC\u4e0eJayDeBeAPI\u3001\u4f7f\u7528hiveql\u5305\u3002<\/strong>\u5176\u4e2d\uff0c<strong>\u4f7f\u7528PyHive\u5e93<\/strong>\u662f\u6700\u5e38\u89c1\u4e14\u4fbf\u6377\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002PyHive\u662f\u4e00\u4e2aPython\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e0eHive\u8fdb\u884c\u4ea4\u4e92\u7684\u63a5\u53e3\uff0c\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u5728Python\u4e2d\u6267\u884cHiveQL\u67e5\u8be2\u5e76\u83b7\u53d6\u7ed3\u679c\u3002\u63a5\u4e0b\u6765\u6211\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528PyHive\u5e93\u6765\u8fde\u63a5\u548c\u64cd\u4f5cHive\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528PYHIVE\u5e93<\/p>\n<\/p>\n<p><p>PyHive\u662f\u4e00\u4e2a\u7eafPython\u5b9e\u73b0\u7684Hive\u63a5\u53e3\uff0c\u53ef\u4ee5\u901a\u8fc7Thrift\u534f\u8bae\u4e0eHive\u8fdb\u884c\u901a\u4fe1\u3002\u5b83\u7684\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u5e76\u4e14\u4e0ePython\u7684DB-API\u4e00\u81f4\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528PyHive\u5e93\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5PyHive\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u4f7f\u7528PyHive\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u76f8\u5e94\u7684\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pyhive<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u5916\uff0c\u8fd8\u9700\u8981\u5b89\u88c5<code>thrift<\/code>\u548c<code>thrift-sasl<\/code>\uff0c\u8fd9\u4e9b\u5e93\u7528\u4e8e\u5904\u7406Hive\u7684Thrift\u534f\u8bae\u548cSASL\u8ba4\u8bc1\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install thrift<\/p>\n<p>pip install thrift-sasl<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fde\u63a5\u5230Hive<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528PyHive\u8fde\u63a5\u5230Hive\u975e\u5e38\u7b80\u5355\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u57fa\u672c\u7684\u8fde\u63a5\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyhive import hive<\/p>\n<h2><strong>\u521b\u5efa\u8fde\u63a5<\/strong><\/h2>\n<p>conn = hive.Connection(host=&#39;your_hive_server_host&#39;, port=10000, username=&#39;your_username&#39;)<\/p>\n<h2><strong>\u4f7f\u7528\u8fde\u63a5\u521b\u5efa\u4e00\u4e2a\u6e38\u6807<\/strong><\/h2>\n<p>cursor = conn.cursor()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>host<\/code>\u662fHive\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216IP\u5730\u5740\uff0c<code>port<\/code>\u662fHiveServer2\u7684\u7aef\u53e3\uff08\u901a\u5e38\u4e3a10000\uff09\uff0c<code>username<\/code>\u662f\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884cHiveQL\u67e5\u8be2<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u65e6\u8fde\u63a5\u5efa\u7acb\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528\u6e38\u6807\u5bf9\u8c61\u6267\u884cHiveQL\u67e5\u8be2\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">cursor.execute(&#39;SELECT * FROM your_database.your_table LIMIT 10&#39;)<\/p>\n<h2><strong>\u83b7\u53d6\u67e5\u8be2\u7ed3\u679c<\/strong><\/h2>\n<p>for result in cursor.fetchall():<\/p>\n<p>    print(result)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>execute<\/code>\u65b9\u6cd5\u7528\u4e8e\u6267\u884c\u67e5\u8be2\uff0c<code>fetchall<\/code>\u65b9\u6cd5\u7528\u4e8e\u83b7\u53d6\u7ed3\u679c\u96c6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u67e5\u8be2\u7ed3\u679c<\/strong><\/p>\n<\/p>\n<p><p>\u67e5\u8be2\u7ed3\u679c\u901a\u5e38\u4ee5\u5217\u8868\u7684\u5f62\u5f0f\u8fd4\u56de\uff0c\u5217\u8868\u7684\u6bcf\u4e00\u9879\u5bf9\u5e94\u4e8e\u67e5\u8be2\u7ed3\u679c\u7684\u4e00\u884c\u3002\u53ef\u4ee5\u901a\u8fc7\u8fed\u4ee3\u8fd9\u4e2a\u5217\u8868\u6765\u5904\u7406\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">results = cursor.fetchall()<\/p>\n<p>for row in results:<\/p>\n<p>    # \u5904\u7406\u6bcf\u4e00\u884c\u6570\u636e<\/p>\n<p>    print(row)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u7ed3\u679c\u96c6\u975e\u5e38\u5927\uff0c\u53ef\u4ee5\u4f7f\u7528<code>fetchone<\/code>\u65b9\u6cd5\u9010\u6761\u83b7\u53d6\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">row = cursor.fetchone()<\/p>\n<p>while row is not None:<\/p>\n<p>    print(row)<\/p>\n<p>    row = cursor.fetchone()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/p>\n<\/p>\n<p><p>\u67e5\u8be2\u5b8c\u6210\u540e\uff0c\u5e94\u8be5\u5173\u95ed\u6e38\u6807\u548c\u8fde\u63a5\u4ee5\u91ca\u653e\u8d44\u6e90\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">cursor.close()<\/p>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528HIVE JDBC\u4e0eJAYDEBEAPI<\/p>\n<\/p>\n<p><p>\u9664\u4e86PyHive\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7JDBC\u8fde\u63a5Hive\u3002\u8fd9\u79cd\u65b9\u6cd5\u9700\u8981Java\u73af\u5883\uff0c\u9002\u5408\u9700\u8981\u5229\u7528JDBC\u529f\u80fd\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5JayDeBeAPI\u5e93<\/strong><\/p>\n<\/p>\n<p><p>JayDeBeAPI\u662f\u4e00\u4e2aPython\u5e93\uff0c\u5141\u8bb8\u4f7f\u7528JDBC\u9a71\u52a8\u7a0b\u5e8f\u8bbf\u95eeJava\u6570\u636e\u5e93\u3002\u901a\u8fc7pip\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install JayDeBeAPI<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0b\u8f7dHive JDBC\u9a71\u52a8\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<p><p>\u4eceApache\u5b98\u7f51\u6216\u5176\u4ed6\u53ef\u4fe1\u6765\u6e90\u4e0b\u8f7dHive JDBC\u9a71\u52a8\u7a0b\u5e8f\uff0c\u5e76\u5c06\u5176\u653e\u7f6e\u5728\u4e00\u4e2a\u5df2\u77e5\u8def\u5f84\u4e0b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fde\u63a5\u5230Hive<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528JayDeBeAPI\u8fde\u63a5\u5230Hive\u9700\u8981\u63d0\u4f9bJDBC\u9a71\u52a8\u7684\u8def\u5f84\u3001\u6570\u636e\u5e93URL\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import jaydebeapi<\/p>\n<h2><strong>JDBC\u9a71\u52a8\u8def\u5f84<\/strong><\/h2>\n<p>jdbc_driver_path = &#39;\/path\/to\/hive-jdbc-driver.jar&#39;<\/p>\n<h2><strong>\u6570\u636e\u5e93URL<\/strong><\/h2>\n<p>jdbc_url = &#39;jdbc:hive2:\/\/your_hive_server_host:10000\/default&#39;<\/p>\n<h2><strong>\u7528\u6237\u540d\u548c\u5bc6\u7801<\/strong><\/h2>\n<p>username = &#39;your_username&#39;<\/p>\n<p>password = &#39;your_password&#39;<\/p>\n<h2><strong>\u521b\u5efa\u8fde\u63a5<\/strong><\/h2>\n<p>conn = jaydebeapi.connect(&#39;org.apache.hive.jdbc.HiveDriver&#39;, jdbc_url, [username, password], jdbc_driver_path)<\/p>\n<h2><strong>\u521b\u5efa\u6e38\u6807<\/strong><\/h2>\n<p>cursor = conn.cursor()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884c\u67e5\u8be2\u548c\u5904\u7406\u7ed3\u679c<\/strong><\/p>\n<\/p>\n<p><p>\u4e0ePyHive\u7c7b\u4f3c\uff0c\u53ef\u4ee5\u4f7f\u7528<code>execute<\/code>\u65b9\u6cd5\u6267\u884c\u67e5\u8be2\uff0c\u5e76\u4f7f\u7528<code>fetchall<\/code>\u6216<code>fetchone<\/code>\u65b9\u6cd5\u83b7\u53d6\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">cursor.execute(&#39;SELECT * FROM your_table LIMIT 10&#39;)<\/p>\n<p>results = cursor.fetchall()<\/p>\n<p>for row in results:<\/p>\n<p>    print(row)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/p>\n<\/p>\n<p><p>\u5b8c\u6210\u67e5\u8be2\u540e\uff0c\u8bb0\u5f97\u5173\u95ed\u6e38\u6807\u548c\u8fde\u63a5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">cursor.close()<\/p>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528HIVEQL\u5305<\/p>\n<\/p>\n<p><p>HiveQL\u662f\u7528\u4e8eHive\u67e5\u8be2\u7684SQL\u65b9\u8a00\uff0cPython\u4e2d\u6709\u4e00\u4e9b\u5e93\u4e13\u95e8\u7528\u4e8e\u5904\u7406HiveQL\u3002\u4f8b\u5982\uff0c<code>hiveql<\/code>\u5305\u53ef\u4ee5\u5e2e\u52a9\u7b80\u5316\u4e00\u4e9bHiveQL\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5HIVEQL\u5305<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u5b89\u88c5hiveql\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install hiveql<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528HIVEQL\u5e93<\/strong><\/p>\n<\/p>\n<p><p>HiveQL\u5e93\u63d0\u4f9b\u4e86\u4e00\u4e9b\u65b9\u4fbf\u7684\u51fd\u6570\uff0c\u7528\u4e8e\u751f\u6210\u548c\u6267\u884cHiveQL\u67e5\u8be2\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from hiveql import HiveQL<\/p>\n<h2><strong>\u521b\u5efaHiveQL\u5bf9\u8c61<\/strong><\/h2>\n<p>hiveql = HiveQL(host=&#39;your_hive_server_host&#39;, port=10000, username=&#39;your_username&#39;)<\/p>\n<h2><strong>\u6267\u884c\u67e5\u8be2<\/strong><\/h2>\n<p>results = hiveql.query(&#39;SELECT * FROM your_table LIMIT 10&#39;)<\/p>\n<h2><strong>\u5904\u7406\u7ed3\u679c<\/strong><\/h2>\n<p>for row in results:<\/p>\n<p>    print(row)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>HiveQL\u5e93\u5185\u90e8\u5c01\u88c5\u4e86\u4e00\u4e9b\u5e38\u7528\u7684\u64cd\u4f5c\uff0c\u4f7f\u5f97\u4e0eHive\u7684\u4ea4\u4e92\u66f4\u52a0\u7b80\u5355\u548c\u76f4\u63a5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0cPython\u4e0eHive\u7684\u96c6\u6210\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u6bcf\u79cd\u65b9\u5f0f\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u52bf\u548c\u9002\u7528\u573a\u666f\u3002\u5728\u5f00\u53d1\u4e2d\u9009\u62e9\u5408\u9002\u7684\u65b9\u5f0f\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u9879\u76ee\u9700\u6c42\u548c\u73af\u5883\u914d\u7f6e\u3002\u65e0\u8bba\u662fPyHive\u7684\u7b80\u5355\u6613\u7528\uff0c\u8fd8\u662f\u901a\u8fc7JDBC\u5b9e\u73b0\u7684\u5f3a\u5927\u529f\u80fd\uff0cPython\u90fd\u80fd\u591f\u5f88\u597d\u5730\u4e0eHive\u8fdb\u884c\u4ea4\u4e92\uff0c\u6ee1\u8db3\u5927\u6570\u636e\u5904\u7406\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8fde\u63a5\u5230Hive\u6570\u636e\u5e93\uff1f<\/strong><br \/>\u8981\u8fde\u63a5\u5230Hive\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528PyHive\u5e93\u6216\u5176\u4ed6\u7b2c\u4e09\u65b9\u5e93\uff0c\u5982HiveServer2\u3002\u9996\u5148\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5PyHive\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>pip install pyhive<\/code>\u3002\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u793a\u4f8b\u8fde\u63a5\u5230Hive\uff1a  <\/p>\n<pre><code class=\"language-python\">from pyhive import hive\n\nconn = hive.Connection(host=&#39;your_hive_host&#39;, port=10000, username=&#39;your_username&#39;, database=&#39;your_database&#39;)\ncursor = conn.cursor()\n<\/code><\/pre>\n<p>\u786e\u4fdd\u66ff\u6362<code>your_hive_host<\/code>\u3001<code>your_username<\/code>\u548c<code>your_database<\/code>\u4e3a\u5b9e\u9645\u7684Hive\u4e3b\u673a\u3001\u7528\u6237\u540d\u548c\u6570\u636e\u5e93\u540d\u3002<\/p>\n<p><strong>Python\u5982\u4f55\u6267\u884cHive\u67e5\u8be2\u5e76\u83b7\u53d6\u7ed3\u679c\uff1f<\/strong><br \/>\u5728\u8fde\u63a5\u5230Hive\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6e38\u6807\u5bf9\u8c61\u6267\u884c\u67e5\u8be2\u3002\u53ef\u4ee5\u4f7f\u7528<code>cursor.execute()<\/code>\u65b9\u6cd5\u6765\u8fd0\u884cSQL\u8bed\u53e5\uff0c\u5e76\u4f7f\u7528<code>cursor.fetchall()<\/code>\u83b7\u53d6\u67e5\u8be2\u7ed3\u679c\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">cursor.execute(&#39;SELECT * FROM your_table&#39;)\nresults = cursor.fetchall()\nfor row in results:\n    print(row)\n<\/code><\/pre>\n<p>\u8bb0\u5f97\u5c06<code>your_table<\/code>\u66ff\u6362\u4e3a\u5b9e\u9645\u7684\u8868\u540d\uff0c\u4ee5\u83b7\u53d6\u6240\u9700\u7684\u6570\u636e\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406Hive\u67e5\u8be2\u7684\u5f02\u5e38\uff1f<\/strong><br \/>\u5728\u6267\u884cHive\u67e5\u8be2\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u5f02\u5e38\uff0c\u4f8b\u5982\u8fde\u63a5\u5931\u8d25\u6216\u67e5\u8be2\u8bed\u6cd5\u9519\u8bef\u3002\u4e3a\u4e86\u786e\u4fdd\u4ee3\u7801\u7684\u5065\u58ee\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528try-except\u5757\u6765\u6355\u83b7\u548c\u5904\u7406\u8fd9\u4e9b\u5f02\u5e38\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">try:\n    cursor.execute(&#39;SELECT * FROM your_table&#39;)\nexcept Exception as e:\n    print(f&quot;An error occurred: {e}&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u6355\u83b7\u9519\u8bef\u5e76\u6253\u5370\u51fa\u76f8\u5e94\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u4ee5\u4fbf\u4e8e\u8c03\u8bd5\u548c\u95ee\u9898\u6392\u67e5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u5199Hive\u7684\u65b9\u5f0f\u6709\u591a\u79cd\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528PyHive\u5e93\u3001\u4f7f\u7528Hive JDBC\u4e0eJayD [&hellip;]","protected":false},"author":3,"featured_media":1005238,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1005231"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1005231"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1005231\/revisions"}],"predecessor-version":[{"id":1005240,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1005231\/revisions\/1005240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1005238"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1005231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1005231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1005231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}