- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How can I set primary key and reference foreign keys while creating a table / external table in hive?
- Labels:
-
Apache Hive
Created 02-02-2016 05:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
external-table-error.pngI'm getting the following error:
Created 02-02-2016 05:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@keerthana gajarajakumar hive is not a replacement for EDW or RDBMS there is no concept of foreign key.
Created 02-02-2016 08:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@keerthana gajarajakumar great, contribute an article on your findings when you're done.
Created 02-02-2016 08:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Artem Ervits & @Neeraj Sabharwal -- Can you please guide me with the following error?
FYI - I updated the hive-site.xml settings under hive configs but I'm still unable to update my table.
FAILED: SemanticException [Error 10297]: Attempt to do update or delete on table default.sal_orc that does not use an AcidOutputFormat or is not bucketed
Created 02-02-2016 08:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@keerthana gajarajakumar it's a good practice to open a new question with new error.
Created 02-04-2016 09:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Artem Ervits - I was able to solve for the question I posted, as you suggested I'll write a topic about it later. Thanks again for your guidance.
Created 02-02-2016 08:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a suggestion for working with hive acid tables at the link below (I think it is helpful for you):
http://www.remay.com.br/blog/how-to-work-with-acid-tables-in-hive/
Created 02-02-2016 09:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks @Carlos Hilario-- The challenge is identifying how to write the following statement :clustered by ('xxx') into 'xxx' buckets. The data was not completely loaded based on the values mentioned in this line of code.
Created 01-31-2017 04:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Updating this thread. Hive has primary and foreign keys for metadata and query optimization.
https://cwiki.apache.org/confluence/display/Hive/Column+Statistics+in+Hive
ALTER TABLE TABLENAME ADD CONSTRAINT COLNAME_PK PRIMARY KEY (CS_ID); ALTER TABLE TABLENAME ADD CONSTRAINT COLNAME_FK1 FOREIGN KEY (TBL_ID) REFERENCES TBLS
Created 02-07-2017 06:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So will this work?
ALTER TABLE HCALENDAR2017 ADD CONSTRAINT RWID_PK PRIMARY KEY (rowid() as rwid);
Created 03-28-2017 03:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Pls, check this: https://community.hortonworks.com/answers/22307/view.html

- « Previous
-
- 1
- 2
- Next »