<?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>question Re: search nothing about    '__HIVE_DEFAULT_PARTITION__' in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411714#M253139</link>
    <description>&lt;PRE&gt;SELECT * FROM your_table WHERE data_dt = '__HIVE_DEFAULT_PARTITION__';&lt;/PRE&gt;&lt;P&gt;ok thank's for your reply ,i understand this example&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But my question is, in my Third SQL statement, using length() function in the select statement is effective and the result is 26, while in the first and second&amp;nbsp; SQL , why can't this record be filtered by length in the where statement when I use the length function on the partition key?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank You &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jul 2025 12:04:28 GMT</pubDate>
    <dc:creator>lingloong</dc:creator>
    <dc:date>2025-07-24T12:04:28Z</dc:date>
    <item>
      <title>search nothing about    '__HIVE_DEFAULT_PARTITION__'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411292#M253019</link>
      <description>&lt;DIV&gt;--1. create a table with hive3&lt;/DIV&gt;&lt;DIV&gt;create external table aaa&lt;/DIV&gt;&lt;DIV&gt;( id string comment ''&lt;/DIV&gt;&lt;DIV&gt;) partitioned by (data_dt );&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--2. insert hive with dynamic partition&lt;/DIV&gt;&lt;DIV&gt;insert overwrite table partition(data_dt)&lt;/DIV&gt;&lt;DIV&gt;select id,data_dt from&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;( select 1 id,'2021' data_dt union all&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;select 2 id,'2022' data_dt union all&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;select 3 id,'' data_dt union all )t;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--3.check data&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;select id,data_dt,length(data_dt)&amp;nbsp; len&amp;nbsp; from aaa;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;the result:&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;id&lt;/TD&gt;&lt;TD width="25%"&gt;data_dt&lt;/TD&gt;&lt;TD width="25%"&gt;len&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1&lt;/TD&gt;&lt;TD width="25%"&gt;2021&lt;/TD&gt;&lt;TD width="25%"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;2&lt;/TD&gt;&lt;TD width="25%"&gt;2022&lt;/TD&gt;&lt;TD width="25%"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;3&lt;/TD&gt;&lt;TD width="25%"&gt;__HIVE_DEFAULT_PARTITION__&lt;/TD&gt;&lt;TD width="25%"&gt;26&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;--4.wired results with length(partition )&lt;/P&gt;&lt;P&gt;select&amp;nbsp; *&amp;nbsp; from aaa where length(data_dt)=26 ; -- return&amp;nbsp; no data&amp;nbsp; WHY&amp;nbsp; ?????&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;select * from (select&amp;nbsp; *,&amp;nbsp;length(data_dt) len from aaa )t where&amp;nbsp; len=26 ; -- return&amp;nbsp; no data&amp;nbsp; WHY ?????&lt;span class="lia-unicode-emoji" title=":weary_cat_face:"&gt;🙀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;select&amp;nbsp; *&amp;nbsp; from aaa where data_dt ='__HIVE_DEFAULT_PARTITION__' ;&amp;nbsp; --return 1&amp;nbsp; record&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 09:35:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411292#M253019</guid>
      <dc:creator>lingloong</dc:creator>
      <dc:date>2025-07-09T09:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: search nothing about    '__HIVE_DEFAULT_PARTITION__'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411331#M253036</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/128688"&gt;@lingloong&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our Hive experts &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38161"&gt;@cravani&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/45798"&gt;@james_jones&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/92016"&gt;@ggangadharan&lt;/a&gt;&amp;nbsp;&amp;nbsp;who may be able to assist you further&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 03:29:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411331#M253036</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-07-10T03:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: search nothing about    '__HIVE_DEFAULT_PARTITION__'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411343#M253045</link>
      <description>&lt;P&gt;In Hive, each partition corresponds to a physical directory on the file system. Because an empty string ('') or a NULL value cannot be used as a directory name, Hive substitutes it with the default value from its configuration.&lt;/P&gt;&lt;P&gt;The setting hive.exec.default.partition.name provides this value, which is __HIVE_DEFAULT_PARTITION__.&lt;/P&gt;&lt;P&gt;When you query with a WHERE clause on a partitioned column, Hive performs partition pruning by filtering the directory names before it ever reads the data files. Therefore, to find data in the default partition, you must filter on the literal string name that Hive assigned to the directory.&lt;/P&gt;&lt;P&gt;This will work:&lt;BR /&gt;SELECT * FROM aaa WHERE data_dt = '__HIVE_DEFAULT_PARTITION__';&lt;/P&gt;&lt;P&gt;This won't work:&lt;BR /&gt;SELECT * FROM aaa WHERE data_dt IS NULL;&lt;BR /&gt;— This fails because the column's value is the string '__HIVE_DEFAULT_PARTITION__', not a true NULL.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 16:21:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411343#M253045</guid>
      <dc:creator>james_jones</dc:creator>
      <dc:date>2025-07-10T16:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: search nothing about    '__HIVE_DEFAULT_PARTITION__'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411344#M253046</link>
      <description>&lt;P&gt;Also, if you use Iceberg table format instead of default Hive format it will act more intuitively as a NULL without the placeholder partition name "&lt;SPAN&gt;__HIVE_DEFAULT_PARTITION__".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So with Iceberg you can just do this:&lt;BR /&gt;&lt;BR /&gt;SELECT * FROM aaa where data_dt IS NULL;&lt;BR /&gt;&lt;BR /&gt;Depending on the environment/version you're running in, you can use iceberg this in any or all of: Impala, Spark3 and Hive.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 16:31:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411344#M253046</guid>
      <dc:creator>james_jones</dc:creator>
      <dc:date>2025-07-10T16:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: search nothing about    '__HIVE_DEFAULT_PARTITION__'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411505#M253067</link>
      <description>&lt;P&gt;In Hive ,&amp;nbsp;&lt;STRONG&gt;__HIVE_DEFAULT_PARTITION__&amp;nbsp;&lt;/STRONG&gt;is a special value used internally to represent:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NULL or EMPTY STRINGS&lt;/STRONG&gt; in partition column values .&lt;BR /&gt;&lt;BR /&gt;Since it's just a string literal in the metadata , you can access it just like any other string in a query.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT * FROM your_table WHERE data_dt = '__HIVE_DEFAULT_PARTITION__';&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;We cannot do&amp;nbsp;&lt;STRONG&gt;WHERE data_dt IS NULL&lt;/STRONG&gt; — because NULLs are replaced with &lt;STRONG&gt;__HIVE_DEFAULT_PARTITION__&lt;/STRONG&gt; before being written&lt;BR /&gt;&lt;BR /&gt;If you do &lt;STRONG&gt;WHERE length(data_dt)&lt;/STRONG&gt; = 26 — it won’t match anything, because partition columns behave differently.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 07:19:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411505#M253067</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2025-07-15T07:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: search nothing about    '__HIVE_DEFAULT_PARTITION__'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411559#M253080</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/128688"&gt;@lingloong&lt;/a&gt;&amp;nbsp;Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 02:13:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411559#M253080</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-07-16T02:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: search nothing about    '__HIVE_DEFAULT_PARTITION__'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411714#M253139</link>
      <description>&lt;PRE&gt;SELECT * FROM your_table WHERE data_dt = '__HIVE_DEFAULT_PARTITION__';&lt;/PRE&gt;&lt;P&gt;ok thank's for your reply ,i understand this example&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But my question is, in my Third SQL statement, using length() function in the select statement is effective and the result is 26, while in the first and second&amp;nbsp; SQL , why can't this record be filtered by length in the where statement when I use the length function on the partition key?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank You &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 12:04:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/search-nothing-about-HIVE-DEFAULT-PARTITION/m-p/411714#M253139</guid>
      <dc:creator>lingloong</dc:creator>
      <dc:date>2025-07-24T12:04:28Z</dc:date>
    </item>
  </channel>
</rss>

