> On May 3, 2016, 5:37 p.m., Ashutosh Chauhan wrote: > > ql/src/test/queries/clientpositive/create_with_constraints.q, line 19 > > <https://reviews.apache.org/r/46671/diff/4/?file=1369598#file1369598line19> > > > > Can you also add tests for describe formatted tblName colName; where > > colName is part of constraint. This should print out constraints relevant > > for that column. > > Hari Sankar Sivarama Subramaniyan wrote: > I dont see a reason why this should be allowed. This will make the column > details look complicated unnecessarily (for example, when there are multiple > foreign keys associated with the table column). Just printing out the partial > constraint information wont be of much use to the end user. Also, constraints > are not an entity of the column. Rather if the end-user wants to see the > constraints, he/she should do it on a table level.
MySQL prints out what kind of constraint given column is a part of like PK,FK,unique etc. Ref: https://dev.mysql.com/doc/refman/5.0/en/explain.html Adding such an info for Hive will be useful. > On May 3, 2016, 5:37 p.m., Ashutosh Chauhan wrote: > > ql/src/test/results/clientpositive/create_with_constraints.q.out, line 137 > > <https://reviews.apache.org/r/46671/diff/4/?file=1369599#file1369599line137> > > > > I think words Qualified and child are redundant here. > > Hari Sankar Sivarama Subramaniyan wrote: > IMO Child is not redundant since this is a Parent-Child relationship. > Agree 'Qualified' can be omitted. I think child is also redundant because its a describe statement on a table, so its obvious that info printed is for columns belonging to this table. > On May 3, 2016, 5:37 p.m., Ashutosh Chauhan wrote: > > ql/src/test/queries/clientpositive/create_with_constraints.q, line 17 > > <https://reviews.apache.org/r/46671/diff/4/?file=1369598#file1369598line17> > > > > describe formatted should also print constraints info. can you add a > > test case for that as well. > > Also for describe extended/formatted dbName.tblName; > > Hari Sankar Sivarama Subramaniyan wrote: > This required a patch of changes in the MetaDataFormatUtils class. Will > upload in the next patch. For dbName.tblName or for formatted? Either ways, its ok to do it in a follow-up where we also add support for show create table. - Ashutosh ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/46671/#review131529 ----------------------------------------------------------- On May 3, 2016, 3:46 a.m., Hari Sankar Sivarama Subramaniyan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/46671/ > ----------------------------------------------------------- > > (Updated May 3, 2016, 3:46 a.m.) > > > Review request for hive and Ashutosh Chauhan. > > > Repository: hive-git > > > Description > ------- > > Describe extended table should show the primary keys/foreign keys associated > with the table > > > Diffs > ----- > > itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java a6e8efa > metastore/scripts/upgrade/derby/034-HIVE-13076.derby.sql b062c56 > metastore/scripts/upgrade/derby/hive-schema-2.1.0.derby.sql 1d00499 > metastore/scripts/upgrade/mssql/019-HIVE-13076.mssql.sql 00ddb73 > metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql 2d9cf76 > metastore/scripts/upgrade/mysql/034-HIVE-13076.mysql.sql c9a5e1d > metastore/scripts/upgrade/mysql/hive-schema-2.1.0.mysql.sql 466e950 > metastore/scripts/upgrade/oracle/034-HIVE-13076.oracle.sql baf855c > metastore/scripts/upgrade/oracle/hive-schema-2.1.0.oracle.sql f57e588 > metastore/scripts/upgrade/postgres/033-HIVE-13076.postgres.sql ec1fb48 > metastore/scripts/upgrade/postgres/hive-schema-2.1.0.postgres.sql e209489 > metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java > 744512f > metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java > f651a13 > metastore/src/model/org/apache/hadoop/hive/metastore/model/MConstraint.java > 3806e28 > metastore/src/model/package.jdo b40df39 > ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 39a1efc > ql/src/java/org/apache/hadoop/hive/ql/metadata/ForeignKeyInfo.java > PRE-CREATION > ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java 4d9c3d2 > ql/src/java/org/apache/hadoop/hive/ql/metadata/PrimaryKeyInfo.java > PRE-CREATION > > ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/JsonMetaDataFormatter.java > 75c2dd9 > > ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatter.java > 55e1b3b > > ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java > b5dc0b4 > ql/src/test/queries/clientpositive/create_with_constraints.q eef0c64 > ql/src/test/results/clientpositive/create_with_constraints.q.out 5cf8d83 > > Diff: https://reviews.apache.org/r/46671/diff/ > > > Testing > ------- > > > Thanks, > > Hari Sankar Sivarama Subramaniyan > >