<?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: Hive primary on a partitioned column in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-primary-on-a-partitioned-column/m-p/209316#M171270</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;A side note: You should not partition on any columns with high cardinality such as IDs. You would use bucketing instead&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 14 Jun 2017 19:00:25 GMT</pubDate>
    <dc:creator>egarelnabi</dc:creator>
    <dc:date>2017-06-14T19:00:25Z</dc:date>
    <item>
      <title>Hive primary on a partitioned column</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-primary-on-a-partitioned-column/m-p/209315#M171269</link>
      <description>&lt;P&gt;
	I want to add primary/foreign key constraints to a hive table. The only think is that my PK is actually a partitioned column. For instance:&lt;/P&gt;&lt;PRE&gt;CREATE TABLE pk 
(
  id INT, 
  PRIMARY KEY(part) DISABLE NOVALIDATE
)
PARTITIONED BY (part STRING)&lt;/PRE&gt;&lt;P&gt;This fails with the error message:&lt;/P&gt;&lt;PRE&gt;DBCException: SQL Error [10002] [42000]: Error while compiling statement: FAILED: SemanticException [Error 10002]: Invalid column reference part&lt;/PRE&gt;&lt;P&gt;Is there a way to use a partitioned column as PK?&lt;/P&gt;&lt;P&gt;Context: hp 2.6, hive 2.1 with llap.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 17:52:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-primary-on-a-partitioned-column/m-p/209315#M171269</guid>
      <dc:creator>guillaume_roger</dc:creator>
      <dc:date>2017-06-14T17:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hive primary on a partitioned column</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-primary-on-a-partitioned-column/m-p/209316#M171270</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;A side note: You should not partition on any columns with high cardinality such as IDs. You would use bucketing instead&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Jun 2017 19:00:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-primary-on-a-partitioned-column/m-p/209316#M171270</guid>
      <dc:creator>egarelnabi</dc:creator>
      <dc:date>2017-06-14T19:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Hive primary on a partitioned column</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-primary-on-a-partitioned-column/m-p/209317#M171271</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/13690/guillaumeroger.html" nodeid="13690"&gt;@Guillaume Roger&lt;/A&gt; &lt;/P&gt;&lt;P&gt;partition is viewed as a new column in the table definition hence you can't partition by an already existing field.&lt;/P&gt;&lt;P&gt;as a side note, PK is not working as in standard SGBD in Hive, it's just here for compliance (ie you can't deduplicate fields just by adding a PK)&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 16:18:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-primary-on-a-partitioned-column/m-p/209317#M171271</guid>
      <dc:creator>ledel</dc:creator>
      <dc:date>2017-06-15T16:18:25Z</dc:date>
    </item>
  </channel>
</rss>

