<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: api/2.0/sql/history/queries endpoint does not return query execution time in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/60154#M1164</link>
    <description>&lt;P&gt;The response I am getting is the one given in the first post (have tried again right now). I do not get any "metrics" JSON in the response, although I am calling the&amp;nbsp;&lt;SPAN&gt;api/2.0/sql/history/queries endpoint as hinted. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To get those metrics maybe it is needed a special setup, some extra params in the request or other requirements on the workspace?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2024 08:59:26 GMT</pubDate>
    <dc:creator>Octavian1</dc:creator>
    <dc:date>2024-02-14T08:59:26Z</dc:date>
    <item>
      <title>api/2.0/sql/history/queries endpoint does not return query execution time</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/55671#M1108</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I cannot see the&amp;nbsp;query execution time in the response to the "api/2.0/sql/history/queries" request.&lt;/P&gt;&lt;P&gt;Basically, I get only the following fields:&lt;BR /&gt;{&lt;BR /&gt;"next_page_token":...,&lt;BR /&gt;"has_next_page":...,&lt;BR /&gt;"res":[&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"query_id":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"status":..,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"query_text":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"&lt;STRONG&gt;query_start_time_ms&lt;/STRONG&gt;":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"&lt;STRONG&gt;execution_end_time_ms&lt;/STRONG&gt;":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"&lt;STRONG&gt;query_end_time_ms&lt;/STRONG&gt;":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"user_id":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"user_name":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"spark_ui_url":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"endpoint_id":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"rows_produced":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"lookup_key":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"executed_as_user_id":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"executed_as_user_name":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"is_final":..,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"channel_used":{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"name":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"dbsql_version":...&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"plans_state":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"statement_type":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"warehouse_id":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"&lt;STRONG&gt;duration&lt;/STRONG&gt;":...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"canSubscribeToLiveQuery":...&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; ...&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;There is an&amp;nbsp;&lt;STRONG&gt;execution_end_time_ms&lt;/STRONG&gt;&amp;nbsp;(which is equal to the&amp;nbsp;&lt;STRONG&gt;query_end_time_ms&lt;/STRONG&gt;), but no &lt;STRONG&gt;execution time&lt;/STRONG&gt; (which is part of the &lt;STRONG&gt;duration&lt;/STRONG&gt;), as it can be seen in Query History UI, see screenshot attached.&lt;BR /&gt;Is there another way to get the query execution time?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 15:07:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/55671#M1108</guid>
      <dc:creator>Octavian1</dc:creator>
      <dc:date>2023-12-22T15:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: api/2.0/sql/history/queries endpoint does not return query execution time</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/58946#M1146</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/96336"&gt;@Octavian1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per the API documentation, &lt;A href="https://docs.databricks.com/api/workspace/queryhistory/list" target="_self"&gt;this API&lt;/A&gt; should ideally fetch the execution time and the duration too. What do you see in the response? Can you attach the response here?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 06:51:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/58946#M1146</guid>
      <dc:creator>Yeshwanth</dc:creator>
      <dc:date>2024-02-01T06:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: api/2.0/sql/history/queries endpoint does not return query execution time</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/58959#M1147</link>
      <description>&lt;P&gt;you can get time from metrics&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"metrics": {
        "total_time_ms": 1000,
        "read_bytes": 1024,
        "rows_produced_count": 100000,
        "compilation_time_ms": 1000,
        "execution_time_ms": 1000,
        "read_remote_bytes": 1024,
        "write_remote_bytes": 1024,
        "read_cache_bytes": 1024,
        "spill_to_disk_bytes": 1024,
        "task_total_time_ms": 100000,
        "read_files_count": 1,
        "read_partitions_count": 1,
        "photon_total_time_ms": 1000,
        "rows_read_count": 10000,
        "result_fetch_time_ms": 100000,
        "network_sent_bytes": 1024,
        "result_from_cache": false,
        "pruned_bytes": 1024,
        "pruned_files_count": 1,
        "provisioning_queue_start_timestamp": 1595357087200,
        "overloading_queue_start_timestamp": 1595357087200,
        "query_compilation_start_timestamp": 1595357087200,
        "metadata_time_ms": 0,
        "planning_time_ms": 0,
        "query_execution_time_ms": 0,
        "planning_phases": [
          {}
        ]
      },&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Feb 2024 07:48:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/58959#M1147</guid>
      <dc:creator>feiyun0112</dc:creator>
      <dc:date>2024-02-01T07:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: api/2.0/sql/history/queries endpoint does not return query execution time</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/59023#M1151</link>
      <description>&lt;P&gt;Spot on&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/99027"&gt;@feiyun0112&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this confirms that the API is working as expected right?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 07:06:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/59023#M1151</guid>
      <dc:creator>Yeshwanth</dc:creator>
      <dc:date>2024-02-02T07:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: api/2.0/sql/history/queries endpoint does not return query execution time</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/59052#M1152</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/32523"&gt;@Yeshwanth&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Spot on&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/99027"&gt;@feiyun0112&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this confirms that the API is working as expected right?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;yes, you can compare data with ui&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 12:26:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/59052#M1152</guid>
      <dc:creator>feiyun0112</dc:creator>
      <dc:date>2024-02-02T12:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: api/2.0/sql/history/queries endpoint does not return query execution time</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/60154#M1164</link>
      <description>&lt;P&gt;The response I am getting is the one given in the first post (have tried again right now). I do not get any "metrics" JSON in the response, although I am calling the&amp;nbsp;&lt;SPAN&gt;api/2.0/sql/history/queries endpoint as hinted. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To get those metrics maybe it is needed a special setup, some extra params in the request or other requirements on the workspace?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 08:59:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/60154#M1164</guid>
      <dc:creator>Octavian1</dc:creator>
      <dc:date>2024-02-14T08:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: api/2.0/sql/history/queries endpoint does not return query execution time</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/60155#M1165</link>
      <description>&lt;P&gt;Got it, to get the metrics you've got to call with the &lt;EM&gt;include_metrics&lt;/EM&gt; param set to &lt;EM&gt;true&lt;/EM&gt;:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;api/2.0/sql/history/queries&lt;STRONG&gt;?include_metrics=true&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Feb 2024 09:11:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/api-2-0-sql-history-queries-endpoint-does-not-return-query/m-p/60155#M1165</guid>
      <dc:creator>Octavian1</dc:creator>
      <dc:date>2024-02-14T09:11:20Z</dc:date>
    </item>
  </channel>
</rss>

