diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index a6e8efa..ea325d8 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -1468,7 +1468,9 @@ private void maskPatterns(Pattern[] patterns, String fname) throws Exception { ".*Input:.*/data/files/.*", ".*Output:.*/data/files/.*", ".*total number of created files now is.*", - ".*.hive-staging.*" + ".*.hive-staging.*", + "pk_-?[0-9]*_[0-9]*_[0-9]*", + "fk_-?[0-9]*_[0-9]*_[0-9]*" }); private final Pattern[] partialReservedPlanMask = toPattern(new String[] { diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java index 744512f..40695f1 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java @@ -1829,13 +1829,13 @@ public void closeAllQueries() { + " INNER JOIN \"COLUMNS_V2\" ON \"COLUMNS_V2\".\"CD_ID\" = \"KEY_CONSTRAINTS\".\"CHILD_CD_ID\" " + " INNER JOIN \"COLUMNS_V2\" \"C2\" ON \"C2\".\"CD_ID\" = \"KEY_CONSTRAINTS\".\"PARENT_CD_ID\" " + " WHERE \"KEY_CONSTRAINTS\".\"CONSTRAINT_TYPE\" = " - + MConstraint.FOREIGN_KEY_CONSTRAINT + + MConstraint.FOREIGN_KEY_CONSTRAINT + " AND \"KEY_CONSTRAINTS2\".\"CONSTRAINT_TYPE\" = " - + MConstraint.PRIMARY_KEY_CONSTRAINT - + (foreign_db_name == null ? "" : "\"DBS\".\"NAME\" = ? AND") - + (foreign_tbl_name == null ? "" : " \"TBLS\".\"TBL_NAME\" = ? AND ") - + (parent_tbl_name == null ? "" : " \"T2\".\"TBL_NAME\" = ? AND ") - + (parent_db_name == null ? "" : "\"D2\".\"NAME\" = ?") ; + + MConstraint.PRIMARY_KEY_CONSTRAINT + " AND" + + (foreign_db_name == null ? "" : " \"DBS\".\"NAME\" = ? AND") + + (foreign_tbl_name == null ? "" : " \"TBLS\".\"TBL_NAME\" = ? AND") + + (parent_tbl_name == null ? "" : " \"T2\".\"TBL_NAME\" = ? AND") + + (parent_db_name == null ? "" : " \"D2\".\"NAME\" = ?") ; queryText = queryText.trim(); if (queryText.endsWith("WHERE")) { diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index cbeb361..d0b3bb4 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -116,6 +116,7 @@ import org.apache.hadoop.hive.ql.lockmgr.HiveLockObject.HiveLockObjectData; import org.apache.hadoop.hive.ql.lockmgr.HiveTxnManager; import org.apache.hadoop.hive.ql.metadata.CheckResult; +import org.apache.hadoop.hive.ql.metadata.ForeignKeyInfo; import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.metadata.HiveMetaStoreChecker; @@ -123,6 +124,7 @@ import org.apache.hadoop.hive.ql.metadata.InvalidTableException; import org.apache.hadoop.hive.ql.metadata.Partition; import org.apache.hadoop.hive.ql.metadata.PartitionIterable; +import org.apache.hadoop.hive.ql.metadata.PrimaryKeyInfo; import org.apache.hadoop.hive.ql.metadata.Table; import org.apache.hadoop.hive.ql.metadata.formatting.MetaDataFormatUtils; import org.apache.hadoop.hive.ql.metadata.formatting.MetaDataFormatter; @@ -3072,14 +3074,19 @@ private int describeTable(Hive db, DescTableDesc descTbl) throws HiveException { } } } - + PrimaryKeyInfo pkInfo = null; + ForeignKeyInfo fkInfo = null; + if (descTbl.isExt()) { + pkInfo = db.getPrimaryKeys(tbl.getDbName(), tbl.getTableName()); + fkInfo = db.getForeignKeys(tbl.getDbName(), tbl.getTableName()); + } fixDecimalColumnTypeName(cols); // In case the query is served by HiveServer2, don't pad it with spaces, // as HiveServer2 output is consumed by JDBC/ODBC clients. boolean isOutputPadded = !SessionState.get().isHiveServerQuery(); formatter.describeTable(outStream, colPath, tableName, tbl, part, cols, descTbl.isFormatted(), descTbl.isExt(), - descTbl.isPretty(), isOutputPadded, colStats); + descTbl.isPretty(), isOutputPadded, colStats, pkInfo, fkInfo); LOG.info("DDLTask: written data for " + tbl.getTableName()); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/ForeignKeyInfo.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/ForeignKeyInfo.java new file mode 100644 index 0000000..a48d16f --- /dev/null +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/ForeignKeyInfo.java @@ -0,0 +1,126 @@ +/** + * 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; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.List; + +import org.apache.hadoop.hive.metastore.api.SQLForeignKey; + +@SuppressWarnings("serial") +public class ForeignKeyInfo implements Serializable { + + class ForeignKeyCol { + public String parentTableName; + public String parentDatabaseName; + public String parentColName; + public String childColName; + public Integer position; + + public ForeignKeyCol(String parentTableName, String parentDatabaseName, String parentColName, String childColName, Integer position) { + this.parentTableName = parentTableName; + this.parentDatabaseName = parentDatabaseName; + this.parentColName = parentColName; + this.childColName = childColName; + this.position = position; + } + } + + // Mapping from constraint name to list of foreign keys + Map> foreignKeys; + String childTableName; + String childDatabaseName; + + public ForeignKeyInfo() {} + + public ForeignKeyInfo(List fks, String childTableName, String childDatabaseName) { + this.childTableName = childTableName; + this.childDatabaseName = childDatabaseName; + foreignKeys = new HashMap>(); + if (fks == null) { + return; + } + for (SQLForeignKey fk : fks) { + if (fk.getFktable_db().equalsIgnoreCase(childDatabaseName) && fk.getFktable_name().equalsIgnoreCase(childTableName)) { + ForeignKeyCol currCol = new ForeignKeyCol(fk.getPktable_name(), fk.getPktable_db(), + fk.getPkcolumn_name(), fk.getFkcolumn_name(), fk.getKey_seq()); + String constraintName = fk.getFk_name(); + if (foreignKeys.containsKey(constraintName)) { + foreignKeys.get(constraintName).add(currCol); + } else { + List currList = new ArrayList(); + currList.add(currCol); + foreignKeys.put(constraintName, currList); + } + } + } + } + + public String getChildTableName() { + return childTableName; + } + + public String getChildDatabaseName() { + return childDatabaseName; + } + + public Map> getForeignKeys() { + return foreignKeys; + } + + public void setChildTableName(String tableName) { + this.childTableName = tableName; + } + + public void setChildDatabaseName(String databaseName) { + this.childDatabaseName = databaseName; + } + + public void setForeignKeys(Map> foreignKeys) { + this.foreignKeys = foreignKeys; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Foreign Keys for " + childDatabaseName+"."+childTableName+":"); + sb.append("["); + if (foreignKeys != null && foreignKeys.size() > 0) { + for (Map.Entry> me : foreignKeys.entrySet()) { + sb.append(" {Constraint Name: " + me.getKey() + ","); + List currCol = me.getValue(); + if (currCol != null && currCol.size() > 0) { + for (ForeignKeyCol fkc : currCol) { + sb.append (" (Qualified Parent Column Name: " + fkc.parentDatabaseName + + "."+ fkc.parentTableName + "." + fkc.parentColName + "," + + " Child Column Name: " + fkc.childColName + ", Key Sequence: " + fkc.position+ "),"); + } + sb.setLength(sb.length()-1); + } + sb.append("},"); + } + sb.setLength(sb.length()-1); + } + sb.append("]"); + return sb.toString(); + } +} diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index ab165f1..d9bd963 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -85,6 +85,7 @@ import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.FireEventRequest; import org.apache.hadoop.hive.metastore.api.FireEventRequestData; +import org.apache.hadoop.hive.metastore.api.ForeignKeysRequest; import org.apache.hadoop.hive.metastore.api.Function; import org.apache.hadoop.hive.metastore.api.GetOpenTxnsInfoResponse; import org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest; @@ -99,6 +100,7 @@ import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Order; +import org.apache.hadoop.hive.metastore.api.PrimaryKeysRequest; import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.metastore.api.PrivilegeBag; @@ -3601,4 +3603,38 @@ public long getPermanenFunctionsChangeVersion() throws HiveException { } } + /** + * Get all primary key columns associated with the table. + * + * @param dbName Database Name + * @param tblName Table Name + * @return Primary Key associated with the table. + * @throws HiveException + */ + public PrimaryKeyInfo getPrimaryKeys(String dbName, String tblName) throws HiveException { + try { + List primaryKeys = getMSC().getPrimaryKeys(new PrimaryKeysRequest(dbName, tblName)); + return new PrimaryKeyInfo(primaryKeys, tblName, dbName); + } catch (Exception e) { + throw new HiveException(e); + } + } + + /** + * Get all foreign keys associated with the table. + * + * @param dbName Database Name + * @param tblName Table Name + * @return Foreign keys associated with the table. + * @throws HiveException + */ + public ForeignKeyInfo getForeignKeys(String dbName, String tblName) throws HiveException { + try { + List foreignKeys = getMSC().getForeignKeys(new ForeignKeysRequest(null, null, dbName, tblName)); + return new ForeignKeyInfo(foreignKeys, tblName, dbName); + } catch (Exception e) { + throw new HiveException(e); + } + } + }; diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/PrimaryKeyInfo.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/PrimaryKeyInfo.java new file mode 100644 index 0000000..5e876a1 --- /dev/null +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/PrimaryKeyInfo.java @@ -0,0 +1,100 @@ +/** + * 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; + +import java.io.Serializable; +import java.util.Map; +import java.util.List; +import java.util.TreeMap; + +import org.apache.hadoop.hive.metastore.api.SQLPrimaryKey; + +@SuppressWarnings("serial") +public class PrimaryKeyInfo implements Serializable { + + Map colNames; + String constraintName; + String tableName; + String databaseName; + + public PrimaryKeyInfo() {} + + public PrimaryKeyInfo(List pks, String tableName, String databaseName) { + this.tableName = tableName; + this.databaseName = databaseName; + this.colNames = new TreeMap(); + if (pks ==null) { + return; + } + for (SQLPrimaryKey pk : pks) { + if (pk.getTable_db().equalsIgnoreCase(databaseName) && pk.getTable_name().equalsIgnoreCase(tableName)) { + colNames.put(pk.getKey_seq(), pk.getColumn_name()); + this.constraintName = pk.getPk_name(); + } + } + } + + public String getTableName() { + return tableName; + } + + public String getDatabaseName() { + return databaseName; + } + + public Map getColNames() { + return colNames; + } + + public String getConstraintName() { + return constraintName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + public void setConstraintName(String constraintName) { + this.constraintName = constraintName; + } + + public void setColNames(Map colNames) { + this.colNames = colNames; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Primary Key for " + databaseName+"."+tableName+":"); + sb.append("["); + if (colNames != null && colNames.size() > 0) { + for (Map.Entry me : colNames.entrySet()) { + sb.append(me.getValue()+","); + } + sb.setLength(sb.length()-1); + } + sb.append("], Constraint Name: " + constraintName); + return sb.toString(); + } + +} diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/JsonMetaDataFormatter.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/JsonMetaDataFormatter.java index 75c2dd9..3315806 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/JsonMetaDataFormatter.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/JsonMetaDataFormatter.java @@ -38,9 +38,11 @@ import org.apache.hadoop.hive.metastore.TableType; import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj; import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.ql.metadata.ForeignKeyInfo; import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.metadata.Partition; +import org.apache.hadoop.hive.ql.metadata.PrimaryKeyInfo; import org.apache.hadoop.hive.ql.metadata.Table; import org.codehaus.jackson.map.ObjectMapper; @@ -102,7 +104,7 @@ public void showTables(DataOutputStream out, Set tables) public void describeTable(DataOutputStream out, String colPath, String tableName, Table tbl, Partition part, List cols, boolean isFormatted, boolean isExt, boolean isPretty, - boolean isOutputPadded, List colStats) throws HiveException { + boolean isOutputPadded, List colStats, PrimaryKeyInfo pkInfo, ForeignKeyInfo fkInfo) throws HiveException { MapBuilder builder = MapBuilder.create(); builder.put("columns", makeColsUnformatted(cols)); @@ -113,6 +115,12 @@ public void describeTable(DataOutputStream out, String colPath, else { builder.put("tableInfo", tbl.getTTable()); } + if (pkInfo != null && !pkInfo.getColNames().isEmpty()) { + builder.put("primaryKeyInfo", pkInfo); + } + if (fkInfo != null && !fkInfo.getForeignKeys().isEmpty()) { + builder.put("foreignKeyInfo", fkInfo); + } } asJson(out, builder.build()); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatter.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatter.java index 55e1b3b..82387c1 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatter.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatter.java @@ -27,9 +27,11 @@ import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj; import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.ql.metadata.ForeignKeyInfo; import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.metadata.Partition; +import org.apache.hadoop.hive.ql.metadata.PrimaryKeyInfo; import org.apache.hadoop.hive.ql.metadata.Table; /** @@ -71,12 +73,14 @@ public void showTables(DataOutputStream out, Set tables) * @param isPretty * @param isOutputPadded - if true, add spacing and indentation * @param colStats + * @param fkInfo + * @param pkInfo * @throws HiveException */ public void describeTable(DataOutputStream out, String colPath, String tableName, Table tbl, Partition part, List cols, boolean isFormatted, boolean isExt, boolean isPretty, - boolean isOutputPadded, List colStats) + boolean isOutputPadded, List colStats, PrimaryKeyInfo pkInfo, ForeignKeyInfo fkInfo) throws HiveException; /** diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java index b5dc0b4..ac73658 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java @@ -38,9 +38,11 @@ import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.ql.exec.Utilities; +import org.apache.hadoop.hive.ql.metadata.ForeignKeyInfo; import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.metadata.Partition; +import org.apache.hadoop.hive.ql.metadata.PrimaryKeyInfo; import org.apache.hadoop.hive.ql.metadata.Table; import org.apache.hadoop.hive.ql.session.SessionState; @@ -117,7 +119,7 @@ public void showTables(DataOutputStream out, Set tables) public void describeTable(DataOutputStream outStream, String colPath, String tableName, Table tbl, Partition part, List cols, boolean isFormatted, boolean isExt, boolean isPretty, - boolean isOutputPadded, List colStats) throws HiveException { + boolean isOutputPadded, List colStats, PrimaryKeyInfo pkInfo, ForeignKeyInfo fkInfo) throws HiveException { try { String output; if (colPath.equals(tableName)) { @@ -162,6 +164,19 @@ public void describeTable(DataOutputStream outStream, String colPath, outStream.write(separator); outStream.write(terminator); } + if ((pkInfo != null && !pkInfo.getColNames().isEmpty()) || + (fkInfo != null && !fkInfo.getForeignKeys().isEmpty())) { + outStream.write(("Detailed Constraints Information").getBytes("UTF-8")); + outStream.write(separator); + if (pkInfo != null && !pkInfo.getColNames().isEmpty()) { + outStream.write(pkInfo.toString().getBytes("UTF-8")); + outStream.write(separator); + } + if (fkInfo != null && !fkInfo.getForeignKeys().isEmpty()) { + outStream.write(fkInfo.toString().getBytes("UTF-8")); + } + outStream.write(terminator); + } } } } catch (IOException e) { diff --git a/ql/src/test/queries/clientpositive/create_with_constraints.q b/ql/src/test/queries/clientpositive/create_with_constraints.q index eef0c64..4d2c809 100644 --- a/ql/src/test/queries/clientpositive/create_with_constraints.q +++ b/ql/src/test/queries/clientpositive/create_with_constraints.q @@ -9,4 +9,12 @@ CONSTRAINT fk4 FOREIGN KEY (y) REFERENCES table1(a) DISABLE NOVALIDATE); CREATE TABLE table7 (a STRING, b STRING, primary key (a) disable novalidate rely); CREATE TABLE table8 (a STRING, b STRING, constraint pk8 primary key (a) disable novalidate norely); +DESCRIBE EXTENDED table1; +DESCRIBE EXTENDED table2; +DESCRIBE EXTENDED table3; +DESCRIBE EXTENDED table4; +DESCRIBE EXTENDED table5; +DESCRIBE EXTENDED table6; +DESCRIBE EXTENDED table7; +DESCRIBE EXTENDED table8; diff --git a/ql/src/test/results/clientpositive/create_with_constraints.q.out b/ql/src/test/results/clientpositive/create_with_constraints.q.out index 5cf8d83..332856b 100644 --- a/ql/src/test/results/clientpositive/create_with_constraints.q.out +++ b/ql/src/test/results/clientpositive/create_with_constraints.q.out @@ -66,3 +66,89 @@ POSTHOOK: query: CREATE TABLE table8 (a STRING, b STRING, constraint pk8 primary POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@table8 +PREHOOK: query: DESCRIBE EXTENDED table1 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table1 +POSTHOOK: query: DESCRIBE EXTENDED table1 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table1 +a string +b string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table1:[a], Constraint Name: #### A masked pattern was here #### +PREHOOK: query: DESCRIBE EXTENDED table2 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table2 +POSTHOOK: query: DESCRIBE EXTENDED table2 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table2 +a string +b string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table2:[a], Constraint Name: pk1 +PREHOOK: query: DESCRIBE EXTENDED table3 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table3 +POSTHOOK: query: DESCRIBE EXTENDED table3 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table3 +x string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table3:[x], Constraint Name: #### A masked pattern was here #### Foreign Keys for default.table3:[ {Constraint Name: fk1, (Qualified Parent Column Name: default.table2.b, Child Column Name: x, Key Sequence: 1)}] +PREHOOK: query: DESCRIBE EXTENDED table4 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table4 +POSTHOOK: query: DESCRIBE EXTENDED table4 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table4 +x string +y string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table4:[x], Constraint Name: #### A masked pattern was here #### Foreign Keys for default.table4:[ {Constraint Name: fk2, (Qualified Parent Column Name: default.table2.b, Child Column Name: x, Key Sequence: 1)}, {Constraint Name: fk3, (Qualified Parent Column Name: default.table2.a, Child Column Name: y, Key Sequence: 1)}] +PREHOOK: query: DESCRIBE EXTENDED table5 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table5 +POSTHOOK: query: DESCRIBE EXTENDED table5 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table5 +x string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table5:[x], Constraint Name: #### A masked pattern was here #### Foreign Keys for default.table5:[ {Constraint Name: #### A masked pattern was here ####, (Qualified Parent Column Name: default.table2.b, Child Column Name: x, Key Sequence: 1)}] +PREHOOK: query: DESCRIBE EXTENDED table6 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table6 +POSTHOOK: query: DESCRIBE EXTENDED table6 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table6 +x string +y string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table6:[x], Constraint Name: #### A masked pattern was here #### Foreign Keys for default.table6:[ {Constraint Name: #### A masked pattern was here ####, (Qualified Parent Column Name: default.table2.b, Child Column Name: x, Key Sequence: 1)}, {Constraint Name: fk4, (Qualified Parent Column Name: default.table1.a, Child Column Name: y, Key Sequence: 1)}] +PREHOOK: query: DESCRIBE EXTENDED table7 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table7 +POSTHOOK: query: DESCRIBE EXTENDED table7 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table7 +a string +b string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table7:[a], Constraint Name: #### A masked pattern was here #### +PREHOOK: query: DESCRIBE EXTENDED table8 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table8 +POSTHOOK: query: DESCRIBE EXTENDED table8 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table8 +a string +b string + +#### A masked pattern was here #### +Detailed Constraints Information Primary Key for default.table8:[a], Constraint Name: pk8