<?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: Fetching top 1 L rows in Databricks SQL in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8321#M3987</link>
    <description>&lt;P&gt;I'm not asking about a single table. My query is I have a long SQL query which will generate the out put as 5gb data. Out of which I need tolimit the rows only 1L.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from (my long sql query) A order by A.X limit 100000:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not working.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 04:19:12 GMT</pubDate>
    <dc:creator>KVNARK</dc:creator>
    <dc:date>2023-03-06T04:19:12Z</dc:date>
    <item>
      <title>Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8317#M3983</link>
      <description>&lt;P&gt;how to fetch the top 1L rows from a long SQL query&amp;nbsp;as the query is returning 5gb data, I want to check only the first 1L ROWS.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 11:03:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8317#M3983</guid>
      <dc:creator>KVNARK</dc:creator>
      <dc:date>2023-03-03T11:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8318#M3984</link>
      <description>&lt;P&gt;By 1L do you mean 100,000? You could do a &lt;A href="https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-limit.html" alt="https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-limit.html" target="_blank"&gt;limit&lt;/A&gt; in your SQL query.  &lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 12:17:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8318#M3984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-03T12:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8319#M3985</link>
      <description>&lt;P&gt;As Josephk stated you can use limit it's the easiest solution&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 13:21:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8319#M3985</guid>
      <dc:creator>youssefmrini</dc:creator>
      <dc:date>2023-03-03T13:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8320#M3986</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM t LIMIT 10000;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/sql/language-manual/sql-ref-syntax-qry-select-limit.html" alt="https://docs.databricks.com/sql/language-manual/sql-ref-syntax-qry-select-limit.html" target="_blank"&gt;IMIT clause in the docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 15:12:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8320#M3986</guid>
      <dc:creator>SergeRielau</dc:creator>
      <dc:date>2023-03-03T15:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8321#M3987</link>
      <description>&lt;P&gt;I'm not asking about a single table. My query is I have a long SQL query which will generate the out put as 5gb data. Out of which I need tolimit the rows only 1L.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from (my long sql query) A order by A.X limit 100000:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not working.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 04:19:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8321#M3987</guid>
      <dc:creator>KVNARK</dc:creator>
      <dc:date>2023-03-06T04:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8322#M3988</link>
      <description>&lt;P&gt;Can you clarify "not working", please.&lt;/P&gt;&lt;P&gt;is there an error of sorts? Which one? OR is it simply "slow" and you expected it to be faster given the LIMIT clause?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 14:51:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8322#M3988</guid>
      <dc:creator>SergeRielau</dc:creator>
      <dc:date>2023-03-06T14:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8323#M3989</link>
      <description>&lt;P&gt;Not getting any result if I give like above. But when given like below, I'm getting the output.&lt;/P&gt;&lt;P&gt;select * from (my long sql query)  A&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 05:29:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8323#M3989</guid>
      <dc:creator>KVNARK</dc:creator>
      <dc:date>2023-03-07T05:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8324#M3990</link>
      <description>&lt;P&gt;You get an empty result set? May that should be a support ticket.&lt;/P&gt;&lt;P&gt;Cleary adding an ORDER BY may make things slower, but it should not change the resut set.&lt;/P&gt;&lt;P&gt;Can you try only ORDER BY without LIMIT? Just t see where the problem is..&lt;/P&gt;&lt;P&gt;Also try LIMIT without ORDER BY &lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 19:32:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8324#M3990</guid>
      <dc:creator>SergeRielau</dc:creator>
      <dc:date>2023-03-07T19:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8325#M3991</link>
      <description>&lt;P&gt;Did you tried to see if you are getting output with less limit count. &lt;/P&gt;&lt;P&gt;Ex select * from (my long sql query) A order by A.X limit 100; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can help understand if the underlying subquery is a problem or with the volume trying to display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 10:03:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8325#M3991</guid>
      <dc:creator>pvignesh92</dc:creator>
      <dc:date>2023-03-09T10:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8326#M3992</link>
      <description>&lt;P&gt;@Serge Rielau​&amp;nbsp;both the ways I tried but its of no use. its giving 10000 rows max but note more than that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 05:05:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8326#M3992</guid>
      <dc:creator>KVNARK</dc:creator>
      <dc:date>2023-03-10T05:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8327#M3993</link>
      <description>&lt;P&gt;@KVNARK .​&amp;nbsp;Hi, I could see this question is already answered. But this is something I found, Please check. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default, Databricks SQL notebooks limit the number of rows displayed to 1,000. However, you can increase this limit to display more than 1 Lakh (100,000) rows by changing the configuration setting for &lt;B&gt;spark.databricks.query.displayMaxRows&lt;/B&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;To change the configuration setting, follow these steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In the Databricks workspace, navigate to the cluster that you're using for your notebook.&lt;/LI&gt;&lt;LI&gt;Click on the "Advanced Options" tab.&lt;/LI&gt;&lt;LI&gt;In the "Spark" section, click on the "Edit" button next to "Spark Config".&lt;/LI&gt;&lt;LI&gt;Add the following configuration setting: &lt;/LI&gt;&lt;LI&gt;spark.databricks.query.displayMaxRows 10000 (or the desired maximum number of rows)&lt;/LI&gt;&lt;LI&gt;Click "Confirm" to save the configuration change.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vignesh&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 08:54:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8327#M3993</guid>
      <dc:creator>pvignesh92</dc:creator>
      <dc:date>2023-03-10T08:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8328#M3994</link>
      <description>&lt;P&gt;@Vigneshraja Palaniraj​&amp;nbsp;- Perfect. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 10:52:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8328#M3994</guid>
      <dc:creator>KVNARK</dc:creator>
      <dc:date>2023-03-10T10:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching top 1 L rows in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8329#M3995</link>
      <description>&lt;P&gt;use the below commands&lt;/P&gt;&lt;P&gt;df.show(100000)&lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2023 03:36:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/fetching-top-1-l-rows-in-databricks-sql/m-p/8329#M3995</guid>
      <dc:creator>Sangram</dc:creator>
      <dc:date>2023-03-12T03:36:58Z</dc:date>
    </item>
  </channel>
</rss>

