diff --git a/ci/scripts/gen-integration-test-yaml.py b/ci/scripts/gen-integration-test-yaml.py index c0e270988da56..95e07ffccf0cc 100644 --- a/ci/scripts/gen-integration-test-yaml.py +++ b/ci/scripts/gen-integration-test-yaml.py @@ -30,6 +30,7 @@ 'elasticsearch-sink': ['json'], 'redis-sink': ['json'], 'big-query-sink': ['json'], + 'mindsdb': ['json'], 'vector': ['json'], } diff --git a/integration_tests/mindsdb/data_check b/integration_tests/mindsdb/data_check new file mode 100644 index 0000000000000..44e9222c929df --- /dev/null +++ b/integration_tests/mindsdb/data_check @@ -0,0 +1 @@ +home_rentals \ No newline at end of file diff --git a/integration_tests/mindsdb/docker-compose.yml b/integration_tests/mindsdb/docker-compose.yml new file mode 100644 index 0000000000000..c6eeec5c75ee6 --- /dev/null +++ b/integration_tests/mindsdb/docker-compose.yml @@ -0,0 +1,63 @@ +--- +version: "3" +services: + risingwave-standalone: + extends: + file: ../../docker/docker-compose.yml + service: risingwave-standalone + etcd-0: + extends: + file: ../../docker/docker-compose.yml + service: etcd-0 + grafana-0: + extends: + file: ../../docker/docker-compose.yml + service: grafana-0 + minio-0: + extends: + file: ../../docker/docker-compose.yml + service: minio-0 + prometheus-0: + extends: + file: ../../docker/docker-compose.yml + service: prometheus-0 + + # === MindsDB === + mindsdb: + image: mindsdb/mindsdb:23.9.3.0 + command: bash -c "python3 -m mindsdb --config=/root/mindsdb_config.json --api=http,postgres" + ports: + - 47334:47334 # http + - 55432:55432 # postgres + volumes: + - "./mdb_config.json:/root/mindsdb_config.json" + container_name: mindsdb + + prepare_data: + image: postgres + depends_on: + - risingwave-standalone + - mindsdb + command: + - /bin/sh + - -c + - /prepare_data.sh + volumes: + - "./prepare_risingwave.sql:/prepare_risingwave.sql" + - "./prepare_mindsdb.sql:/prepare_mindsdb.sql" + - "./prepare_data.sh:/prepare_data.sh" + container_name: prepare_data + restart: on-failure + +volumes: + risingwave-standalone: + external: false + etcd-0: + external: false + grafana-0: + external: false + minio-0: + external: false + prometheus-0: + external: false +name: risingwave-compose diff --git a/integration_tests/mindsdb/mdb_config.json b/integration_tests/mindsdb/mdb_config.json new file mode 100644 index 0000000000000..4f5a97b834351 --- /dev/null +++ b/integration_tests/mindsdb/mdb_config.json @@ -0,0 +1,28 @@ +{ + "config_version": "1.4", + "storage_dir": "/root/mdb_storage", + "log": { + "level": { + "console": "ERROR", + "file": "WARNING", + "db": "WARNING" + } + }, + "debug": false, + "integrations": {}, + "auth": { + "username": "mindsdb", + "password": null + }, + "api": { + "postgres": { + "host": "0.0.0.0", + "port": "55432", + "database": "mindsdb" + }, + "http": { + "host": "0.0.0.0", + "port": "47334" + } + } +} diff --git a/integration_tests/mindsdb/prepare_data.sh b/integration_tests/mindsdb/prepare_data.sh new file mode 100755 index 0000000000000..e47ac38f90c7b --- /dev/null +++ b/integration_tests/mindsdb/prepare_data.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -ex + +TABLE_NAME=home_rentals + +# Check if the table exists in the database +if psql -h risingwave-standalone -p 4566 -U root -d dev -tAc "SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $TABLE_NAME);"; then + echo "Table $TABLE_NAME exists" +else + echo "Table $TABLE_NAME does not exist" + # Create a new table and insert records + psql -h risingwave-standalone -p 4566 -U root -d dev -f ./prepare_risingwave.sql +fi + +psql -h mindsdb -p 55432 -U mindsdb -d mindsdb -f ./prepare_mindsdb.sql diff --git a/integration_tests/mindsdb/prepare_mindsdb.sql b/integration_tests/mindsdb/prepare_mindsdb.sql new file mode 100644 index 0000000000000..9e4033beb9301 --- /dev/null +++ b/integration_tests/mindsdb/prepare_mindsdb.sql @@ -0,0 +1,13 @@ +CREATE DATABASE example_data +WITH ENGINE = "postgres", +PARAMETERS = { + "user": "root", + "host": "risingwave-standalone", + "port": "4566", + "database": "dev" +}; + +CREATE MODEL mindsdb.home_rentals_model +FROM example_data + (SELECT * FROM home_rentals) +PREDICT rental_price; diff --git a/integration_tests/mindsdb/prepare_risingwave.sql b/integration_tests/mindsdb/prepare_risingwave.sql new file mode 100644 index 0000000000000..8cd41ad11ec42 --- /dev/null +++ b/integration_tests/mindsdb/prepare_risingwave.sql @@ -0,0 +1,538 @@ +-- INFO: Credit to Mindsdb (https://github.com/mindsdb/mindsdb) +-- This data comes from the postgresql dump maintained by mindsdb: +-- https://docs.mindsdb.com/quickstart#3-connect-a-database-using-create-database +-- Part of the original data in the mindsdb repo: +-- https://github.com/mindsdb/mindsdb/blob/staging/docker/db_images/mysql/home_rentals.csv + + +-- +-- PostgreSQL database dump +-- +-- +-- Name: home_rentals; Type: TABLE; Schema: public; Owner: dev +-- + +CREATE TABLE IF NOT EXISTS home_rentals ( + number_of_rooms integer, + number_of_bathrooms integer, + sqft integer, + location varchar, + days_on_market integer, + neighborhood varchar, + rental_price integer +); + +-- +-- Data for Name: home_rentals; Type: TABLE DATA; Schema: public; Owner: dev +-- + +INSERT INTO home_rentals VALUES (2, 1, 917, 'great', 13, 'berkeley_hills', 3901); +INSERT INTO home_rentals VALUES (0, 1, 194, 'great', 10, 'berkeley_hills', 2042); +INSERT INTO home_rentals VALUES (1, 1, 543, 'poor', 18, 'westbrae', 1871); +INSERT INTO home_rentals VALUES (2, 1, 503, 'good', 10, 'downtown', 3026); +INSERT INTO home_rentals VALUES (3, 2, 1066, 'good', 13, 'thowsand_oaks', 4774); +INSERT INTO home_rentals VALUES (3, 2, 816, 'poor', 25, 'westbrae', 4382); +INSERT INTO home_rentals VALUES (0, 1, 461, 'great', 6, 'berkeley_hills', 2269); +INSERT INTO home_rentals VALUES (1, 1, 333, 'great', 6, 'south_side', 2284); +INSERT INTO home_rentals VALUES (3, 2, 1124, 'great', 9, 'south_side', 5420); +INSERT INTO home_rentals VALUES (3, 2, 1204, 'good', 7, 'downtown', 5016); +INSERT INTO home_rentals VALUES (0, 1, 538, 'poor', 43, 'alcatraz_ave', 1421); +INSERT INTO home_rentals VALUES (2, 1, 890, 'good', 6, 'thowsand_oaks', 3476); +INSERT INTO home_rentals VALUES (3, 2, 975, 'great', 6, 'south_side', 5271); +INSERT INTO home_rentals VALUES (2, 1, 564, 'good', 13, 'downtown', 3001); +INSERT INTO home_rentals VALUES (3, 2, 953, 'good', 10, 'thowsand_oaks', 4682); +INSERT INTO home_rentals VALUES (1, 1, 493, 'poor', 24, 'alcatraz_ave', 1783); +INSERT INTO home_rentals VALUES (1, 1, 601, 'poor', 47, 'alcatraz_ave', 1548); +INSERT INTO home_rentals VALUES (0, 1, 191, 'good', 12, 'downtown', 1492); +INSERT INTO home_rentals VALUES (0, 1, 511, 'great', 1, 'south_side', 2431); +INSERT INTO home_rentals VALUES (3, 2, 916, 'poor', 36, 'westbrae', 4237); +INSERT INTO home_rentals VALUES (2, 1, 624, 'poor', 47, 'alcatraz_ave', 2590); +INSERT INTO home_rentals VALUES (3, 2, 1006, 'poor', 44, 'westbrae', 4204); +INSERT INTO home_rentals VALUES (3, 2, 1236, 'good', 11, 'thowsand_oaks', 4993); +INSERT INTO home_rentals VALUES (0, 1, 102, 'great', 8, 'berkeley_hills', 1895); +INSERT INTO home_rentals VALUES (1, 1, 741, 'good', 3, 'downtown', 2226); +INSERT INTO home_rentals VALUES (3, 2, 965, 'good', 4, 'thowsand_oaks', 4811); +INSERT INTO home_rentals VALUES (0, 1, 524, 'great', 13, 'south_side', 2317); +INSERT INTO home_rentals VALUES (0, 1, 497, 'good', 4, 'thowsand_oaks', 1877); +INSERT INTO home_rentals VALUES (0, 1, 272, 'poor', 57, 'westbrae', 1034); +INSERT INTO home_rentals VALUES (3, 2, 800, 'good', 2, 'thowsand_oaks', 4618); +INSERT INTO home_rentals VALUES (0, 1, 438, 'great', 8, 'berkeley_hills', 2273); +INSERT INTO home_rentals VALUES (1, 1, 435, 'good', 8, 'downtown', 1855); +INSERT INTO home_rentals VALUES (1, 1, 625, 'poor', 42, 'westbrae', 1624); +INSERT INTO home_rentals VALUES (3, 2, 1039, 'good', 1, 'thowsand_oaks', 4887); +INSERT INTO home_rentals VALUES (0, 1, 535, 'good', 14, 'thowsand_oaks', 1830); +INSERT INTO home_rentals VALUES (1, 1, 568, 'poor', 32, 'alcatraz_ave', 1680); +INSERT INTO home_rentals VALUES (2, 1, 852, 'good', 12, 'thowsand_oaks', 3369); +INSERT INTO home_rentals VALUES (3, 2, 1219, 'great', 3, 'south_side', 5510); +INSERT INTO home_rentals VALUES (2, 1, 847, 'good', 7, 'thowsand_oaks', 3419); +INSERT INTO home_rentals VALUES (3, 2, 1140, 'good', 10, 'thowsand_oaks', 4853); +INSERT INTO home_rentals VALUES (0, 1, 240, 'poor', 45, 'alcatraz_ave', 1094); +INSERT INTO home_rentals VALUES (3, 2, 1171, 'poor', 25, 'alcatraz_ave', 4727); +INSERT INTO home_rentals VALUES (0, 1, 150, 'poor', 43, 'westbrae', 1033); +INSERT INTO home_rentals VALUES (1, 1, 648, 'poor', 62, 'alcatraz_ave', 1426); +INSERT INTO home_rentals VALUES (3, 2, 872, 'poor', 53, 'alcatraz_ave', 3933); +INSERT INTO home_rentals VALUES (2, 1, 792, 'poor', 33, 'alcatraz_ave', 2935); +INSERT INTO home_rentals VALUES (1, 1, 600, 'good', 11, 'downtown', 2009); +INSERT INTO home_rentals VALUES (0, 1, 228, 'great', 10, 'berkeley_hills', 2067); +INSERT INTO home_rentals VALUES (2, 1, 606, 'great', 4, 'south_side', 3675); +INSERT INTO home_rentals VALUES (1, 1, 736, 'poor', 30, 'westbrae', 1853); +INSERT INTO home_rentals VALUES (2, 1, 587, 'good', 14, 'thowsand_oaks', 3062); +INSERT INTO home_rentals VALUES (1, 1, 363, 'good', 12, 'downtown', 1765); +INSERT INTO home_rentals VALUES (1, 1, 398, 'great', 11, 'south_side', 2272); +INSERT INTO home_rentals VALUES (3, 2, 1150, 'good', 2, 'downtown', 4982); +INSERT INTO home_rentals VALUES (0, 1, 361, 'poor', 56, 'alcatraz_ave', 1155); +INSERT INTO home_rentals VALUES (2, 1, 938, 'poor', 50, 'westbrae', 2827); +INSERT INTO home_rentals VALUES (1, 1, 744, 'poor', 37, 'alcatraz_ave', 1853); +INSERT INTO home_rentals VALUES (3, 2, 863, 'great', 4, 'berkeley_hills', 5151); +INSERT INTO home_rentals VALUES (0, 1, 258, 'good', 10, 'downtown', 1544); +INSERT INTO home_rentals VALUES (0, 1, 410, 'good', 3, 'downtown', 1740); +INSERT INTO home_rentals VALUES (0, 1, 110, 'poor', 20, 'alcatraz_ave', 1315); +INSERT INTO home_rentals VALUES (3, 2, 936, 'good', 2, 'downtown', 4738); +INSERT INTO home_rentals VALUES (2, 1, 932, 'poor', 53, 'alcatraz_ave', 2807); +INSERT INTO home_rentals VALUES (2, 1, 587, 'poor', 63, 'alcatraz_ave', 2350); +INSERT INTO home_rentals VALUES (0, 1, 505, 'good', 2, 'downtown', 1863); +INSERT INTO home_rentals VALUES (3, 2, 860, 'good', 4, 'downtown', 4631); +INSERT INTO home_rentals VALUES (3, 2, 1088, 'poor', 52, 'westbrae', 4111); +INSERT INTO home_rentals VALUES (1, 1, 686, 'good', 4, 'thowsand_oaks', 2175); +INSERT INTO home_rentals VALUES (2, 1, 525, 'good', 3, 'thowsand_oaks', 3058); +INSERT INTO home_rentals VALUES (3, 2, 939, 'poor', 29, 'westbrae', 4403); +INSERT INTO home_rentals VALUES (1, 1, 380, 'poor', 30, 'alcatraz_ave', 1545); +INSERT INTO home_rentals VALUES (0, 1, 267, 'good', 2, 'thowsand_oaks', 1635); +INSERT INTO home_rentals VALUES (0, 1, 103, 'good', 12, 'thowsand_oaks', 1413); +INSERT INTO home_rentals VALUES (3, 2, 952, 'great', 7, 'south_side', 5207); +INSERT INTO home_rentals VALUES (1, 1, 489, 'good', 9, 'downtown', 1916); +INSERT INTO home_rentals VALUES (2, 1, 655, 'poor', 32, 'alcatraz_ave', 2850); +INSERT INTO home_rentals VALUES (1, 1, 490, 'great', 6, 'berkeley_hills', 2452); +INSERT INTO home_rentals VALUES (1, 1, 327, 'poor', 63, 'westbrae', 1097); +INSERT INTO home_rentals VALUES (0, 1, 459, 'poor', 37, 'westbrae', 1414); +INSERT INTO home_rentals VALUES (1, 1, 719, 'poor', 64, 'alcatraz_ave', 1455); +INSERT INTO home_rentals VALUES (0, 1, 144, 'great', 4, 'south_side', 1979); +INSERT INTO home_rentals VALUES (1, 1, 407, 'good', 3, 'downtown', 1894); +INSERT INTO home_rentals VALUES (2, 1, 871, 'good', 3, 'downtown', 3434); +INSERT INTO home_rentals VALUES (3, 2, 1009, 'good', 10, 'thowsand_oaks', 4760); +INSERT INTO home_rentals VALUES (3, 2, 913, 'great', 4, 'berkeley_hills', 5269); +INSERT INTO home_rentals VALUES (3, 2, 972, 'good', 5, 'thowsand_oaks', 4794); +INSERT INTO home_rentals VALUES (0, 1, 354, 'great', 13, 'berkeley_hills', 2162); +INSERT INTO home_rentals VALUES (2, 1, 921, 'poor', 53, 'alcatraz_ave', 2826); +INSERT INTO home_rentals VALUES (2, 1, 666, 'great', 10, 'berkeley_hills', 3671); +INSERT INTO home_rentals VALUES (3, 2, 1087, 'good', 2, 'downtown', 4898); +INSERT INTO home_rentals VALUES (2, 1, 549, 'poor', 19, 'alcatraz_ave', 2997); +INSERT INTO home_rentals VALUES (2, 1, 653, 'good', 9, 'downtown', 3147); +INSERT INTO home_rentals VALUES (1, 1, 300, 'good', 5, 'thowsand_oaks', 1739); +INSERT INTO home_rentals VALUES (3, 2, 1190, 'poor', 58, 'westbrae', 4123); +INSERT INTO home_rentals VALUES (1, 1, 386, 'poor', 56, 'alcatraz_ave', 1248); +INSERT INTO home_rentals VALUES (0, 1, 509, 'poor', 18, 'westbrae', 1725); +INSERT INTO home_rentals VALUES (1, 1, 568, 'poor', 15, 'alcatraz_ave', 1885); +INSERT INTO home_rentals VALUES (1, 1, 741, 'good', 12, 'downtown', 2170); +INSERT INTO home_rentals VALUES (3, 2, 1054, 'poor', 46, 'westbrae', 4181); +INSERT INTO home_rentals VALUES (0, 1, 390, 'great', 4, 'south_side', 2230); +INSERT INTO home_rentals VALUES (1, 1, 440, 'good', 6, 'thowsand_oaks', 1847); +INSERT INTO home_rentals VALUES (3, 2, 1235, 'great', 1, 'berkeley_hills', 5602); +INSERT INTO home_rentals VALUES (0, 1, 340, 'good', 5, 'downtown', 1722); +INSERT INTO home_rentals VALUES (1, 1, 533, 'poor', 26, 'westbrae', 1727); +INSERT INTO home_rentals VALUES (2, 1, 934, 'good', 2, 'thowsand_oaks', 3529); +INSERT INTO home_rentals VALUES (2, 1, 891, 'good', 9, 'downtown', 3371); +INSERT INTO home_rentals VALUES (2, 1, 846, 'good', 12, 'thowsand_oaks', 3282); +INSERT INTO home_rentals VALUES (1, 1, 624, 'poor', 31, 'westbrae', 1806); +INSERT INTO home_rentals VALUES (2, 1, 879, 'great', 10, 'south_side', 3923); +INSERT INTO home_rentals VALUES (2, 1, 626, 'great', 4, 'south_side', 3693); +INSERT INTO home_rentals VALUES (3, 2, 1186, 'poor', 62, 'westbrae', 4064); +INSERT INTO home_rentals VALUES (0, 1, 371, 'good', 13, 'downtown', 1639); +INSERT INTO home_rentals VALUES (3, 2, 1247, 'good', 11, 'thowsand_oaks', 4974); +INSERT INTO home_rentals VALUES (1, 1, 519, 'good', 8, 'thowsand_oaks', 1956); +INSERT INTO home_rentals VALUES (1, 1, 748, 'poor', 62, 'westbrae', 1493); +INSERT INTO home_rentals VALUES (2, 1, 892, 'poor', 18, 'westbrae', 3303); +INSERT INTO home_rentals VALUES (3, 2, 1102, 'poor', 64, 'alcatraz_ave', 3918); +INSERT INTO home_rentals VALUES (1, 1, 630, 'great', 11, 'south_side', 2543); +INSERT INTO home_rentals VALUES (0, 1, 454, 'poor', 47, 'westbrae', 1279); +INSERT INTO home_rentals VALUES (1, 1, 409, 'great', 4, 'south_side', 2380); +INSERT INTO home_rentals VALUES (1, 1, 727, 'good', 11, 'thowsand_oaks', 2078); +INSERT INTO home_rentals VALUES (0, 1, 489, 'great', 6, 'berkeley_hills', 2307); +INSERT INTO home_rentals VALUES (2, 1, 932, 'good', 10, 'downtown', 3447); +INSERT INTO home_rentals VALUES (3, 2, 1226, 'great', 11, 'berkeley_hills', 5436); +INSERT INTO home_rentals VALUES (1, 1, 714, 'good', 8, 'downtown', 2135); +INSERT INTO home_rentals VALUES (1, 1, 432, 'good', 14, 'thowsand_oaks', 1782); +INSERT INTO home_rentals VALUES (3, 2, 1097, 'good', 7, 'thowsand_oaks', 4832); +INSERT INTO home_rentals VALUES (0, 1, 503, 'good', 9, 'thowsand_oaks', 1839); +INSERT INTO home_rentals VALUES (1, 1, 698, 'poor', 23, 'westbrae', 1986); +INSERT INTO home_rentals VALUES (0, 1, 245, 'great', 4, 'south_side', 2094); +INSERT INTO home_rentals VALUES (3, 2, 1104, 'poor', 16, 'westbrae', 4750); +INSERT INTO home_rentals VALUES (2, 1, 882, 'good', 13, 'thowsand_oaks', 3322); +INSERT INTO home_rentals VALUES (1, 1, 603, 'great', 10, 'south_side', 2508); +INSERT INTO home_rentals VALUES (1, 1, 666, 'poor', 38, 'alcatraz_ave', 1711); +INSERT INTO home_rentals VALUES (3, 2, 1216, 'great', 5, 'south_side', 5495); +INSERT INTO home_rentals VALUES (0, 1, 225, 'good', 3, 'thowsand_oaks', 1626); +INSERT INTO home_rentals VALUES (3, 2, 1157, 'good', 10, 'downtown', 4862); +INSERT INTO home_rentals VALUES (3, 2, 874, 'good', 1, 'thowsand_oaks', 4671); +INSERT INTO home_rentals VALUES (0, 1, 312, 'poor', 26, 'westbrae', 1461); +INSERT INTO home_rentals VALUES (0, 1, 519, 'good', 12, 'thowsand_oaks', 1760); +INSERT INTO home_rentals VALUES (2, 1, 896, 'good', 5, 'thowsand_oaks', 3483); +INSERT INTO home_rentals VALUES (2, 1, 885, 'poor', 50, 'westbrae', 2795); +INSERT INTO home_rentals VALUES (0, 1, 157, 'poor', 36, 'westbrae', 1134); +INSERT INTO home_rentals VALUES (0, 1, 426, 'good', 3, 'downtown', 1783); +INSERT INTO home_rentals VALUES (2, 1, 679, 'good', 1, 'downtown', 3251); +INSERT INTO home_rentals VALUES (3, 2, 1114, 'great', 9, 'south_side', 5363); +INSERT INTO home_rentals VALUES (2, 1, 659, 'good', 14, 'thowsand_oaks', 3166); +INSERT INTO home_rentals VALUES (1, 1, 309, 'good', 2, 'thowsand_oaks', 1783); +INSERT INTO home_rentals VALUES (1, 1, 588, 'good', 14, 'downtown', 1961); +INSERT INTO home_rentals VALUES (1, 1, 418, 'good', 3, 'downtown', 1907); +INSERT INTO home_rentals VALUES (3, 2, 1133, 'good', 9, 'downtown', 4874); +INSERT INTO home_rentals VALUES (0, 1, 332, 'good', 6, 'downtown', 1697); +INSERT INTO home_rentals VALUES (3, 2, 808, 'good', 1, 'downtown', 4677); +INSERT INTO home_rentals VALUES (2, 1, 891, 'good', 3, 'downtown', 3504); +INSERT INTO home_rentals VALUES (3, 2, 1024, 'poor', 17, 'alcatraz_ave', 4745); +INSERT INTO home_rentals VALUES (2, 1, 640, 'good', 8, 'downtown', 3153); +INSERT INTO home_rentals VALUES (3, 2, 1038, 'great', 8, 'berkeley_hills', 5318); +INSERT INTO home_rentals VALUES (1, 1, 305, 'good', 14, 'downtown', 1675); +INSERT INTO home_rentals VALUES (3, 2, 819, 'great', 12, 'south_side', 5049); +INSERT INTO home_rentals VALUES (1, 1, 499, 'poor', 38, 'westbrae', 1564); +INSERT INTO home_rentals VALUES (3, 2, 1056, 'poor', 54, 'westbrae', 4108); +INSERT INTO home_rentals VALUES (2, 1, 773, 'good', 12, 'thowsand_oaks', 3207); +INSERT INTO home_rentals VALUES (3, 2, 816, 'good', 8, 'downtown', 4594); +INSERT INTO home_rentals VALUES (1, 1, 649, 'great', 5, 'berkeley_hills', 2563); +INSERT INTO home_rentals VALUES (0, 1, 399, 'good', 9, 'thowsand_oaks', 1672); +INSERT INTO home_rentals VALUES (2, 1, 550, 'good', 1, 'downtown', 3155); +INSERT INTO home_rentals VALUES (1, 1, 472, 'poor', 17, 'alcatraz_ave', 1771); +INSERT INTO home_rentals VALUES (1, 1, 729, 'poor', 63, 'alcatraz_ave', 1420); +INSERT INTO home_rentals VALUES (2, 1, 935, 'great', 13, 'south_side', 3880); +INSERT INTO home_rentals VALUES (0, 1, 381, 'poor', 28, 'westbrae', 1459); +INSERT INTO home_rentals VALUES (2, 1, 564, 'good', 7, 'thowsand_oaks', 3119); +INSERT INTO home_rentals VALUES (3, 2, 865, 'good', 0, 'downtown', 4742); +INSERT INTO home_rentals VALUES (2, 1, 805, 'good', 8, 'downtown', 3358); +INSERT INTO home_rentals VALUES (2, 1, 942, 'poor', 59, 'westbrae', 2744); +INSERT INTO home_rentals VALUES (0, 1, 145, 'great', 1, 'berkeley_hills', 2049); +INSERT INTO home_rentals VALUES (1, 1, 477, 'poor', 64, 'westbrae', 1250); +INSERT INTO home_rentals VALUES (1, 1, 721, 'great', 3, 'south_side', 2701); +INSERT INTO home_rentals VALUES (1, 1, 447, 'good', 12, 'downtown', 1784); +INSERT INTO home_rentals VALUES (1, 1, 350, 'good', 11, 'downtown', 1759); +INSERT INTO home_rentals VALUES (0, 1, 415, 'poor', 39, 'westbrae', 1416); +INSERT INTO home_rentals VALUES (2, 1, 850, 'good', 2, 'downtown', 3437); +INSERT INTO home_rentals VALUES (3, 2, 1098, 'great', 10, 'south_side', 5386); +INSERT INTO home_rentals VALUES (2, 1, 538, 'good', 10, 'thowsand_oaks', 2988); +INSERT INTO home_rentals VALUES (1, 1, 443, 'good', 10, 'downtown', 1820); +INSERT INTO home_rentals VALUES (2, 1, 505, 'good', 2, 'thowsand_oaks', 3080); +INSERT INTO home_rentals VALUES (2, 1, 533, 'great', 2, 'south_side', 3645); +INSERT INTO home_rentals VALUES (3, 2, 1055, 'good', 0, 'downtown', 4933); +INSERT INTO home_rentals VALUES (3, 2, 1179, 'good', 7, 'downtown', 4977); +INSERT INTO home_rentals VALUES (1, 1, 733, 'poor', 56, 'westbrae', 1550); +INSERT INTO home_rentals VALUES (2, 1, 726, 'good', 11, 'downtown', 3242); +INSERT INTO home_rentals VALUES (0, 1, 481, 'poor', 49, 'westbrae', 1307); +INSERT INTO home_rentals VALUES (1, 1, 565, 'good', 6, 'thowsand_oaks', 2038); +INSERT INTO home_rentals VALUES (1, 1, 438, 'great', 6, 'south_side', 2332); +INSERT INTO home_rentals VALUES (3, 2, 944, 'great', 2, 'berkeley_hills', 5321); +INSERT INTO home_rentals VALUES (0, 1, 150, 'great', 3, 'berkeley_hills', 2041); +INSERT INTO home_rentals VALUES (0, 1, 500, 'poor', 27, 'alcatraz_ave', 1609); +INSERT INTO home_rentals VALUES (3, 2, 871, 'good', 11, 'downtown', 4626); +INSERT INTO home_rentals VALUES (0, 1, 379, 'poor', 28, 'alcatraz_ave', 1509); +INSERT INTO home_rentals VALUES (3, 2, 1001, 'poor', 57, 'westbrae', 3930); +INSERT INTO home_rentals VALUES (1, 1, 435, 'poor', 49, 'alcatraz_ave', 1372); +INSERT INTO home_rentals VALUES (1, 1, 519, 'great', 6, 'berkeley_hills', 2453); +INSERT INTO home_rentals VALUES (0, 1, 391, 'poor', 53, 'alcatraz_ave', 1162); +INSERT INTO home_rentals VALUES (2, 1, 557, 'poor', 29, 'westbrae', 2851); +INSERT INTO home_rentals VALUES (2, 1, 815, 'good', 0, 'thowsand_oaks', 3436); +INSERT INTO home_rentals VALUES (3, 2, 831, 'good', 4, 'thowsand_oaks', 4621); +INSERT INTO home_rentals VALUES (3, 2, 850, 'good', 1, 'thowsand_oaks', 4718); +INSERT INTO home_rentals VALUES (2, 1, 853, 'poor', 40, 'westbrae', 2923); +INSERT INTO home_rentals VALUES (2, 1, 697, 'good', 3, 'thowsand_oaks', 3240); +INSERT INTO home_rentals VALUES (0, 1, 141, 'poor', 59, 'westbrae', 866); +INSERT INTO home_rentals VALUES (0, 1, 435, 'poor', 26, 'westbrae', 1534); +INSERT INTO home_rentals VALUES (0, 1, 425, 'poor', 34, 'westbrae', 1408); +INSERT INTO home_rentals VALUES (1, 1, 702, 'good', 13, 'thowsand_oaks', 2068); +INSERT INTO home_rentals VALUES (0, 1, 150, 'poor', 60, 'westbrae', 880); +INSERT INTO home_rentals VALUES (1, 1, 522, 'poor', 30, 'westbrae', 1678); +INSERT INTO home_rentals VALUES (0, 1, 105, 'poor', 28, 'alcatraz_ave', 1187); +INSERT INTO home_rentals VALUES (1, 1, 435, 'good', 6, 'downtown', 1884); +INSERT INTO home_rentals VALUES (1, 1, 627, 'good', 2, 'downtown', 2060); +INSERT INTO home_rentals VALUES (0, 1, 539, 'good', 3, 'downtown', 1899); +INSERT INTO home_rentals VALUES (2, 1, 682, 'great', 5, 'south_side', 3705); +INSERT INTO home_rentals VALUES (3, 2, 1030, 'great', 14, 'south_side', 5260); +INSERT INTO home_rentals VALUES (0, 1, 499, 'good', 5, 'thowsand_oaks', 1839); +INSERT INTO home_rentals VALUES (2, 1, 729, 'great', 2, 'south_side', 3856); +INSERT INTO home_rentals VALUES (2, 1, 878, 'great', 8, 'south_side', 3861); +INSERT INTO home_rentals VALUES (0, 1, 397, 'great', 11, 'south_side', 2168); +INSERT INTO home_rentals VALUES (3, 2, 937, 'good', 2, 'downtown', 4736); +INSERT INTO home_rentals VALUES (3, 2, 983, 'great', 14, 'berkeley_hills', 5145); +INSERT INTO home_rentals VALUES (0, 1, 484, 'great', 10, 'south_side', 2271); +INSERT INTO home_rentals VALUES (3, 2, 1022, 'poor', 60, 'westbrae', 3956); +INSERT INTO home_rentals VALUES (0, 1, 279, 'good', 11, 'thowsand_oaks', 1601); +INSERT INTO home_rentals VALUES (0, 1, 231, 'good', 2, 'downtown', 1650); +INSERT INTO home_rentals VALUES (0, 1, 525, 'good', 0, 'downtown', 1875); +INSERT INTO home_rentals VALUES (0, 1, 492, 'poor', 64, 'alcatraz_ave', 1153); +INSERT INTO home_rentals VALUES (2, 1, 735, 'poor', 33, 'alcatraz_ave', 2902); +INSERT INTO home_rentals VALUES (2, 1, 738, 'good', 11, 'thowsand_oaks', 3277); +INSERT INTO home_rentals VALUES (2, 1, 906, 'good', 9, 'downtown', 3421); +INSERT INTO home_rentals VALUES (3, 2, 1058, 'great', 11, 'berkeley_hills', 5336); +INSERT INTO home_rentals VALUES (2, 1, 911, 'good', 6, 'downtown', 3492); +INSERT INTO home_rentals VALUES (1, 1, 580, 'poor', 45, 'alcatraz_ave', 1513); +INSERT INTO home_rentals VALUES (3, 2, 871, 'poor', 31, 'westbrae', 4300); +INSERT INTO home_rentals VALUES (1, 1, 354, 'good', 0, 'downtown', 1859); +INSERT INTO home_rentals VALUES (2, 1, 792, 'good', 5, 'downtown', 3390); +INSERT INTO home_rentals VALUES (0, 1, 390, 'poor', 26, 'westbrae', 1512); +INSERT INTO home_rentals VALUES (0, 1, 144, 'good', 5, 'thowsand_oaks', 1531); +INSERT INTO home_rentals VALUES (3, 2, 1239, 'poor', 24, 'alcatraz_ave', 4836); +INSERT INTO home_rentals VALUES (0, 1, 541, 'good', 8, 'downtown', 1894); +INSERT INTO home_rentals VALUES (3, 2, 1234, 'good', 3, 'downtown', 5052); +INSERT INTO home_rentals VALUES (3, 2, 1109, 'good', 9, 'downtown', 4906); +INSERT INTO home_rentals VALUES (0, 1, 310, 'poor', 20, 'westbrae', 1465); +INSERT INTO home_rentals VALUES (3, 2, 1145, 'good', 11, 'downtown', 4929); +INSERT INTO home_rentals VALUES (0, 1, 547, 'good', 2, 'downtown', 1936); +INSERT INTO home_rentals VALUES (0, 1, 369, 'poor', 42, 'alcatraz_ave', 1250); +INSERT INTO home_rentals VALUES (2, 1, 845, 'poor', 37, 'alcatraz_ave', 2994); +INSERT INTO home_rentals VALUES (2, 1, 803, 'good', 8, 'downtown', 3279); +INSERT INTO home_rentals VALUES (0, 1, 322, 'good', 13, 'downtown', 1573); +INSERT INTO home_rentals VALUES (3, 2, 928, 'poor', 47, 'alcatraz_ave', 4090); +INSERT INTO home_rentals VALUES (2, 1, 553, 'good', 1, 'thowsand_oaks', 3177); +INSERT INTO home_rentals VALUES (0, 1, 398, 'great', 12, 'berkeley_hills', 2151); +INSERT INTO home_rentals VALUES (0, 1, 498, 'good', 10, 'thowsand_oaks', 1801); +INSERT INTO home_rentals VALUES (2, 1, 652, 'good', 0, 'thowsand_oaks', 3212); +INSERT INTO home_rentals VALUES (1, 1, 635, 'good', 1, 'thowsand_oaks', 2111); +INSERT INTO home_rentals VALUES (1, 1, 579, 'poor', 51, 'westbrae', 1453); +INSERT INTO home_rentals VALUES (2, 1, 677, 'poor', 49, 'alcatraz_ave', 2616); +INSERT INTO home_rentals VALUES (3, 2, 948, 'great', 8, 'south_side', 5224); +INSERT INTO home_rentals VALUES (0, 1, 511, 'great', 12, 'berkeley_hills', 2242); +INSERT INTO home_rentals VALUES (0, 1, 436, 'good', 14, 'thowsand_oaks', 1658); +INSERT INTO home_rentals VALUES (2, 1, 589, 'good', 7, 'downtown', 3077); +INSERT INTO home_rentals VALUES (2, 1, 582, 'poor', 60, 'alcatraz_ave', 2383); +INSERT INTO home_rentals VALUES (0, 1, 454, 'good', 13, 'downtown', 1753); +INSERT INTO home_rentals VALUES (2, 1, 530, 'poor', 47, 'westbrae', 2471); +INSERT INTO home_rentals VALUES (2, 1, 774, 'great', 3, 'berkeley_hills', 3875); +INSERT INTO home_rentals VALUES (1, 1, 644, 'great', 12, 'south_side', 2572); +INSERT INTO home_rentals VALUES (0, 1, 283, 'good', 7, 'downtown', 1582); +INSERT INTO home_rentals VALUES (1, 1, 518, 'poor', 60, 'alcatraz_ave', 1274); +INSERT INTO home_rentals VALUES (1, 1, 407, 'great', 3, 'berkeley_hills', 2338); +INSERT INTO home_rentals VALUES (3, 2, 963, 'good', 3, 'downtown', 4734); +INSERT INTO home_rentals VALUES (1, 1, 609, 'poor', 15, 'westbrae', 1929); +INSERT INTO home_rentals VALUES (1, 1, 649, 'poor', 46, 'westbrae', 1590); +INSERT INTO home_rentals VALUES (3, 2, 1182, 'good', 6, 'downtown', 4994); +INSERT INTO home_rentals VALUES (2, 1, 558, 'good', 3, 'downtown', 3118); +INSERT INTO home_rentals VALUES (3, 2, 1065, 'poor', 32, 'alcatraz_ave', 4521); +INSERT INTO home_rentals VALUES (3, 2, 837, 'poor', 23, 'westbrae', 4412); +INSERT INTO home_rentals VALUES (1, 1, 660, 'good', 8, 'thowsand_oaks', 2092); +INSERT INTO home_rentals VALUES (0, 1, 145, 'good', 6, 'downtown', 1442); +INSERT INTO home_rentals VALUES (0, 1, 464, 'good', 11, 'downtown', 1793); +INSERT INTO home_rentals VALUES (3, 2, 996, 'good', 13, 'downtown', 4758); +INSERT INTO home_rentals VALUES (1, 1, 518, 'good', 6, 'downtown', 2005); +INSERT INTO home_rentals VALUES (2, 1, 549, 'great', 6, 'berkeley_hills', 3575); +INSERT INTO home_rentals VALUES (2, 1, 787, 'good', 9, 'downtown', 3332); +INSERT INTO home_rentals VALUES (0, 1, 298, 'great', 9, 'south_side', 2104); +INSERT INTO home_rentals VALUES (1, 1, 500, 'poor', 54, 'westbrae', 1349); +INSERT INTO home_rentals VALUES (1, 1, 625, 'great', 2, 'south_side', 2578); +INSERT INTO home_rentals VALUES (1, 1, 509, 'poor', 20, 'alcatraz_ave', 1765); +INSERT INTO home_rentals VALUES (2, 1, 608, 'good', 9, 'thowsand_oaks', 3109); +INSERT INTO home_rentals VALUES (0, 1, 376, 'good', 1, 'downtown', 1766); +INSERT INTO home_rentals VALUES (3, 2, 1158, 'poor', 44, 'westbrae', 4380); +INSERT INTO home_rentals VALUES (3, 2, 914, 'good', 0, 'downtown', 4805); +INSERT INTO home_rentals VALUES (1, 1, 638, 'poor', 41, 'alcatraz_ave', 1699); +INSERT INTO home_rentals VALUES (2, 1, 786, 'poor', 63, 'westbrae', 2482); +INSERT INTO home_rentals VALUES (0, 1, 279, 'good', 3, 'thowsand_oaks', 1681); +INSERT INTO home_rentals VALUES (1, 1, 338, 'good', 3, 'thowsand_oaks', 1835); +INSERT INTO home_rentals VALUES (2, 1, 585, 'good', 10, 'thowsand_oaks', 3060); +INSERT INTO home_rentals VALUES (0, 1, 455, 'great', 13, 'south_side', 2205); +INSERT INTO home_rentals VALUES (2, 1, 791, 'great', 1, 'berkeley_hills', 3870); +INSERT INTO home_rentals VALUES (1, 1, 616, 'poor', 17, 'alcatraz_ave', 1943); +INSERT INTO home_rentals VALUES (2, 1, 690, 'poor', 16, 'westbrae', 3095); +INSERT INTO home_rentals VALUES (2, 1, 762, 'good', 1, 'downtown', 3323); +INSERT INTO home_rentals VALUES (2, 1, 688, 'good', 12, 'downtown', 3154); +INSERT INTO home_rentals VALUES (2, 1, 709, 'poor', 27, 'alcatraz_ave', 2975); +INSERT INTO home_rentals VALUES (2, 1, 536, 'poor', 43, 'alcatraz_ave', 2624); +INSERT INTO home_rentals VALUES (1, 1, 597, 'good', 9, 'downtown', 1978); +INSERT INTO home_rentals VALUES (2, 1, 824, 'poor', 47, 'alcatraz_ave', 2802); +INSERT INTO home_rentals VALUES (3, 2, 823, 'good', 10, 'downtown', 4545); +INSERT INTO home_rentals VALUES (3, 2, 961, 'good', 9, 'thowsand_oaks', 4764); +INSERT INTO home_rentals VALUES (0, 1, 112, 'good', 7, 'downtown', 1487); +INSERT INTO home_rentals VALUES (1, 1, 704, 'good', 14, 'downtown', 2081); +INSERT INTO home_rentals VALUES (0, 1, 111, 'great', 9, 'berkeley_hills', 1878); +INSERT INTO home_rentals VALUES (3, 2, 1183, 'poor', 23, 'alcatraz_ave', 4772); +INSERT INTO home_rentals VALUES (3, 2, 1069, 'good', 9, 'downtown', 4810); +INSERT INTO home_rentals VALUES (1, 1, 503, 'good', 9, 'downtown', 1866); +INSERT INTO home_rentals VALUES (0, 1, 296, 'great', 5, 'berkeley_hills', 2151); +INSERT INTO home_rentals VALUES (0, 1, 457, 'good', 4, 'downtown', 1796); +INSERT INTO home_rentals VALUES (1, 1, 358, 'good', 3, 'downtown', 1866); +INSERT INTO home_rentals VALUES (1, 1, 712, 'poor', 56, 'westbrae', 1500); +INSERT INTO home_rentals VALUES (0, 1, 335, 'good', 12, 'downtown', 1609); +INSERT INTO home_rentals VALUES (0, 1, 442, 'good', 5, 'downtown', 1779); +INSERT INTO home_rentals VALUES (3, 2, 1143, 'poor', 18, 'westbrae', 4846); +INSERT INTO home_rentals VALUES (3, 2, 903, 'poor', 27, 'alcatraz_ave', 4464); +INSERT INTO home_rentals VALUES (2, 1, 663, 'great', 3, 'south_side', 3691); +INSERT INTO home_rentals VALUES (2, 1, 878, 'good', 8, 'downtown', 3379); +INSERT INTO home_rentals VALUES (0, 1, 392, 'great', 7, 'berkeley_hills', 2205); +INSERT INTO home_rentals VALUES (1, 1, 433, 'poor', 51, 'alcatraz_ave', 1341); +INSERT INTO home_rentals VALUES (2, 1, 615, 'good', 9, 'thowsand_oaks', 3085); +INSERT INTO home_rentals VALUES (0, 1, 222, 'poor', 58, 'westbrae', 957); +INSERT INTO home_rentals VALUES (0, 1, 375, 'poor', 17, 'westbrae', 1620); +INSERT INTO home_rentals VALUES (0, 1, 518, 'poor', 21, 'westbrae', 1670); +INSERT INTO home_rentals VALUES (3, 2, 1154, 'great', 11, 'berkeley_hills', 5396); +INSERT INTO home_rentals VALUES (3, 2, 1211, 'good', 1, 'thowsand_oaks', 5043); +INSERT INTO home_rentals VALUES (0, 1, 425, 'great', 13, 'berkeley_hills', 2162); +INSERT INTO home_rentals VALUES (3, 2, 1046, 'good', 13, 'thowsand_oaks', 4722); +INSERT INTO home_rentals VALUES (0, 1, 233, 'great', 10, 'south_side', 2079); +INSERT INTO home_rentals VALUES (2, 1, 736, 'great', 2, 'south_side', 3854); +INSERT INTO home_rentals VALUES (3, 2, 933, 'poor', 22, 'westbrae', 4538); +INSERT INTO home_rentals VALUES (1, 1, 692, 'good', 5, 'downtown', 2115); +INSERT INTO home_rentals VALUES (2, 1, 665, 'good', 12, 'thowsand_oaks', 3106); +INSERT INTO home_rentals VALUES (2, 1, 559, 'great', 1, 'south_side', 3657); +INSERT INTO home_rentals VALUES (1, 1, 654, 'poor', 36, 'alcatraz_ave', 1782); +INSERT INTO home_rentals VALUES (1, 1, 421, 'great', 8, 'south_side', 2333); +INSERT INTO home_rentals VALUES (0, 1, 441, 'poor', 19, 'westbrae', 1613); +INSERT INTO home_rentals VALUES (3, 2, 869, 'great', 2, 'berkeley_hills', 5152); +INSERT INTO home_rentals VALUES (2, 1, 619, 'great', 0, 'south_side', 3671); +INSERT INTO home_rentals VALUES (3, 2, 969, 'poor', 56, 'westbrae', 3931); +INSERT INTO home_rentals VALUES (3, 2, 1005, 'poor', 59, 'alcatraz_ave', 3923); +INSERT INTO home_rentals VALUES (1, 1, 743, 'great', 3, 'south_side', 2732); +INSERT INTO home_rentals VALUES (3, 2, 1043, 'great', 2, 'berkeley_hills', 5356); +INSERT INTO home_rentals VALUES (3, 2, 882, 'good', 10, 'downtown', 4659); +INSERT INTO home_rentals VALUES (0, 1, 294, 'great', 1, 'south_side', 2221); +INSERT INTO home_rentals VALUES (2, 1, 646, 'poor', 53, 'westbrae', 2568); +INSERT INTO home_rentals VALUES (3, 2, 1009, 'great', 8, 'berkeley_hills', 5326); +INSERT INTO home_rentals VALUES (0, 1, 469, 'good', 14, 'thowsand_oaks', 1713); +INSERT INTO home_rentals VALUES (0, 1, 432, 'poor', 55, 'alcatraz_ave', 1211); +INSERT INTO home_rentals VALUES (0, 1, 417, 'good', 9, 'downtown', 1687); +INSERT INTO home_rentals VALUES (3, 2, 1074, 'good', 12, 'downtown', 4796); +INSERT INTO home_rentals VALUES (2, 1, 886, 'good', 10, 'downtown', 3396); +INSERT INTO home_rentals VALUES (2, 1, 938, 'good', 7, 'downtown', 3497); +INSERT INTO home_rentals VALUES (3, 2, 1180, 'good', 5, 'downtown', 5021); +INSERT INTO home_rentals VALUES (1, 1, 514, 'poor', 51, 'westbrae', 1440); +INSERT INTO home_rentals VALUES (2, 1, 745, 'poor', 37, 'westbrae', 2850); +INSERT INTO home_rentals VALUES (1, 1, 326, 'good', 9, 'thowsand_oaks', 1782); +INSERT INTO home_rentals VALUES (1, 1, 723, 'great', 3, 'berkeley_hills', 2649); +INSERT INTO home_rentals VALUES (1, 1, 677, 'good', 14, 'downtown', 2041); +INSERT INTO home_rentals VALUES (1, 1, 476, 'great', 8, 'south_side', 2370); +INSERT INTO home_rentals VALUES (0, 1, 334, 'poor', 48, 'westbrae', 1173); +INSERT INTO home_rentals VALUES (0, 1, 383, 'good', 11, 'downtown', 1707); +INSERT INTO home_rentals VALUES (3, 2, 880, 'good', 2, 'downtown', 4726); +INSERT INTO home_rentals VALUES (1, 1, 532, 'great', 4, 'south_side', 2491); +INSERT INTO home_rentals VALUES (1, 1, 608, 'poor', 59, 'alcatraz_ave', 1361); +INSERT INTO home_rentals VALUES (3, 2, 848, 'good', 6, 'thowsand_oaks', 4599); +INSERT INTO home_rentals VALUES (0, 1, 137, 'good', 9, 'thowsand_oaks', 1479); +INSERT INTO home_rentals VALUES (2, 1, 872, 'good', 14, 'downtown', 3375); +INSERT INTO home_rentals VALUES (0, 1, 350, 'poor', 61, 'alcatraz_ave', 1006); +INSERT INTO home_rentals VALUES (2, 1, 932, 'good', 10, 'downtown', 3413); +INSERT INTO home_rentals VALUES (3, 2, 1028, 'poor', 15, 'alcatraz_ave', 4693); +INSERT INTO home_rentals VALUES (0, 1, 187, 'good', 0, 'thowsand_oaks', 1566); +INSERT INTO home_rentals VALUES (0, 1, 464, 'poor', 21, 'westbrae', 1641); +INSERT INTO home_rentals VALUES (3, 2, 1175, 'good', 0, 'downtown', 4999); +INSERT INTO home_rentals VALUES (3, 2, 1106, 'good', 10, 'downtown', 4833); +INSERT INTO home_rentals VALUES (2, 1, 855, 'good', 9, 'downtown', 3362); +INSERT INTO home_rentals VALUES (2, 1, 768, 'great', 7, 'berkeley_hills', 3795); +INSERT INTO home_rentals VALUES (0, 1, 461, 'poor', 31, 'westbrae', 1512); +INSERT INTO home_rentals VALUES (0, 1, 434, 'good', 0, 'thowsand_oaks', 1800); +INSERT INTO home_rentals VALUES (1, 1, 554, 'poor', 19, 'westbrae', 1883); +INSERT INTO home_rentals VALUES (3, 2, 1175, 'great', 6, 'south_side', 5446); +INSERT INTO home_rentals VALUES (0, 1, 532, 'poor', 63, 'westbrae', 1202); +INSERT INTO home_rentals VALUES (1, 1, 602, 'good', 2, 'downtown', 2043); +INSERT INTO home_rentals VALUES (0, 1, 135, 'great', 1, 'berkeley_hills', 2026); +INSERT INTO home_rentals VALUES (0, 1, 235, 'great', 14, 'south_side', 2000); +INSERT INTO home_rentals VALUES (2, 1, 919, 'good', 12, 'thowsand_oaks', 3419); +INSERT INTO home_rentals VALUES (3, 2, 987, 'great', 6, 'berkeley_hills', 5298); +INSERT INTO home_rentals VALUES (2, 1, 740, 'good', 1, 'thowsand_oaks', 3329); +INSERT INTO home_rentals VALUES (2, 1, 564, 'good', 6, 'downtown', 3137); +INSERT INTO home_rentals VALUES (0, 1, 271, 'good', 14, 'downtown', 1557); +INSERT INTO home_rentals VALUES (0, 1, 485, 'great', 12, 'berkeley_hills', 2285); +INSERT INTO home_rentals VALUES (2, 1, 908, 'poor', 49, 'alcatraz_ave', 2838); +INSERT INTO home_rentals VALUES (2, 1, 904, 'great', 8, 'south_side', 3938); +INSERT INTO home_rentals VALUES (3, 2, 1081, 'great', 7, 'south_side', 5351); +INSERT INTO home_rentals VALUES (3, 2, 1032, 'poor', 51, 'alcatraz_ave', 4121); +INSERT INTO home_rentals VALUES (3, 2, 1037, 'poor', 35, 'westbrae', 4440); +INSERT INTO home_rentals VALUES (2, 1, 613, 'poor', 39, 'alcatraz_ave', 2738); +INSERT INTO home_rentals VALUES (3, 2, 1215, 'great', 13, 'south_side', 5467); +INSERT INTO home_rentals VALUES (0, 1, 361, 'great', 2, 'south_side', 2210); +INSERT INTO home_rentals VALUES (3, 2, 902, 'poor', 29, 'westbrae', 4375); +INSERT INTO home_rentals VALUES (1, 1, 411, 'good', 8, 'thowsand_oaks', 1810); +INSERT INTO home_rentals VALUES (0, 1, 195, 'great', 6, 'south_side', 2039); +INSERT INTO home_rentals VALUES (3, 2, 1225, 'poor', 56, 'westbrae', 4179); +INSERT INTO home_rentals VALUES (0, 1, 369, 'poor', 43, 'westbrae', 1286); +INSERT INTO home_rentals VALUES (3, 2, 1139, 'good', 11, 'downtown', 4861); +INSERT INTO home_rentals VALUES (2, 1, 819, 'great', 7, 'south_side', 3806); +INSERT INTO home_rentals VALUES (3, 2, 1020, 'great', 5, 'berkeley_hills', 5319); +INSERT INTO home_rentals VALUES (2, 1, 901, 'poor', 24, 'westbrae', 3200); +INSERT INTO home_rentals VALUES (2, 1, 677, 'good', 0, 'thowsand_oaks', 3232); +INSERT INTO home_rentals VALUES (2, 1, 566, 'great', 9, 'berkeley_hills', 3569); +INSERT INTO home_rentals VALUES (0, 1, 303, 'poor', 48, 'westbrae', 1112); +INSERT INTO home_rentals VALUES (3, 2, 820, 'poor', 23, 'westbrae', 4403); +INSERT INTO home_rentals VALUES (2, 1, 598, 'poor', 16, 'westbrae', 3049); +INSERT INTO home_rentals VALUES (3, 2, 1085, 'great', 13, 'south_side', 5279); +INSERT INTO home_rentals VALUES (0, 1, 219, 'good', 8, 'thowsand_oaks', 1529); +INSERT INTO home_rentals VALUES (2, 1, 646, 'good', 1, 'downtown', 3280); +INSERT INTO home_rentals VALUES (3, 2, 1080, 'good', 14, 'downtown', 4771); +INSERT INTO home_rentals VALUES (1, 1, 743, 'poor', 44, 'westbrae', 1671); +INSERT INTO home_rentals VALUES (2, 1, 505, 'great', 11, 'berkeley_hills', 3478); +INSERT INTO home_rentals VALUES (0, 1, 300, 'good', 8, 'downtown', 1667); +INSERT INTO home_rentals VALUES (0, 1, 127, 'poor', 61, 'alcatraz_ave', 847); +INSERT INTO home_rentals VALUES (3, 2, 1231, 'poor', 25, 'westbrae', 4824); +INSERT INTO home_rentals VALUES (2, 1, 883, 'good', 8, 'downtown', 3411); +INSERT INTO home_rentals VALUES (1, 1, 504, 'poor', 22, 'westbrae', 1783); +INSERT INTO home_rentals VALUES (1, 1, 533, 'good', 10, 'downtown', 1903); +INSERT INTO home_rentals VALUES (3, 2, 915, 'great', 1, 'berkeley_hills', 5240); +INSERT INTO home_rentals VALUES (2, 1, 606, 'good', 11, 'thowsand_oaks', 3068); +INSERT INTO home_rentals VALUES (1, 1, 320, 'great', 8, 'south_side', 2268); +INSERT INTO home_rentals VALUES (0, 1, 124, 'good', 6, 'thowsand_oaks', 1441); +INSERT INTO home_rentals VALUES (3, 2, 1094, 'great', 12, 'berkeley_hills', 5323); +INSERT INTO home_rentals VALUES (2, 1, 818, 'good', 3, 'downtown', 3359); +INSERT INTO home_rentals VALUES (3, 2, 1219, 'good', 1, 'downtown', 5030); +INSERT INTO home_rentals VALUES (1, 1, 595, 'good', 1, 'downtown', 2064); +INSERT INTO home_rentals VALUES (1, 1, 656, 'poor', 31, 'westbrae', 1830); +INSERT INTO home_rentals VALUES (0, 1, 529, 'great', 3, 'south_side', 2431); +INSERT INTO home_rentals VALUES (1, 1, 560, 'great', 2, 'berkeley_hills', 2497); +INSERT INTO home_rentals VALUES (0, 1, 113, 'good', 13, 'downtown', 1378); +INSERT INTO home_rentals VALUES (0, 1, 232, 'poor', 62, 'alcatraz_ave', 904); +INSERT INTO home_rentals VALUES (0, 1, 305, 'good', 3, 'thowsand_oaks', 1687); +INSERT INTO home_rentals VALUES (3, 2, 959, 'great', 3, 'berkeley_hills', 5286); +INSERT INTO home_rentals VALUES (2, 1, 771, 'good', 8, 'downtown', 3305); +INSERT INTO home_rentals VALUES (1, 1, 329, 'good', 10, 'downtown', 1755); +INSERT INTO home_rentals VALUES (2, 1, 735, 'good', 4, 'thowsand_oaks', 3288); +INSERT INTO home_rentals VALUES (1, 1, 606, 'great', 14, 'south_side', 2454); +INSERT INTO home_rentals VALUES (2, 1, 814, 'great', 5, 'berkeley_hills', 3868); +INSERT INTO home_rentals VALUES (0, 1, 123, 'great', 9, 'south_side', 1976); +INSERT INTO home_rentals VALUES (3, 2, 1165, 'good', 9, 'downtown', 4902); +INSERT INTO home_rentals VALUES (1, 1, 598, 'great', 7, 'south_side', 2499); +INSERT INTO home_rentals VALUES (3, 2, 902, 'poor', 42, 'alcatraz_ave', 4186); +INSERT INTO home_rentals VALUES (0, 1, 500, 'poor', 42, 'alcatraz_ave', 1416); +INSERT INTO home_rentals VALUES (1, 1, 674, 'good', 1, 'downtown', 2167); +INSERT INTO home_rentals VALUES (0, 1, 451, 'poor', 60, 'alcatraz_ave', 1135); +INSERT INTO home_rentals VALUES (0, 1, 267, 'poor', 32, 'westbrae', 1270); +INSERT INTO home_rentals VALUES (0, 1, 310, 'good', 12, 'thowsand_oaks', 1638); +INSERT INTO home_rentals VALUES (2, 1, 939, 'good', 12, 'thowsand_oaks', 3437); +INSERT INTO home_rentals VALUES (1, 1, 730, 'good', 0, 'downtown', 2224); +INSERT INTO home_rentals VALUES (0, 1, 223, 'poor', 57, 'alcatraz_ave', 988); +INSERT INTO home_rentals VALUES (0, 1, 488, 'poor', 49, 'westbrae', 1335); +INSERT INTO home_rentals VALUES (2, 1, 740, 'good', 6, 'downtown', 3294); +INSERT INTO home_rentals VALUES (0, 1, 220, 'good', 3, 'thowsand_oaks', 1548); +INSERT INTO home_rentals VALUES (2, 1, 935, 'good', 4, 'downtown', 3477); +INSERT INTO home_rentals VALUES (0, 1, 267, 'good', 7, 'thowsand_oaks', 1580); +INSERT INTO home_rentals VALUES (2, 1, 646, 'great', 0, 'south_side', 3727); +INSERT INTO home_rentals VALUES (2, 1, 755, 'good', 7, 'downtown', 3254); +INSERT INTO home_rentals VALUES (2, 1, 553, 'good', 8, 'downtown', 3073); +INSERT INTO home_rentals VALUES (1, 1, 513, 'good', 11, 'thowsand_oaks', 1924); +INSERT INTO home_rentals VALUES (3, 2, 893, 'poor', 38, 'alcatraz_ave', 4232); +INSERT INTO home_rentals VALUES (0, 1, 307, 'great', 7, 'south_side', 2151); +INSERT INTO home_rentals VALUES (3, 2, 984, 'good', 0, 'downtown', 4855); +INSERT INTO home_rentals VALUES (3, 2, 916, 'good', 0, 'thowsand_oaks', 4727); +INSERT INTO home_rentals VALUES (3, 2, 908, 'good', 9, 'thowsand_oaks', 4620); +INSERT INTO home_rentals VALUES (3, 2, 1044, 'good', 9, 'thowsand_oaks', 4847); +INSERT INTO home_rentals VALUES (3, 2, 926, 'good', 13, 'thowsand_oaks', 4679); +INSERT INTO home_rentals VALUES (2, 1, 892, 'good', 3, 'downtown', 3435); +INSERT INTO home_rentals VALUES (2, 1, 822, 'good', 8, 'downtown', 3374); +INSERT INTO home_rentals VALUES (2, 1, 876, 'poor', 15, 'westbrae', 3347); +INSERT INTO home_rentals VALUES (3, 2, 1212, 'poor', 16, 'westbrae', 4906); +INSERT INTO home_rentals VALUES (0, 1, 283, 'poor', 54, 'alcatraz_ave', 1039); +INSERT INTO home_rentals VALUES (0, 1, 149, 'poor', 47, 'westbrae', 989); +INSERT INTO home_rentals VALUES (3, 2, 853, 'good', 4, 'downtown', 4710); +INSERT INTO home_rentals VALUES (0, 1, 467, 'good', 1, 'thowsand_oaks', 1869); +INSERT INTO home_rentals VALUES (2, 1, 872, 'poor', 61, 'westbrae', 2647); +INSERT INTO home_rentals VALUES (2, 1, 623, 'poor', 26, 'westbrae', 2925); +INSERT INTO home_rentals VALUES (3, 2, 1034, 'great', 12, 'berkeley_hills', 5259); +INSERT INTO home_rentals VALUES (3, 2, 1121, 'good', 10, 'thowsand_oaks', 4877); +INSERT INTO home_rentals VALUES (0, 1, 320, 'poor', 36, 'westbrae', 1279); +INSERT INTO home_rentals VALUES (3, 2, 916, 'good', 3, 'downtown', 4716); +INSERT INTO home_rentals VALUES (3, 2, 1119, 'poor', 54, 'alcatraz_ave', 4105); +INSERT INTO home_rentals VALUES (0, 1, 397, 'good', 11, 'downtown', 1698); +INSERT INTO home_rentals VALUES (0, 1, 337, 'good', 1, 'downtown', 1775); +INSERT INTO home_rentals VALUES (2, 1, 903, 'poor', 58, 'alcatraz_ave', 2700); +INSERT INTO home_rentals VALUES (3, 2, 1006, 'poor', 27, 'westbrae', 4515); +INSERT INTO home_rentals VALUES (1, 1, 673, 'great', 7, 'south_side', 2604); + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/integration_tests/mindsdb/query_sink.sh b/integration_tests/mindsdb/query_sink.sh new file mode 100644 index 0000000000000..fdfd9bf910576 --- /dev/null +++ b/integration_tests/mindsdb/query_sink.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -x # Enable printing of each command + +# The model creation may take a long time. Our estimate is 30 seconds. But it can be longer in lower-perf machines. +sleep 30 + +QUERY='SELECT rental_price FROM home_rentals_model WHERE number_of_bathrooms = 2 AND sqft = 1000;' +psql -h localhost -p 55432 -U mindsdb -d mindsdb -c "$QUERY" \ No newline at end of file diff --git a/integration_tests/scripts/run_demos.py b/integration_tests/scripts/run_demos.py index f5a6e0a6095f5..c43c4a4cc1556 100644 --- a/integration_tests/scripts/run_demos.py +++ b/integration_tests/scripts/run_demos.py @@ -20,6 +20,15 @@ def run_sql_file(f: str, dir: str): sys.exit(1) +def run_bash_file(f: str, dir: str): + print("Running Bash file: {}".format(f)) + # ON_ERROR_STOP=1 will let psql return error code when the query fails. + # https://stackoverflow.com/questions/37072245/check-return-status-of-psql-command-in-unix-shell-scripting + proc = subprocess.run(["bash", f], check=True, cwd=dir) + if proc.returncode != 0: + sys.exit(1) + + def run_demo(demo: str, format: str, wait_time = 40): file_dir = dirname(abspath(__file__)) project_dir = dirname(file_dir) @@ -40,8 +49,15 @@ def run_demo(demo: str, format: str, wait_time = 40): continue # Fallback to default version when the protobuf version doesn't exist. sql_file = os.path.join(demo_dir, fname) + if not os.path.exists(sql_file): + continue run_sql_file(sql_file, demo_dir) sleep(10) + # Run query_sink.sh if it exists. + query_sink_file = os.path.join(demo_dir, 'query_sink.sh') + if os.path.isfile(query_sink_file): + run_bash_file(query_sink_file, demo_dir) + def run_kafka_cdc_demo(): demo = "kafka-cdc-sink" @@ -348,16 +364,16 @@ def run_bigquery_demo(): if len(failed_cases) != 0: raise Exception("Data check failed for case {}".format(failed_cases)) -arg_parser = argparse.ArgumentParser(description='Run the demo') -arg_parser.add_argument('--format', - metavar='format', - type=str, - help='the format of output data', - default='json') -arg_parser.add_argument('--case', - metavar='case', - type=str, - help='the test case') +arg_parser = argparse.ArgumentParser(description="Run the demo") +arg_parser.add_argument( + "--format", + metavar="format", + type=str, + help="the format of output data", + default="json", +) + +arg_parser.add_argument("--case", metavar="case", type=str, help="the test case") args = arg_parser.parse_args() # disable telemetry in env