[ https://issues.apache.org/jira/browse/HIVE-28207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17839593#comment-17839593 ]
Stamatis Zampetakis commented on HIVE-28207: -------------------------------------------- Thanks for reporting this issue [~okumin] ! When queries fail with exceptions it is a good practice to include the stacktrace in the description (inside \{noformat} tags) of the Jira ticket since it helps in the understanding of the problem and is also very helpful to people who may encounter the same or similar problem to identify the correct bug report via JIRA/Google search. Please include it if possible. > NullPointerException is thrown when checking column uniqueness > -------------------------------------------------------------- > > Key: HIVE-28207 > URL: https://issues.apache.org/jira/browse/HIVE-28207 > Project: Hive > Issue Type: Bug > Components: CBO > Affects Versions: 4.0.0 > Reporter: Shohei Okumiya > Assignee: Shohei Okumiya > Priority: Major > Labels: pull-request-available > > In some cases, we skip checking null. For example, the last statement in the > following set of queries fails with NPE. > {code:java} > CREATE TABLE `store_sales` (`ss_item_sk` bigint); > CREATE TABLE `household_demographics` (`hd_demo_sk` bigint); > CREATE TABLE `item` (`i_item_sk` bigint); > ALTER TABLE `store_sales` ADD CONSTRAINT `pk_ss` PRIMARY KEY (`ss_item_sk`) > DISABLE NOVALIDATE RELY; > ALTER TABLE `item` ADD CONSTRAINT `pk_i` PRIMARY KEY (`i_item_sk`) DISABLE > NOVALIDATE RELY; > ALTER TABLE `store_sales` ADD CONSTRAINT `ss_i` FOREIGN KEY (`ss_item_sk`) > REFERENCES `item`(`i_item_sk`) DISABLE NOVALIDATE RELY; > EXPLAIN > SELECT i_item_sk > FROM store_sales, household_demographics, item > WHERE ss_item_sk = i_item_sk {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)