[ https://issues.apache.org/jira/browse/HIVE-22782?focusedWorklogId=482434&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-482434 ]
ASF GitHub Bot logged work on HIVE-22782: ----------------------------------------- Author: ASF GitHub Bot Created on: 12/Sep/20 06:26 Start Date: 12/Sep/20 06:26 Worklog Time Spent: 10m Work Description: ashish-kumar-sharma commented on a change in pull request #1419: URL: https://github.com/apache/hive/pull/1419#discussion_r487375660 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/TableConstraintsInfo.java ########## @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.metadata; + +public class TableConstraintsInfo { + PrimaryKeyInfo primaryKeyInfo; + ForeignKeyInfo foreignKeyInfo; + UniqueConstraint uniqueConstraint; + DefaultConstraint defaultConstraint; + CheckConstraint checkConstraint; + NotNullConstraint notNullConstraint; + + public TableConstraintsInfo() { + } + + public TableConstraintsInfo(PrimaryKeyInfo primaryKeyInfo, ForeignKeyInfo foreignKeyInfo, + UniqueConstraint uniqueConstraint, DefaultConstraint defaultConstraint, CheckConstraint checkConstraint, + NotNullConstraint notNullConstraint) { + this.primaryKeyInfo = primaryKeyInfo; + this.foreignKeyInfo = foreignKeyInfo; + this.uniqueConstraint = uniqueConstraint; + this.defaultConstraint = defaultConstraint; + this.checkConstraint = checkConstraint; + this.notNullConstraint = notNullConstraint; + } + + public PrimaryKeyInfo getPrimaryKeyInfo() { + return primaryKeyInfo; + } + + public void setPrimaryKeyInfo(PrimaryKeyInfo primaryKeyInfo) { + this.primaryKeyInfo = primaryKeyInfo; + } + + public ForeignKeyInfo getForeignKeyInfo() { + return foreignKeyInfo; + } + + public void setForeignKeyInfo(ForeignKeyInfo foreignKeyInfo) { + this.foreignKeyInfo = foreignKeyInfo; + } + + public UniqueConstraint getUniqueConstraint() { + return uniqueConstraint; + } + + public void setUniqueConstraint(UniqueConstraint uniqueConstraint) { + this.uniqueConstraint = uniqueConstraint; + } + + public DefaultConstraint getDefaultConstraint() { + return defaultConstraint; + } + + public void setDefaultConstraint(DefaultConstraint defaultConstraint) { + this.defaultConstraint = defaultConstraint; + } + + public CheckConstraint getCheckConstraint() { + return checkConstraint; + } + + public void setCheckConstraint(CheckConstraint checkConstraint) { + this.checkConstraint = checkConstraint; + } + + public NotNullConstraint getNotNullConstraint() { + return notNullConstraint; + } + + public void setNotNullConstraint(NotNullConstraint notNullConstraint) { + this.notNullConstraint = notNullConstraint; + } + + public static boolean isTableConstraintsInfoNotEmpty(TableConstraintsInfo info) { Review comment: i was trying to maintain the code uniformity. But since we have a wrapper class in places we can remove all static method and follow OOD para-dime ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 482434) Time Spent: 3h 40m (was: 3.5h) > Consolidate metastore call to fetch constraints > ----------------------------------------------- > > Key: HIVE-22782 > URL: https://issues.apache.org/jira/browse/HIVE-22782 > Project: Hive > Issue Type: Improvement > Components: Query Planning > Reporter: Vineet Garg > Assignee: Ashish Sharma > Priority: Major > Labels: pull-request-available > Time Spent: 3h 40m > Remaining Estimate: 0h > > Currently separate calls are made to metastore to fetch constraints like Pk, > fk, not null etc. Since planner always retrieve these constraints we should > retrieve all of them in one call. -- This message was sent by Atlassian Jira (v8.3.4#803005)