Skip to content

Commit

Permalink
[HOPSWORKS-2680] Save code (jupyter/job) that it's used to create a f…
Browse files Browse the repository at this point in the history
…eature group (#642)
  • Loading branch information
bubriks authored Aug 8, 2021
1 parent 2a2aa53 commit 019cf29
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
26 changes: 26 additions & 0 deletions files/default/sql/ddl/3.0.0__initial_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,32 @@ CREATE TABLE `feature_store_statistic` (
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `feature_store_code`
--

/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `feature_store_code` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`commit_time` DATETIME(3) NOT NULL,
`inode_pid` BIGINT(20) NOT NULL,
`inode_name` VARCHAR(255) COLLATE latin1_general_cs NOT NULL,
`partition_id` BIGINT(20) NOT NULL,
`feature_group_id` INT(11),
`feature_group_commit_id` BIGINT(20),
`training_dataset_id`INT(11),
`application_id`VARCHAR(50),
PRIMARY KEY (`id`),
KEY `feature_group_id` (`feature_group_id`),
KEY `training_dataset_id` (`training_dataset_id`),
KEY `feature_group_commit_id_fk` (`feature_group_id`, `feature_group_commit_id`),
CONSTRAINT `fg_fk_fsc` FOREIGN KEY (`feature_group_id`) REFERENCES `feature_group` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `fg_ci_fk_fsc` FOREIGN KEY (`feature_group_id`, `feature_group_commit_id`) REFERENCES `feature_group_commit` (`feature_group_id`, `commit_id`) ON DELETE SET NULL ON UPDATE NO ACTION,
CONSTRAINT `td_fk_fsc` FOREIGN KEY (`training_dataset_id`) REFERENCES `training_dataset` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `inode_fk_fsc` FOREIGN KEY (`inode_pid`,`inode_name`,`partition_id`) REFERENCES `hops`.`hdfs_inodes` (`parent_id`,`name`,`partition_id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

--
-- Table structure for table `files_to_remove`
--
Expand Down
20 changes: 20 additions & 0 deletions files/default/sql/ddl/updates/3.0.0.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
CREATE TABLE IF NOT EXISTS `feature_store_code` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`commit_time` DATETIME(3) NOT NULL,
`inode_pid` BIGINT(20) NOT NULL,
`inode_name` VARCHAR(255) COLLATE latin1_general_cs NOT NULL,
`partition_id` BIGINT(20) NOT NULL,
`feature_group_id` INT(11),
`feature_group_commit_id` BIGINT(20),
`training_dataset_id`INT(11),
`application_id`VARCHAR(50),
PRIMARY KEY (`id`),
KEY `feature_group_id` (`feature_group_id`),
KEY `training_dataset_id` (`training_dataset_id`),
KEY `feature_group_commit_id_fk` (`feature_group_id`, `feature_group_commit_id`),
CONSTRAINT `fg_fk_fsc` FOREIGN KEY (`feature_group_id`) REFERENCES `feature_group` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `fg_ci_fk_fsc` FOREIGN KEY (`feature_group_id`, `feature_group_commit_id`) REFERENCES `feature_group_commit` (`feature_group_id`, `commit_id`) ON DELETE SET NULL ON UPDATE NO ACTION,
CONSTRAINT `td_fk_fsc` FOREIGN KEY (`training_dataset_id`) REFERENCES `training_dataset` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `inode_fk_fsc` FOREIGN KEY (`inode_pid`,`inode_name`,`partition_id`) REFERENCES `hops`.`hdfs_inodes` (`parent_id`,`name`,`partition_id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

ALTER TABLE `hopsworks`.`on_demand_feature` ADD COLUMN `idx` int(11) NOT NULL DEFAULT 0;

DROP TABLE `hopsworks`.`ndb_backup`;
Expand Down
2 changes: 2 additions & 0 deletions files/default/sql/ddl/updates/undo/3.0.0__undo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ ALTER TABLE `hopsworks`.`dataset_shared_with` DROP CONSTRAINT `fk_accepted_by`;

ALTER TABLE `hopsworks`.`dataset_shared_with` DROP COLUMN `shared_by`;
ALTER TABLE `hopsworks`.`dataset_shared_with` DROP COLUMN `accepted_by`;

DROP TABLE IF EXISTS `feature_store_code`;

0 comments on commit 019cf29

Please sign in to comment.