@Override public void addUniqueConstraint(List<SQLUniqueConstraint> uniqueConstraintCols) throws NoSuchObjectException, MetaException, TException { if (!uniqueConstraintCols.isEmpty() && !uniqueConstraintCols.get(0).isSetCatName()) { String defaultCat = getDefaultCatalog(conf); uniqueConstraintCols.forEach(uc -> uc.setCatName(defaultCat)); } client.add_unique_constraint(new AddUniqueConstraintRequest(uniqueConstraintCols)); }
List<Object> list = new ArrayList<Object>(); boolean present_catName = true && (isSetCatName()); list.add(present_catName); if (present_catName)
lastComparison = Boolean.valueOf(isSetCatName()).compareTo(other.isSetCatName()); if (lastComparison != 0) { return lastComparison; if (isSetCatName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catName, other.catName); if (lastComparison != 0) {
return false; boolean this_present_catName = true && this.isSetCatName(); boolean that_present_catName = true && that.isSetCatName(); if (this_present_catName || that_present_catName) { if (!(this_present_catName && that_present_catName))
/** * Performs a deep copy on <i>other</i>. */ public SQLUniqueConstraint(SQLUniqueConstraint other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetCatName()) { this.catName = other.catName; } if (other.isSetTable_db()) { this.table_db = other.table_db; } if (other.isSetTable_name()) { this.table_name = other.table_name; } if (other.isSetColumn_name()) { this.column_name = other.column_name; } this.key_seq = other.key_seq; if (other.isSetUk_name()) { this.uk_name = other.uk_name; } this.enable_cstr = other.enable_cstr; this.validate_cstr = other.validate_cstr; this.rely_cstr = other.rely_cstr; }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case CAT_NAME: return isSetCatName(); case TABLE_DB: return isSetTable_db(); case TABLE_NAME: return isSetTable_name(); case COLUMN_NAME: return isSetColumn_name(); case KEY_SEQ: return isSetKey_seq(); case UK_NAME: return isSetUk_name(); case ENABLE_CSTR: return isSetEnable_cstr(); case VALIDATE_CSTR: return isSetValidate_cstr(); case RELY_CSTR: return isSetRely_cstr(); } throw new IllegalStateException(); }
boolean success = false; Exception ex = null; if (!uniqueConstraintCols.isEmpty() && !uniqueConstraintCols.get(0).isSetCatName()) { String defaultCat = getDefaultCatalog(conf); uniqueConstraintCols.forEach(pk -> pk.setCatName(defaultCat));
/*** * @param addUniqueConstraintEvent add unique constraint event * @throws MetaException */ @Override public void onAddUniqueConstraint(AddUniqueConstraintEvent addUniqueConstraintEvent) throws MetaException { List<SQLUniqueConstraint> cols = addUniqueConstraintEvent.getUniqueConstraintCols(); if (cols.size() > 0) { AddUniqueConstraintMessage msg = MessageBuilder.getInstance() .buildAddUniqueConstraintMessage(addUniqueConstraintEvent.getUniqueConstraintCols()); NotificationEvent event = new NotificationEvent(0, now(), EventType.ADD_UNIQUECONSTRAINT.toString(), msgEncoder.getSerializer().serialize(msg) ); event.setCatName(cols.get(0).isSetCatName() ? cols.get(0).getCatName() : DEFAULT_CATALOG_NAME); event.setDbName(cols.get(0).getTable_db()); event.setTableName(cols.get(0).getTable_name()); process(event, addUniqueConstraintEvent); } }
TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetCatName()) { optionals.set(0); if (struct.isSetCatName()) { oprot.writeString(struct.catName);
for (SQLForeignKey fkcol : foreignKeys) fkcol.setCatName(tbl.getCatName()); if (uniqueConstraints != null && !uniqueConstraints.isEmpty() && !uniqueConstraints.get(0).isSetCatName()) { for (SQLUniqueConstraint uccol : uniqueConstraints) uccol.setCatName(tbl.getCatName()); uniqueConstraints.get(i).setUk_name(constraintNames.get(primaryKeySize + foreignKeySize + i)); if (!uniqueConstraints.get(i).isSetCatName()) uniqueConstraints.get(i).setCatName(tbl.getCatName());
List<Object> list = new ArrayList<Object>(); boolean present_catName = true && (isSetCatName()); list.add(present_catName); if (present_catName)
/*** * @param addUniqueConstraintEvent add unique constraint event * @throws MetaException */ @Override public void onAddUniqueConstraint(AddUniqueConstraintEvent addUniqueConstraintEvent) throws MetaException { List<SQLUniqueConstraint> cols = addUniqueConstraintEvent.getUniqueConstraintCols(); if (cols.size() > 0) { NotificationEvent event = new NotificationEvent(0, now(), EventType.ADD_UNIQUECONSTRAINT.toString(), msgFactory .buildAddUniqueConstraintMessage(addUniqueConstraintEvent.getUniqueConstraintCols()).toString()); event.setCatName(cols.get(0).isSetCatName() ? cols.get(0).getCatName() : DEFAULT_CATALOG_NAME); event.setDbName(cols.get(0).getTable_db()); event.setTableName(cols.get(0).getTable_name()); process(event, addUniqueConstraintEvent); } }
lastComparison = Boolean.valueOf(isSetCatName()).compareTo(other.isSetCatName()); if (lastComparison != 0) { return lastComparison; if (isSetCatName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catName, other.catName); if (lastComparison != 0) {
return false; boolean this_present_catName = true && this.isSetCatName(); boolean that_present_catName = true && that.isSetCatName(); if (this_present_catName || that_present_catName) { if (!(this_present_catName && that_present_catName))
/** * Performs a deep copy on <i>other</i>. */ public SQLUniqueConstraint(SQLUniqueConstraint other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetCatName()) { this.catName = other.catName; } if (other.isSetTable_db()) { this.table_db = other.table_db; } if (other.isSetTable_name()) { this.table_name = other.table_name; } if (other.isSetColumn_name()) { this.column_name = other.column_name; } this.key_seq = other.key_seq; if (other.isSetUk_name()) { this.uk_name = other.uk_name; } this.enable_cstr = other.enable_cstr; this.validate_cstr = other.validate_cstr; this.rely_cstr = other.rely_cstr; }
boolean success = false; Exception ex = null; if (!uniqueConstraintCols.isEmpty() && !uniqueConstraintCols.get(0).isSetCatName()) { String defaultCat = getDefaultCatalog(conf); uniqueConstraintCols.forEach(pk -> pk.setCatName(defaultCat));
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case CAT_NAME: return isSetCatName(); case TABLE_DB: return isSetTable_db(); case TABLE_NAME: return isSetTable_name(); case COLUMN_NAME: return isSetColumn_name(); case KEY_SEQ: return isSetKey_seq(); case UK_NAME: return isSetUk_name(); case ENABLE_CSTR: return isSetEnable_cstr(); case VALIDATE_CSTR: return isSetValidate_cstr(); case RELY_CSTR: return isSetRely_cstr(); } throw new IllegalStateException(); }
TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetCatName()) { optionals.set(0); if (struct.isSetCatName()) { oprot.writeString(struct.catName);
for (SQLForeignKey fkcol : foreignKeys) fkcol.setCatName(tbl.getCatName()); if (uniqueConstraints != null && !uniqueConstraints.isEmpty() && !uniqueConstraints.get(0).isSetCatName()) { for (SQLUniqueConstraint uccol : uniqueConstraints) uccol.setCatName(tbl.getCatName()); uniqueConstraints.get(i).setUk_name(constraintNames.get(primaryKeySize + foreignKeySize + i)); if (!uniqueConstraints.get(i).isSetCatName()) uniqueConstraints.get(i).setCatName(tbl.getCatName());