From 9fda29623d6dc3e4b6467c411c943404df97395d Mon Sep 17 00:00:00 2001 From: Juan Valacco <97040903+jvalacco-dataherald@users.noreply.github.com> Date: Thu, 16 May 2024 21:54:00 -0300 Subject: [PATCH 1/8] add script to run docker containers under the same network and project --- README.md | 18 +++++++++++++++++- run.sh | 8 ++++++++ services/admin-console/dev.Dockerfile | 2 ++ services/admin-console/docker-compose.yml | 5 +++++ services/admin-console/prod.Dockerfile | 2 ++ services/engine/README.md | 2 +- services/engine/docker-compose.yml | 9 ++++----- services/engine/docs/quickstart.rst | 2 +- services/enterprise/README.md | 4 ++-- services/enterprise/docker-compose.yml | 7 +++---- services/slackbot/docker-compose.yml | 5 ++--- 11 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 run.sh diff --git a/README.md b/README.md index d00994f6..f6caf2f3 100755 --- a/README.md +++ b/README.md @@ -34,10 +34,26 @@ This repository contains four components under `/services` which can be used tog 1. Engine: The core natural language-to-SQL engine. If you would like to use the dataherald API without users or authentication, running the engine will suffice. 2. Enterprise: The application API layer which adds authentication, organizations and users, and other business logic to Dataherald. 3. Admin-console: The front-end component of Dataherald which allows a GUI for configuration and observability. You will need to run both engine and enterprise for the admin-console to work. -4. Slack: A slackbot which allows users from a slack channel to interact with dataherald. Requires both engine and enterprise to run. +4. Slackbot: A slackbot which allows users from a slack channel to interact with dataherald. Requires both engine and enterprise to run. For more information on each component, please take a look at their `README.md` files. +## Running locally + +Each component in the `/services` directory has its own `docker-compose.yml` file. To set up the environment, follow these steps: + +1. **Set Environment Variables**: + Each service requires specific environment variables. Refer to the `.env.example` file in each service directory and create a `.env` file with the necessary values. + > For the Next.js front-end app is `.env.local` +2. **Run Services**: + You can run all the services using a single script located in the root directory. This script creates a common Docker network and runs each service in detached mode. + +Run the script to start all services: + +```bash +sh run.sh +``` + ## Contributing As an open-source project in a rapidly developing field, we are open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation. diff --git a/run.sh b/run.sh new file mode 100644 index 00000000..e6ff39ff --- /dev/null +++ b/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +docker network create dataherald_network + +docker-compose -p dataherald -f services/engine/docker-compose.yml up --build -d; +docker-compose -p dataherald -f services/enterprise/docker-compose.yml up --build -d; +docker-compose -p dataherald -f services/slackbot/docker-compose.yml up --build -d; +docker-compose -p dataherald -f services/admin-console/docker-compose.yml up --build -d; \ No newline at end of file diff --git a/services/admin-console/dev.Dockerfile b/services/admin-console/dev.Dockerfile index a0826f71..2cbffed0 100644 --- a/services/admin-console/dev.Dockerfile +++ b/services/admin-console/dev.Dockerfile @@ -1,5 +1,7 @@ FROM node:18-alpine +LABEL Author="Juan Sebastian Valacco" + WORKDIR /app # Install dependencies based on the preferred package manager diff --git a/services/admin-console/docker-compose.yml b/services/admin-console/docker-compose.yml index ab955892..7a8a1909 100644 --- a/services/admin-console/docker-compose.yml +++ b/services/admin-console/docker-compose.yml @@ -12,3 +12,8 @@ services: restart: always ports: - 3000:3000 + networks: + - dataherald_network +networks: + dataherald_network: + external: true diff --git a/services/admin-console/prod.Dockerfile b/services/admin-console/prod.Dockerfile index 5c8ea3e4..44f6c987 100644 --- a/services/admin-console/prod.Dockerfile +++ b/services/admin-console/prod.Dockerfile @@ -1,5 +1,7 @@ FROM --platform=linux/amd64 node:18-alpine AS base +LABEL Author="Juan Sebastian Valacco" + # Install dependencies only when needed FROM base AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. diff --git a/services/engine/README.md b/services/engine/README.md index 49eedeed..36edc18e 100644 --- a/services/engine/README.md +++ b/services/engine/README.md @@ -123,7 +123,7 @@ Fernet.generate_key() >We need to set it up externally to enable external clients running on docker to communicate with this app. Run the following command: ``` -docker network create backendnetwork +docker network create dataherald_network ``` 4. Build docker images, create containers and raise them. This will raise the app and mongo container diff --git a/services/engine/docker-compose.yml b/services/engine/docker-compose.yml index a2c19c20..b97181e1 100644 --- a/services/engine/docker-compose.yml +++ b/services/engine/docker-compose.yml @@ -1,6 +1,5 @@ -version: "3.9" services: - app: + engine: build: context: . dockerfile: Dockerfile @@ -16,7 +15,7 @@ services: depends_on: - mongodb networks: - - backendnetwork + - dataherald_network env_file: .env mongodb: image: mongo:latest @@ -32,7 +31,7 @@ services: MONGO_INITDB_ROOT_PASSWORD: "${MONGODB_DB_PASSWORD}" MONGO_INITDB_DATABASE: "${MONGODB_DB_NAME}" networks: - - backendnetwork + - dataherald_network networks: - backendnetwork: + dataherald_network: external: true diff --git a/services/engine/docs/quickstart.rst b/services/engine/docs/quickstart.rst index 886a3f6b..e0698dba 100644 --- a/services/engine/docs/quickstart.rst +++ b/services/engine/docs/quickstart.rst @@ -46,7 +46,7 @@ Starting Docker #. Create a Docker network for communication between services (the Dataherald engine and Mongo) using the following command - ```docker network create backendnetwork``` + ```docker network create dataherald_network``` #. Build the docker images, create containers and raise them by running diff --git a/services/enterprise/README.md b/services/enterprise/README.md index f36989f9..b1b011c2 100644 --- a/services/enterprise/README.md +++ b/services/enterprise/README.md @@ -12,7 +12,7 @@ We use Docker to create the environment ai-server. >We need to set it up externally to enable external clients running on docker to communicate with this app. Run the following command: ``` -docker network create backendnetwork +docker network create dataherald_network ``` >If you are running ai-engine locally on docker, you can find container's IP by running this command: ``` @@ -103,7 +103,7 @@ Follow these steps to set up and run the Enterprise and Engine containers for lo 1. Create the docker network if it doesn't exist ``` -docker network create backendnetwork +docker network create dataherald_network ``` 2. Set the envvars in the .env file for `server` and `dataherald` projects diff --git a/services/enterprise/docker-compose.yml b/services/enterprise/docker-compose.yml index 1daa6ef7..1bbe8a1c 100644 --- a/services/enterprise/docker-compose.yml +++ b/services/enterprise/docker-compose.yml @@ -1,6 +1,5 @@ -version: "3.9" services: - app: + api: build: context: . dockerfile: Dockerfile @@ -13,7 +12,7 @@ services: volumes: - .:/app networks: - - backendnetwork + - dataherald_network networks: - backendnetwork: + dataherald_network: external: true diff --git a/services/slackbot/docker-compose.yml b/services/slackbot/docker-compose.yml index 9927784a..6bc2954f 100644 --- a/services/slackbot/docker-compose.yml +++ b/services/slackbot/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3' services: slackbot: build: . @@ -9,8 +8,8 @@ services: - .:/app - /app/node_modules networks: - - backendnetwork + - dataherald_network networks: - backendnetwork: + dataherald_network: external: true From 5bbbcc12ab347936881c58308608503e8780479a Mon Sep 17 00:00:00 2001 From: Juan Valacco <97040903+jvalacco-dataherald@users.noreply.github.com> Date: Fri, 17 May 2024 12:23:10 -0300 Subject: [PATCH 2/8] add env var example for docker containers --- services/admin-console/.env.example | 3 ++- services/enterprise/.env.example | 10 +++++----- services/slackbot/.env.example | 15 ++++++--------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/services/admin-console/.env.example b/services/admin-console/.env.example index 6b0549de..7f0274a8 100644 --- a/services/admin-console/.env.example +++ b/services/admin-console/.env.example @@ -1,7 +1,7 @@ NODE_ENV="development" # development | production # API URL -NEXT_PUBLIC_API_URL= +NEXT_PUBLIC_API_URL='http://localhost:3001' # AUTH 0 CONFIG AUTH0_BASE_URL='http://localhost:3000' @@ -13,6 +13,7 @@ AUTH0_CLIENT_ID='{yourClientId}' AUTH0_CLIENT_SECRET='{yourClientSecret}' # (OPTIONAL) Posthog Analytics +NEXT_PUBLIC_POSTHOG_DISABLED='true' NEXT_PUBLIC_POSTHOG_KEY= NEXT_PUBLIC_POSTHOG_HOST="https://app.posthog.com" diff --git a/services/enterprise/.env.example b/services/enterprise/.env.example index 33ff452c..ae046439 100644 --- a/services/enterprise/.env.example +++ b/services/enterprise/.env.example @@ -1,10 +1,10 @@ -K2_CORE_URL=http://localhost:3001/api/v1 +K2_CORE_URL=http://{DOCKER_CONTAINER_APP_NAME:PORT}/api/v1 # example: http://dataherald-engine-1/api/v1 (port 80 by default) MONGODB_DB_NAME= MONGODB_URI= -AUTH0_DOMAIN= -AUTH0_ISSUER= -AUTH0_API_AUDIENCE= +AUTH0_DOMAIN='{yourDomain}' +AUTH0_ISSUER='https://{yourDomain}' +AUTH0_API_AUDIENCE='{yourAudience}' AUTH0_DISABED=False API_KEY_SALT= @@ -19,7 +19,7 @@ ENCRYPT_KEY = POSTHOG_API_KEY= POSTHOG_HOST= -POSTHOG_DISABLED=False +POSTHOG_DISABLED=True # To set the SSH key file SSH_PRIVATE_KEY_PASSWORD= diff --git a/services/slackbot/.env.example b/services/slackbot/.env.example index 4d360138..d320fede 100644 --- a/services/slackbot/.env.example +++ b/services/slackbot/.env.example @@ -14,15 +14,12 @@ SOCKET_MODE=true ################################################################################ ################################################################################ -################################################################################ -################################################################################ -AUTH0_DOMAIN= -AUTH0_API_AUDIENCE= -AUTH0_CLIENT_ID= -AUTH0_CLIENT_SECRET= -API_URL=http://server-app-1:3001 +AUTH0_DOMAIN='{yourDomain}' +AUTH0_API_AUDIENCE='{yourAudience}' +AUTH0_CLIENT_ID='{yourClientId}' +AUTH0_CLIENT_SECRET='{yourClientSecret}' + -API_URL=http://{DOCKER_CONTAINER_APP_NAME:PORT}/api/v1 -# API_URL=http://localhost/api/v1 # outside docker +API_URL=http://{DOCKER_CONTAINER_APP_NAME:PORT}/api/v1 # example: http://dataherald-api-1:3001 PORT=3000 \ No newline at end of file From 5db48673a348c4ccb97c8f29e2198c6d9b67e7ce Mon Sep 17 00:00:00 2001 From: Juan Valacco <97040903+jvalacco-dataherald@users.noreply.github.com> Date: Fri, 17 May 2024 12:24:50 -0300 Subject: [PATCH 3/8] update engine url env var name --- services/enterprise/.env.example | 2 +- services/enterprise/.test.env | 2 +- services/enterprise/README.md | 4 ++-- services/enterprise/config.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/enterprise/.env.example b/services/enterprise/.env.example index ae046439..b5b02040 100644 --- a/services/enterprise/.env.example +++ b/services/enterprise/.env.example @@ -1,4 +1,4 @@ -K2_CORE_URL=http://{DOCKER_CONTAINER_APP_NAME:PORT}/api/v1 # example: http://dataherald-engine-1/api/v1 (port 80 by default) +ENGINE_URL=http://{DOCKER_CONTAINER_APP_NAME:PORT}/api/v1 # example: http://dataherald-engine-1/api/v1 (port 80 by default) MONGODB_DB_NAME= MONGODB_URI= diff --git a/services/enterprise/.test.env b/services/enterprise/.test.env index 162d2e74..372ebfd4 100644 --- a/services/enterprise/.test.env +++ b/services/enterprise/.test.env @@ -1,4 +1,4 @@ -K2_CORE_URL=http://localhost:80/api/v1 +ENGINE_URL=http://localhost:80/api/v1 MONGODB_DB_NAME=foo MONGODB_URI=foo DEFAULT_K2_TIMEOUT=60 diff --git a/services/enterprise/README.md b/services/enterprise/README.md index b1b011c2..77ee24b3 100644 --- a/services/enterprise/README.md +++ b/services/enterprise/README.md @@ -114,9 +114,9 @@ cp .env.example .env 3. Make sure you use the same `ENCRYPT_KEY` for `server` and `dataherald`. -4. For `K2_CORE_URL` check that you use as host the service name that is specified in docker-composer file, for example: +4. For `ENGINE_URL` check that you use as host the service name that is specified in docker-composer file, for example: ``` -K2_CORE_URL=http://app/api/v1 +ENGINE_URL=http://app/api/v1 ``` 5. Run the containers and execute the initialization script to generate data. It should create a real db_connection, diff --git a/services/enterprise/config.py b/services/enterprise/config.py index f89728b0..03e53198 100644 --- a/services/enterprise/config.py +++ b/services/enterprise/config.py @@ -26,7 +26,7 @@ class Settings(BaseSettings): load_dotenv() - engine_url: str = os.environ.get("K2_CORE_URL") + engine_url: str = os.environ.get("ENGINE_URL") default_engine_timeout: int = os.environ.get("DEFAULT_K2_TIMEOUT") encrypt_key: str = os.environ.get("ENCRYPT_KEY") api_key_salt: str = os.environ.get("API_KEY_SALT") From e20ebf49a47a2d5e2d656e722a5e77c995b02da5 Mon Sep 17 00:00:00 2001 From: Dishen <44216194+DishenWang2023@users.noreply.github.com> Date: Fri, 17 May 2024 11:27:47 -0400 Subject: [PATCH 4/8] Update .env.example --- services/admin-console/.env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/admin-console/.env.example b/services/admin-console/.env.example index 7f0274a8..e477af09 100644 --- a/services/admin-console/.env.example +++ b/services/admin-console/.env.example @@ -7,7 +7,7 @@ NEXT_PUBLIC_API_URL='http://localhost:3001' AUTH0_BASE_URL='http://localhost:3000' AUTH0_SCOPE='openid profile email offline_access' AUTH0_SECRET='use [openssl rand -hex 32] to generate a 32 bytes value' -AUTH0_ISSUER_BASE_URL='https://{yourDomain}' +AUTH0_ISSUER_BASE_URL='{yourIssuer}' AUTH0_API_AUDIENCE='{yourAudience}' AUTH0_CLIENT_ID='{yourClientId}' AUTH0_CLIENT_SECRET='{yourClientSecret}' @@ -19,4 +19,4 @@ NEXT_PUBLIC_POSTHOG_HOST="https://app.posthog.com" # (OPTIONAL) STRIPE -NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= \ No newline at end of file +NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= From 57753e2004d30c7c5e52ce4f2675cf3e081713f5 Mon Sep 17 00:00:00 2001 From: Dishen <44216194+DishenWang2023@users.noreply.github.com> Date: Fri, 17 May 2024 11:28:18 -0400 Subject: [PATCH 5/8] Update .env.example --- services/enterprise/.env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/enterprise/.env.example b/services/enterprise/.env.example index b5b02040..bee144b8 100644 --- a/services/enterprise/.env.example +++ b/services/enterprise/.env.example @@ -3,7 +3,7 @@ MONGODB_DB_NAME= MONGODB_URI= AUTH0_DOMAIN='{yourDomain}' -AUTH0_ISSUER='https://{yourDomain}' +AUTH0_ISSUER='{yourIssuer}' AUTH0_API_AUDIENCE='{yourAudience}' AUTH0_DISABED=False From 447d91ed5e8422f687a216d4def5d445129eb5d7 Mon Sep 17 00:00:00 2001 From: Dishen <44216194+DishenWang2023@users.noreply.github.com> Date: Fri, 17 May 2024 11:29:19 -0400 Subject: [PATCH 6/8] Delete services/enterprise/.test.env --- services/enterprise/.test.env | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 services/enterprise/.test.env diff --git a/services/enterprise/.test.env b/services/enterprise/.test.env deleted file mode 100644 index 372ebfd4..00000000 --- a/services/enterprise/.test.env +++ /dev/null @@ -1,11 +0,0 @@ -ENGINE_URL=http://localhost:80/api/v1 -MONGODB_DB_NAME=foo -MONGODB_URI=foo -DEFAULT_K2_TIMEOUT=60 -AUTH0_DOMAIN=your.domain.com -AUTH0_ISSUER=https://your.domain.com -AUTH0_API_AUDIENCE=https://your.audience.com -POSTHOG_API_KEY=fake_key -POSTHOG_HOST=https://fake.posthog.com -POSTHOG_DISABLED=True -API_KEY_SALT=d7MdThI8F8Vt9b=HAfOJ3hsgL5p74BLCezrZlpkT66Q= \ No newline at end of file From 3d42912f4607402ed1cee297003dec418e97a4df Mon Sep 17 00:00:00 2001 From: dishenwang2023 Date: Fri, 17 May 2024 12:12:51 -0400 Subject: [PATCH 7/8] Deleted database info --- .../database/migrations/changelog.json | 4598 ----------------- .../database/scripts/initial_setup.py | 149 - .../database/scripts/table_descriptions.json | 3638 ------------- 3 files changed, 8385 deletions(-) delete mode 100644 services/enterprise/database/scripts/initial_setup.py delete mode 100644 services/enterprise/database/scripts/table_descriptions.json diff --git a/services/enterprise/database/migrations/changelog.json b/services/enterprise/database/migrations/changelog.json index a31ac051..73798163 100644 --- a/services/enterprise/database/migrations/changelog.json +++ b/services/enterprise/database/migrations/changelog.json @@ -80,4604 +80,6 @@ } ] } - }, - { - "changeSet": { - "id": "3", - "author": "Dishen_Wang", - "comment": "create_real_estate_sample_db", - "changes": [ - { - "insertOne": { - "collectionName": "sample_databases", - "document": { - "$rawJson": { - "name": "U.S. Real Estate Data", - "description": "A sample dataset with U.S. real estate data from Redfin and RentHub. This includes list price, sales price, inventory, number of homes sold at a state, county, city and zip level.", - "example_prompts": [ - "Compare San francisco rent prices between 2022 and 2023.", - "How much did the number of new listings change for NYC across 2020.", - "Describe sale prices and number of listings in Miami since 2019." - ], - "database_connection": { - "alias": "Real Estate Sample", - "connection_uri": "bigquery://v2-real-estate/K2", - "use_ssh": false, - "path_to_credentials_file": "s3://k2-core/f88359e2-4755-4a99-884f-59efe7b3196b.json", - "dialect": "bigquery" - }, - "instructions": [ - { - "instruction": "Never run an aggregate function on the metric_value column (AVG, SUM or COUNT). The metric_value column already includes aggregated or averaged data.\nIf and only if geo_type is 'zip filter date ranges by period_end not period_start. The date should be the last date in the month.\nAlways filter by 'property_type' in the where clause. If the requested property_type is unclear from the question set it to 'All Residential'.\nIf the metric being asked is price per square foot, filter any value over 20,000.\nIf the geo_type is 'city' or 'county' always include the dh_state_name in the select part of the query.\nIf you are doing a JOIN on geo_type of 'city' or 'county' you should also match the dh_state_name column.\nIf the requested geo_type is unclear from the question set it to 'national'." - } - ], - "table_descriptions": [ - { - "table_name": "renthub_median_rent", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": "start date of the time period for the data point, usually the 1st of the month", - "low_cardinality": true, - "categories": [ - "2023-05-01", - "2023-03-01", - "2023-04-01", - "2022-06-01", - "2022-05-01", - "2022-09-01", - "2022-10-01", - "2022-03-01", - "2022-02-01", - "2021-05-01", - "2021-07-01", - "2022-12-01", - "2021-12-01", - "2021-03-01", - "2021-04-01", - "2020-12-01", - "2020-10-01", - "2022-08-01", - "2022-11-01", - "2021-11-01", - "2021-01-01", - "2022-04-01", - "2022-07-01", - "2021-10-01", - "2021-02-01", - "2021-09-01", - "2023-02-01", - "2021-08-01", - "2022-01-01", - "2023-01-01", - "2021-06-01", - "2020-11-01", - "2023-06-01", - "2023-12-01", - "2023-11-01", - "2024-01-01", - "2024-02-01" - ], - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": "end date of the time period for the data point, usually the last day in the month", - "low_cardinality": true, - "categories": [ - "2023-02-28", - "2021-03-31", - "2020-11-30", - "2021-09-30", - "2021-10-31", - "2022-04-30", - "2023-06-30", - "2021-05-31", - "2022-09-30", - "2022-07-31", - "2022-08-31", - "2022-01-31", - "2021-07-31", - "2022-10-31", - "2021-11-30", - "2021-06-30", - "2022-06-30", - "2020-10-31", - "2021-02-28", - "2023-04-30", - "2021-01-31", - "2021-08-31", - "2020-12-31", - "2022-12-31", - "2021-12-31", - "2023-01-31", - "2022-11-30", - "2023-03-31", - "2022-02-28", - "2022-03-31", - "2021-04-30", - "2022-05-31", - "2023-05-31", - "2023-12-31", - "2023-11-30", - "2024-01-31", - "2024-02-29" - ], - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the geographic classification level for the data point, such as 'national', 'state', etc.", - "low_cardinality": true, - "categories": [ - "national", - "city", - "zip", - "state", - "county", - "neighborhood" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the property type classification for the data point, such as 'Townhouse', 'Condo', etc. 'All residential' is an aggregate value for all property types in one bucket.", - "low_cardinality": true, - "categories": [ - "Apartment Building", - "House", - "Unknown", - "Condo", - "Multi-family house", - "Multi-family", - "Townhouse", - "Single-family house", - "Duplex", - "All Residential", - "Apartment", - "Other", - "Single-family", - "Rent" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "-", - "01", - "02", - "04", - "05", - "06", - "08", - "09", - "10", - "11", - "12", - "13", - "15", - "16", - "17", - "18", - "19", - "20", - "21", - "22", - "23", - "24", - "25", - "26", - "27", - "28", - "29", - "30", - "31", - "32", - "33", - "34", - "35", - "36", - "37", - "38", - "39", - "40", - "41", - "42", - "44", - "45", - "46", - "47", - "48", - "49", - "50", - "51", - "53", - "54", - "55", - "56", - "72", - "78" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Iowa", - "Ohio", - "Utah", - "U.S. Virgin Islands", - "Massachusetts", - "Rhode Island", - "New Jersey", - "New York", - "Pennsylvania", - "Maryland", - "Virginia", - "North Carolina", - "South Carolina", - "Georgia", - "Florida", - "Alabama", - "Tennessee", - "Mississippi", - "Indiana", - "Connecticut", - "Michigan", - "Wisconsin", - "Minnesota", - "Montana", - "Missouri", - "Louisiana", - "Texas", - "Colorado", - "Nevada", - "California", - "Idaho", - "Maine", - "Alaska", - "Hawaii", - "Kansas", - "Oregon", - "Arizona", - "Vermont", - "Wyoming", - "Arkansas", - "Delaware", - "Illinois", - "Kentucky", - "Nebraska", - "Oklahoma", - "New Mexico", - "Washington", - "Puerto Rico", - "North Dakota", - "South Dakota", - "New Hampshire", - "-", - "West Virginia", - "District of Columbia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "- ", - "AL", - "AK", - "AZ", - "AR", - "CA", - "CO", - "CT", - "DE", - "DC", - "FL", - "GA", - "HI", - "ID", - "IL", - "IN", - "IA", - "KS", - "KY", - "LA", - "ME", - "MD", - "MA", - "MI", - "MN", - "MS", - "MO", - "MT", - "NE", - "NV", - "NH", - "NJ", - "NM", - "NY", - "NC", - "ND", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VT", - "VA", - "WA", - "WV", - "WI", - "WY", - "PR", - "VI" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": "boolean value indicating if data point is seasonally adjusted", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo_xmin", - "is_primary_key": false, - "data_type": "INTEGER", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__schema_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__ingested_at", - "is_primary_key": false, - "data_type": "INTEGER", - "description": null, - "low_cardinality": true, - "categories": [ - "1688769435452", - "1688769623726", - "1688769655465", - "1688769656387", - "1688769437110", - "1688769437684", - "1688769438928", - "None" - ], - "foreign_key": null - }, - { - "name": "__hevo__loaded_at", - "is_primary_key": false, - "data_type": "INTEGER", - "description": null, - "low_cardinality": true, - "categories": [ - "1688771040379", - "1688769601727", - "None" - ], - "foreign_key": null - }, - { - "name": "__hevo__marked_deleted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2023-05-01", - "period_end": "2023-05-31", - "period_type": "monthly", - "geo_type": "national", - "property_type": "Apartment Building", - "location_name": "United States", - "dh_state_fips": "-", - "dh_state_name": "-", - "dh_state_abbr": "- ", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "1857.0", - "hg_date_updated": "2023-06-02 15:17:27.272000+00:00", - "__hevo_xmin": "175457456", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688769437110", - "__hevo__loaded_at": "1688769601727", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2023-05-01", - "period_end": "2023-05-31", - "period_type": "monthly", - "geo_type": "national", - "property_type": "House", - "location_name": "United States", - "dh_state_fips": "-", - "dh_state_name": "-", - "dh_state_abbr": "- ", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "2010.0", - "hg_date_updated": "2023-06-02 15:17:27.272000+00:00", - "__hevo_xmin": "175457456", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688769437110", - "__hevo__loaded_at": "1688769601727", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2023-05-01", - "period_end": "2023-05-31", - "period_type": "monthly", - "geo_type": "national", - "property_type": "Unknown", - "location_name": "United States", - "dh_state_fips": "-", - "dh_state_name": "-", - "dh_state_abbr": "- ", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "1900.0", - "hg_date_updated": "2023-06-02 15:17:27.272000+00:00", - "__hevo_xmin": "175457456", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688769437110", - "__hevo__loaded_at": "1688769601727", - "__hevo__marked_deleted": "False" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `renthub_median_rent` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` TIMESTAMP, \n\t`__hevo_xmin` INT64, \n\t`__hevo__schema_name` STRING, \n\t`__hevo__ingested_at` INT64, \n\t`__hevo__loaded_at` INT64, \n\t`__hevo__marked_deleted` BOOL,\n\t);", - "description": "Contains median rent for specified geo, property type, and time period" - }, - { - "table_name": "renthub_average_rent", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": true, - "categories": [ - "2022-09-01", - "2021-04-01", - "2021-02-01", - "2022-05-01", - "2022-06-01", - "2022-04-01", - "2020-10-01", - "2022-08-01", - "2022-12-01", - "2023-01-01", - "2023-03-01", - "2022-10-01", - "2020-12-01" - ], - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": true, - "categories": [ - "2022-09-30", - "2021-04-30", - "2021-02-28", - "2022-05-31", - "2022-06-30", - "2022-04-30", - "2020-10-31", - "2022-08-31", - "2022-12-31", - "2023-01-31", - "2023-03-31", - "2022-10-31", - "2020-12-31" - ], - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": ["neighborhood", "city"], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Apartment Building", - "Unknown", - "House", - "Condo", - "Townhouse" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Logan Circle", - "NTNA - Indian Bend", - "Moorland-Rimrock", - "Vista", - "Woodlawn", - "Turtle Creek", - "Biscayne", - "Rolling Meadows", - "Raymore", - "Calabasas", - "Chinatown", - "Bay Ridge", - "Citizens Southwest", - "Southeast Como", - "Carver City", - "South Beaverton", - "Oak Lawn", - "Country Club Heights", - "The Woodlands", - "Chatsworth" - ], - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "11", - "04", - "55", - "48", - "17", - "12", - "29", - "06", - "36", - "28", - "27", - "41", - "37", - "13" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "District of Columbia", - "Arizona", - "Wisconsin", - "Texas", - "Illinois", - "Florida", - "Missouri", - "California", - "New York", - "Mississippi", - "Minnesota", - "Oregon", - "North Carolina", - "Georgia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "DC", - "AZ", - "WI", - "TX", - "IL", - "FL", - "MO", - "CA", - "NY", - "MS", - "MN", - "OR", - "NC", - "GA" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "001", - "013", - "025", - "029", - "031", - "037", - "047", - "049", - "053", - "057", - "067", - "085", - "119", - "201", - "213" - ], - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "District of Columbia", - "Maricopa", - "Dane", - "Bexar", - "Cook", - "Duval", - "Cass", - "Los Angeles", - "Kings", - "Hinds", - "Hennepin", - "Hillsborough", - "Washington", - "Collin", - "Mecklenburg", - "Harris", - "Murray" - ], - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "District of Columbia", - "Maricopa County", - "Dane County", - "Bexar County", - "Cook County", - "Duval County", - "Cass County", - "Los Angeles County", - "Kings County", - "Hinds County", - "Hennepin County", - "Hillsborough County", - "Washington County", - "Collin County", - "Mecklenburg County", - "Harris County", - "Murray County" - ], - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "50000", - "73000", - "48000", - "65000", - "14000", - "35000", - "38000", - "60752", - "09598", - "44000", - "10022", - "36000", - "43000", - "71000", - "05350", - "19000", - "12000", - "72656", - "15508" - ], - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Washington", - "Tempe", - "Madison", - "San Antonio", - "Chicago", - "Jacksonville", - "Kansas City", - "Raymore", - "Calabasas", - "Los Angeles", - "Brooklyn", - "Jackson", - "Minneapolis", - "Tampa", - "Beaverton", - "Dallas", - "Charlotte", - "The Woodlands", - "Chatsworth" - ], - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Washington city", - "Tempe city", - "Madison city", - "San Antonio city", - "Chicago city", - "Jacksonville city", - "Kansas City city", - "Raymore city", - "Calabasas city", - "Los Angeles city", - "Brooklyn borough", - "Jackson city", - "Minneapolis city", - "Tampa city", - "Beaverton city", - "Dallas city", - "Charlotte city", - "The Woodlands CDP", - "Chatsworth city" - ], - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Washington", - "Tempe", - "Madison", - "San Antonio", - "Chicago", - "Jacksonville", - "Kansas City", - "Raymore", - "Calabasas", - "Los Angeles", - "Brooklyn", - "Jackson", - "Minneapolis", - "Tampa", - "Beaverton", - "Dallas", - "Charlotte", - "The Woodlands", - "Chatsworth" - ], - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Washington city", - "Tempe city", - "Madison city", - "San Antonio city", - "Chicago city", - "Jacksonville city", - "Kansas City city", - "Raymore city", - "Calabasas city", - "Los Angeles city", - "Brooklyn borough", - "Jackson city", - "Minneapolis city", - "Tampa city", - "Beaverton city", - "Dallas city", - "Charlotte city", - "The Woodlands CDP", - "Chatsworth city" - ], - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "121754", - "274823", - "272187", - "275891", - "276138", - "269215", - "268895", - "275232", - "-", - "276257", - "193189", - "273256", - "275472", - "273148", - "275412", - "274835", - "273366" - ], - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Logan Circle", - "NTNA - Indian Bend", - "Moorland-Rimrock", - "Vista", - "Woodlawn", - "Turtle Creek", - "Biscayne", - "Rolling Meadows", - "-", - "Chinatown", - "Bay Ridge", - "Citizens Southwest", - "Southeast Como", - "Carver City", - "South Beaverton", - "Oak Lawn", - "Country Club Heights" - ], - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": true, - "categories": [ - "3052.2549800796814", - "2023.5294117647059", - "1000.2727272727273", - "1676.96", - "1641.22", - "2069.05", - "1834.1266666666668", - "1648.8461538461538", - "1689.0487804878048", - "4999.35294117647", - "2624.0526315789475", - "2353.6285714285714", - "1167.2164948453608", - "1654.047619047619", - "1844.108695652174", - "1965.5384615384614", - "2051.6428571428573", - "1350.1666666666667", - "2116.730769230769", - "1706.8181818181818" - ], - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "DATETIME", - "description": null, - "low_cardinality": true, - "categories": [ - "2023-08-16 23:34:12.867873", - "2023-08-16 23:52:58.809064" - ], - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2022-09-01", - "period_end": "2022-09-30", - "period_type": "monthly", - "geo_type": "neighborhood", - "property_type": "Apartment Building", - "location_name": "Logan Circle", - "dh_state_fips": "11", - "dh_state_name": "District of Columbia", - "dh_state_abbr": "DC", - "dh_county_fips": "001", - "dh_county_name": "District of Columbia", - "dh_county_fullname": "District of Columbia", - "dh_place_fips": "50000", - "dh_place_name": "Washington", - "dh_place_fullname": "Washington city", - "dh_city_name": "Washington", - "dh_city_fullname": "Washington city", - "dh_neighborhood_id": "121754", - "dh_neighborhood_name": "Logan Circle", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "3052.2549800796814", - "hg_date_updated": "2023-08-16 23:34:12.867873" - }, - { - "period_start": "2022-09-01", - "period_end": "2022-09-30", - "period_type": "monthly", - "geo_type": "neighborhood", - "property_type": "Unknown", - "location_name": "NTNA - Indian Bend", - "dh_state_fips": "04", - "dh_state_name": "Arizona", - "dh_state_abbr": "AZ", - "dh_county_fips": "013", - "dh_county_name": "Maricopa", - "dh_county_fullname": "Maricopa County", - "dh_place_fips": "73000", - "dh_place_name": "Tempe", - "dh_place_fullname": "Tempe city", - "dh_city_name": "Tempe", - "dh_city_fullname": "Tempe city", - "dh_neighborhood_id": "274823", - "dh_neighborhood_name": "NTNA - Indian Bend", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "2023.5294117647059", - "hg_date_updated": "2023-08-16 23:34:12.867873" - }, - { - "period_start": "2021-04-01", - "period_end": "2021-04-30", - "period_type": "monthly", - "geo_type": "neighborhood", - "property_type": "Apartment Building", - "location_name": "Moorland-Rimrock", - "dh_state_fips": "55", - "dh_state_name": "Wisconsin", - "dh_state_abbr": "WI", - "dh_county_fips": "025", - "dh_county_name": "Dane", - "dh_county_fullname": "Dane County", - "dh_place_fips": "48000", - "dh_place_name": "Madison", - "dh_place_fullname": "Madison city", - "dh_city_name": "Madison", - "dh_city_fullname": "Madison city", - "dh_neighborhood_id": "272187", - "dh_neighborhood_name": "Moorland-Rimrock", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "1000.2727272727273", - "hg_date_updated": "2023-08-16 23:34:12.867873" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `renthub_average_rent` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` DATETIME,\n\t);" - }, - { - "table_name": "redfin_new_listings", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": "start date of the time period for the data point, usually the 1st of the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": "end date of the time period for the data point, usually the last day in the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the geographic classification level for the data point, such as 'national', 'state', etc.", - "low_cardinality": true, - "categories": [ - "state", - "zip", - "city", - "national", - "county" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the property type classification for the data point, such as 'Townhouse', 'Condo', etc. 'All residential' is an aggregate value for all property types in one bucket.", - "low_cardinality": true, - "categories": [ - "Single-family", - "Condo/Co-op", - "Multi-family", - "All Residential", - "Townhouse", - "Single unit" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "19", - "39", - "49", - "25", - "44", - "33", - "23", - "50", - "09", - "34", - "36", - "42", - "10", - "51", - "24", - "54", - "37", - "45", - "13", - "12", - "01", - "47", - "28", - "21", - "18", - "26", - "55", - "27", - "46", - "38", - "30", - "17", - "29", - "20", - "31", - "22", - "05", - "40", - "48", - "35", - "08", - "16", - "04", - "32", - "06", - "15", - "41", - "53", - "02", - "56", - "-", - "11" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Iowa", - "Ohio", - "Utah", - "Massachusetts", - "Rhode Island", - "New Hampshire", - "Maine", - "Vermont", - "Connecticut", - "New Jersey", - "New York", - "Pennsylvania", - "Delaware", - "Virginia", - "Maryland", - "West Virginia", - "North Carolina", - "South Carolina", - "Georgia", - "Florida", - "Alabama", - "Tennessee", - "Mississippi", - "Kentucky", - "Indiana", - "Michigan", - "Wisconsin", - "Minnesota", - "South Dakota", - "North Dakota", - "Montana", - "Illinois", - "Missouri", - "Kansas", - "Nebraska", - "Louisiana", - "Arkansas", - "Oklahoma", - "Texas", - "New Mexico", - "Colorado", - "Idaho", - "Arizona", - "Nevada", - "California", - "Hawaii", - "Oregon", - "Washington", - "Alaska", - "Wyoming", - "-", - "District of Columbia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "IA", - "OH", - "UT", - "MA", - "RI", - "NH", - "ME", - "VT", - "CT", - "NJ", - "NY", - "PA", - "DE", - "VA", - "MD", - "WV", - "NC", - "SC", - "GA", - "FL", - "AL", - "TN", - "MS", - "KY", - "IN", - "MI", - "WI", - "MN", - "SD", - "ND", - "MT", - "IL", - "MO", - "KS", - "NE", - "LA", - "AR", - "OK", - "TX", - "NM", - "CO", - "ID", - "AZ", - "NV", - "CA", - "HI", - "OR", - "WA", - "AK", - "WY", - "- ", - "DC" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": "boolean value indicating if data point is seasonally adjusted", - "low_cardinality": true, - "categories": ["False", "True"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "DATETIME", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2023-11-01", - "period_end": "2023-11-30", - "period_type": "monthly", - "geo_type": "state", - "property_type": "Single-family", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "2351.0", - "hg_date_updated": "2024-02-16 13:06:03.238736" - }, - { - "period_start": "2023-11-01", - "period_end": "2023-11-30", - "period_type": "monthly", - "geo_type": "state", - "property_type": "Condo/Co-op", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "258.0", - "hg_date_updated": "2024-02-16 13:06:03.238736" - }, - { - "period_start": "2023-11-01", - "period_end": "2023-11-30", - "period_type": "monthly", - "geo_type": "state", - "property_type": "Multi-family", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "35.0", - "hg_date_updated": "2024-02-16 13:06:03.238736" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `redfin_new_listings` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` DATETIME,\n\t);", - "description": "Contains number of new properties put up for sale for specified geo, property type, and time period" - }, - { - "table_name": "redfin_median_sale_price", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": "start date of the time period for the data point, usually the 1st of the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": "end date of the time period for the data point, usually the last day in the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the geographic classification level for the data point, such as 'national', 'state', etc.", - "low_cardinality": true, - "categories": [ - "zip", - "city", - "national", - "state", - "county" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the property type classification for the data point, such as 'Townhouse', 'Condo', etc. 'All residential' is an aggregate value for all property types in one bucket.", - "low_cardinality": true, - "categories": [ - "All Residential", - "Condo/Co-op", - "Multi-family", - "Single-family", - "Single unit", - "Townhouse" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "-", - "01", - "02", - "04", - "05", - "06", - "08", - "09", - "10", - "11", - "12", - "13", - "15", - "16", - "17", - "18", - "19", - "20", - "21", - "22", - "23", - "24", - "25", - "26", - "27", - "28", - "29", - "30", - "31", - "32", - "33", - "34", - "35", - "36", - "37", - "38", - "39", - "40", - "41", - "42", - "44", - "45", - "46", - "47", - "48", - "49", - "50", - "51", - "53", - "54", - "55", - "56" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "-", - "Alabama", - "Alaska", - "Arizona", - "Arkansas", - "California", - "Colorado", - "Connecticut", - "Delaware", - "District of Columbia", - "Florida", - "Georgia", - "Hawaii", - "Idaho", - "Illinois", - "Indiana", - "Iowa", - "Kansas", - "Kentucky", - "Louisiana", - "Maine", - "Maryland", - "Massachusetts", - "Michigan", - "Minnesota", - "Mississippi", - "Missouri", - "Montana", - "Nebraska", - "Nevada", - "New Hampshire", - "New Jersey", - "New Mexico", - "New York", - "North Carolina", - "North Dakota", - "Ohio", - "Oklahoma", - "Oregon", - "Pennsylvania", - "Rhode Island", - "South Carolina", - "South Dakota", - "Tennessee", - "Texas", - "Utah", - "Vermont", - "Virginia", - "Washington", - "West Virginia", - "Wisconsin", - "Wyoming" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "- ", - "AL", - "AK", - "AZ", - "AR", - "CA", - "CO", - "CT", - "DE", - "DC", - "FL", - "GA", - "HI", - "ID", - "IL", - "IN", - "IA", - "KS", - "KY", - "LA", - "ME", - "MD", - "MA", - "MI", - "MN", - "MS", - "MO", - "MT", - "NE", - "NV", - "NH", - "NJ", - "NM", - "NY", - "NC", - "ND", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VT", - "VA", - "WA", - "WV", - "WI", - "WY" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": "boolean value indicating if data point is seasonally adjusted", - "low_cardinality": true, - "categories": ["False", "True"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "DATETIME", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2023-10-01", - "period_end": "2023-10-31", - "period_type": "monthly", - "geo_type": "national", - "property_type": "All Residential", - "location_name": "United States", - "dh_state_fips": "-", - "dh_state_name": "-", - "dh_state_abbr": "- ", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "413822.0", - "hg_date_updated": "2024-01-19 13:05:26.335401" - }, - { - "period_start": "2023-10-01", - "period_end": "2023-10-31", - "period_type": "monthly", - "geo_type": "national", - "property_type": "All Residential", - "location_name": "United States", - "dh_state_fips": "-", - "dh_state_name": "-", - "dh_state_abbr": "- ", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "True", - "metric_value": "414369.71875", - "hg_date_updated": "2024-01-19 13:05:26.335401" - }, - { - "period_start": "2023-10-01", - "period_end": "2023-10-31", - "period_type": "monthly", - "geo_type": "national", - "property_type": "Condo/Co-op", - "location_name": "United States", - "dh_state_fips": "-", - "dh_state_name": "-", - "dh_state_abbr": "- ", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "343202.0", - "hg_date_updated": "2024-01-19 13:05:26.335401" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `redfin_median_sale_price` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` DATETIME,\n\t);", - "description": "Contains median sale price for specified geo, property type, and time period" - }, - { - "table_name": "redfin_median_ppsf", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": "start date of the time period for the data point, usually the 1st of the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": "end date of the time period for the data point, usually the last day in the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the geographic classification level for the data point, such as 'national', 'state', etc.", - "low_cardinality": true, - "categories": [ - "state", - "zip", - "city", - "national", - "county" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the property type classification for the data point, such as 'Townhouse', 'Condo', etc. 'All residential' is an aggregate value for all property types in one bucket.", - "low_cardinality": true, - "categories": [ - "Single-family", - "Condo/Co-op", - "Multi-family", - "All Residential", - "Townhouse", - "Single unit" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "19", - "39", - "49", - "25", - "44", - "33", - "23", - "50", - "09", - "34", - "36", - "42", - "10", - "51", - "24", - "54", - "37", - "45", - "13", - "12", - "01", - "47", - "28", - "21", - "18", - "26", - "55", - "27", - "46", - "38", - "30", - "17", - "29", - "20", - "31", - "22", - "05", - "40", - "48", - "35", - "08", - "56", - "16", - "04", - "32", - "06", - "15", - "41", - "53", - "02", - "-", - "11" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Iowa", - "Ohio", - "Utah", - "Massachusetts", - "Rhode Island", - "New Hampshire", - "Maine", - "Vermont", - "Connecticut", - "New Jersey", - "New York", - "Pennsylvania", - "Delaware", - "Virginia", - "Maryland", - "West Virginia", - "North Carolina", - "South Carolina", - "Georgia", - "Florida", - "Alabama", - "Tennessee", - "Mississippi", - "Kentucky", - "Indiana", - "Michigan", - "Wisconsin", - "Minnesota", - "South Dakota", - "North Dakota", - "Montana", - "Illinois", - "Missouri", - "Kansas", - "Nebraska", - "Louisiana", - "Arkansas", - "Oklahoma", - "Texas", - "New Mexico", - "Colorado", - "Wyoming", - "Idaho", - "Arizona", - "Nevada", - "California", - "Hawaii", - "Oregon", - "Washington", - "Alaska", - "-", - "District of Columbia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "IA", - "OH", - "UT", - "MA", - "RI", - "NH", - "ME", - "VT", - "CT", - "NJ", - "NY", - "PA", - "DE", - "VA", - "MD", - "WV", - "NC", - "SC", - "GA", - "FL", - "AL", - "TN", - "MS", - "KY", - "IN", - "MI", - "WI", - "MN", - "SD", - "ND", - "MT", - "IL", - "MO", - "KS", - "NE", - "LA", - "AR", - "OK", - "TX", - "NM", - "CO", - "WY", - "ID", - "AZ", - "NV", - "CA", - "HI", - "OR", - "WA", - "AK", - "- ", - "DC" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": "boolean value indicating if data point is seasonally adjusted", - "low_cardinality": true, - "categories": ["False", "True"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "DATETIME", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2013-02-01", - "period_end": "2013-04-30", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Multi-family", - "location_name": "01001", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "", - "dh_county_name": "", - "dh_county_fullname": "", - "dh_place_fips": "", - "dh_place_name": "", - "dh_place_fullname": "", - "dh_city_name": "", - "dh_city_fullname": "", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "01001", - "is_seasonally_adjusted": "False", - "metric_value": "76.57151", - "hg_date_updated": "2023-08-22 07:56:41.619955" - }, - { - "period_start": "2013-02-01", - "period_end": "2013-04-30", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Single-family", - "location_name": "01001", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "", - "dh_county_name": "", - "dh_county_fullname": "", - "dh_place_fips": "", - "dh_place_name": "", - "dh_place_fullname": "", - "dh_city_name": "", - "dh_city_fullname": "", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "01001", - "is_seasonally_adjusted": "False", - "metric_value": "158.75238", - "hg_date_updated": "2023-08-22 07:54:53.198614" - }, - { - "period_start": "2013-02-01", - "period_end": "2013-04-30", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Townhouse", - "location_name": "01001", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "", - "dh_county_name": "", - "dh_county_fullname": "", - "dh_place_fips": "", - "dh_place_name": "", - "dh_place_fullname": "", - "dh_city_name": "", - "dh_city_fullname": "", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "01001", - "is_seasonally_adjusted": "False", - "metric_value": "119.133575", - "hg_date_updated": "2023-08-22 07:59:25.139951" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `redfin_median_ppsf` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` DATETIME,\n\t);", - "description": "Contains median price per square foot for specified geo, property type, and time period" - }, - { - "table_name": "redfin_median_list_price", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": "start date of the time period for the data point, usually the 1st of the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": "end date of the time period for the data point, usually the last day in the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the geographic classification level for the data point, such as 'national', 'state', etc.", - "low_cardinality": true, - "categories": [ - "state", - "zip", - "city", - "national", - "county" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the property type classification for the data point, such as 'Townhouse', 'Condo', etc. 'All residential' is an aggregate value for all property types in one bucket.", - "low_cardinality": true, - "categories": [ - "All Residential", - "Single-family", - "Townhouse", - "Multi-family", - "Condo/Co-op", - "Single unit" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "19", - "39", - "49", - "25", - "44", - "33", - "23", - "50", - "09", - "34", - "36", - "42", - "10", - "51", - "24", - "54", - "37", - "45", - "13", - "12", - "01", - "47", - "28", - "21", - "18", - "26", - "55", - "27", - "46", - "38", - "30", - "17", - "29", - "20", - "31", - "22", - "05", - "40", - "48", - "35", - "08", - "16", - "04", - "32", - "06", - "15", - "41", - "53", - "02", - "56", - "-", - "11" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Iowa", - "Ohio", - "Utah", - "Massachusetts", - "Rhode Island", - "New Hampshire", - "Maine", - "Vermont", - "Connecticut", - "New Jersey", - "New York", - "Pennsylvania", - "Delaware", - "Virginia", - "Maryland", - "West Virginia", - "North Carolina", - "South Carolina", - "Georgia", - "Florida", - "Alabama", - "Tennessee", - "Mississippi", - "Kentucky", - "Indiana", - "Michigan", - "Wisconsin", - "Minnesota", - "South Dakota", - "North Dakota", - "Montana", - "Illinois", - "Missouri", - "Kansas", - "Nebraska", - "Louisiana", - "Arkansas", - "Oklahoma", - "Texas", - "New Mexico", - "Colorado", - "Idaho", - "Arizona", - "Nevada", - "California", - "Hawaii", - "Oregon", - "Washington", - "Alaska", - "Wyoming", - "-", - "District of Columbia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "IA", - "OH", - "UT", - "MA", - "RI", - "NH", - "ME", - "VT", - "CT", - "NJ", - "NY", - "PA", - "DE", - "VA", - "MD", - "WV", - "NC", - "SC", - "GA", - "FL", - "AL", - "TN", - "MS", - "KY", - "IN", - "MI", - "WI", - "MN", - "SD", - "ND", - "MT", - "IL", - "MO", - "KS", - "NE", - "LA", - "AR", - "OK", - "TX", - "NM", - "CO", - "ID", - "AZ", - "NV", - "CA", - "HI", - "OR", - "WA", - "AK", - "WY", - "- ", - "DC" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": "boolean value indicating if data point is seasonally adjusted", - "low_cardinality": true, - "categories": ["False", "True"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "DATETIME", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2023-11-01", - "period_end": "2023-11-30", - "period_type": "monthly", - "geo_type": "state", - "property_type": "All Residential", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "225700.0", - "hg_date_updated": "2024-02-16 13:05:39.180755" - }, - { - "period_start": "2023-12-01", - "period_end": "2023-12-31", - "period_type": "monthly", - "geo_type": "state", - "property_type": "All Residential", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "220000.0", - "hg_date_updated": "2024-02-16 13:05:39.180755" - }, - { - "period_start": "2023-12-01", - "period_end": "2023-12-31", - "period_type": "monthly", - "geo_type": "state", - "property_type": "Single-family", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "214300.0", - "hg_date_updated": "2024-02-16 13:05:39.180755" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `redfin_median_list_price` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` DATETIME,\n\t);", - "description": "Contains median list price for specified geo, property type, and time period" - }, - { - "table_name": "redfin_inventory", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": "start date of the time period for the data point, usually the 1st of the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": "end date of the time period for the data point, usually the last day in the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the geographic classification level for the data point, such as 'national', 'state', etc.", - "low_cardinality": true, - "categories": [ - "state", - "zip", - "city", - "national", - "county" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the property type classification for the data point, such as 'Townhouse', 'Condo', etc. 'All residential' is an aggregate value for all property types in one bucket.", - "low_cardinality": true, - "categories": [ - "All Residential", - "Townhouse", - "Multi-family", - "Condo/Co-op", - "Single-family", - "Single unit" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "19", - "39", - "49", - "25", - "44", - "33", - "23", - "50", - "09", - "34", - "36", - "42", - "10", - "51", - "24", - "54", - "37", - "45", - "13", - "12", - "01", - "47", - "28", - "21", - "18", - "26", - "55", - "27", - "46", - "38", - "30", - "17", - "29", - "20", - "31", - "22", - "05", - "40", - "48", - "35", - "08", - "16", - "04", - "32", - "06", - "15", - "41", - "53", - "02", - "56", - "-", - "11" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Iowa", - "Ohio", - "Utah", - "Massachusetts", - "Rhode Island", - "New Hampshire", - "Maine", - "Vermont", - "Connecticut", - "New Jersey", - "New York", - "Pennsylvania", - "Delaware", - "Virginia", - "Maryland", - "West Virginia", - "North Carolina", - "South Carolina", - "Georgia", - "Florida", - "Alabama", - "Tennessee", - "Mississippi", - "Kentucky", - "Indiana", - "Michigan", - "Wisconsin", - "Minnesota", - "South Dakota", - "North Dakota", - "Montana", - "Illinois", - "Missouri", - "Kansas", - "Nebraska", - "Louisiana", - "Arkansas", - "Oklahoma", - "Texas", - "New Mexico", - "Colorado", - "Idaho", - "Arizona", - "Nevada", - "California", - "Hawaii", - "Oregon", - "Washington", - "Alaska", - "Wyoming", - "-", - "District of Columbia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "IA", - "OH", - "UT", - "MA", - "RI", - "NH", - "ME", - "VT", - "CT", - "NJ", - "NY", - "PA", - "DE", - "VA", - "MD", - "WV", - "NC", - "SC", - "GA", - "FL", - "AL", - "TN", - "MS", - "KY", - "IN", - "MI", - "WI", - "MN", - "SD", - "ND", - "MT", - "IL", - "MO", - "KS", - "NE", - "LA", - "AR", - "OK", - "TX", - "NM", - "CO", - "ID", - "AZ", - "NV", - "CA", - "HI", - "OR", - "WA", - "AK", - "WY", - "- ", - "DC" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": "boolean value indicating if data point is seasonally adjusted", - "low_cardinality": true, - "categories": ["False", "True"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "DATETIME", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2012-01-01", - "period_end": "2012-03-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "All Residential", - "location_name": "01001", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "", - "dh_county_name": "", - "dh_county_fullname": "", - "dh_place_fips": "", - "dh_place_name": "", - "dh_place_fullname": "", - "dh_city_name": "", - "dh_city_fullname": "", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "01001", - "is_seasonally_adjusted": "False", - "metric_value": "102.0", - "hg_date_updated": "2023-08-22 08:36:53.389961" - }, - { - "period_start": "2012-01-01", - "period_end": "2012-03-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Condo/Co-op", - "location_name": "01001", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "", - "dh_county_name": "", - "dh_county_fullname": "", - "dh_place_fips": "", - "dh_place_name": "", - "dh_place_fullname": "", - "dh_city_name": "", - "dh_city_fullname": "", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "01001", - "is_seasonally_adjusted": "False", - "metric_value": "17.0", - "hg_date_updated": "2023-08-22 08:34:48.878075" - }, - { - "period_start": "2012-01-01", - "period_end": "2012-03-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Multi-family", - "location_name": "01001", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "", - "dh_county_name": "", - "dh_county_fullname": "", - "dh_place_fips": "", - "dh_place_name": "", - "dh_place_fullname": "", - "dh_city_name": "", - "dh_city_fullname": "", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "01001", - "is_seasonally_adjusted": "False", - "metric_value": "3.0", - "hg_date_updated": "2023-08-22 08:34:07.014872" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `redfin_inventory` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` DATETIME,\n\t);", - "description": "Contains number of properties on sale for specified geo, property type, and time period" - }, - { - "table_name": "redfin_homes_sold", - "status": "SCANNED", - - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": "start date of the time period for the data point, usually the 1st of the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": "end date of the time period for the data point, usually the last day in the month", - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the geographic classification level for the data point, such as 'national', 'state', etc.", - "low_cardinality": true, - "categories": [ - "state", - "zip", - "city", - "national", - "county" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": "the property type classification for the data point, such as 'Townhouse', 'Condo', etc. 'All residential' is an aggregate value for all property types in one bucket.", - "low_cardinality": true, - "categories": [ - "All Residential", - "Multi-family", - "Single-family", - "Townhouse", - "Condo/Co-op", - "Single unit" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "19", - "39", - "49", - "25", - "44", - "33", - "23", - "50", - "09", - "34", - "36", - "42", - "10", - "51", - "24", - "54", - "37", - "45", - "13", - "12", - "01", - "47", - "28", - "21", - "18", - "26", - "55", - "27", - "46", - "38", - "30", - "17", - "29", - "20", - "31", - "22", - "05", - "40", - "48", - "35", - "08", - "56", - "16", - "04", - "32", - "06", - "15", - "41", - "53", - "02", - "-", - "11" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "Iowa", - "Ohio", - "Utah", - "Massachusetts", - "Rhode Island", - "New Hampshire", - "Maine", - "Vermont", - "Connecticut", - "New Jersey", - "New York", - "Pennsylvania", - "Delaware", - "Virginia", - "Maryland", - "West Virginia", - "North Carolina", - "South Carolina", - "Georgia", - "Florida", - "Alabama", - "Tennessee", - "Mississippi", - "Kentucky", - "Indiana", - "Michigan", - "Wisconsin", - "Minnesota", - "South Dakota", - "North Dakota", - "Montana", - "Illinois", - "Missouri", - "Kansas", - "Nebraska", - "Louisiana", - "Arkansas", - "Oklahoma", - "Texas", - "New Mexico", - "Colorado", - "Wyoming", - "Idaho", - "Arizona", - "Nevada", - "California", - "Hawaii", - "Oregon", - "Washington", - "Alaska", - "-", - "District of Columbia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": true, - "categories": [ - "IA", - "OH", - "UT", - "MA", - "RI", - "NH", - "ME", - "VT", - "CT", - "NJ", - "NY", - "PA", - "DE", - "VA", - "MD", - "WV", - "NC", - "SC", - "GA", - "FL", - "AL", - "TN", - "MS", - "KY", - "IN", - "MI", - "WI", - "MN", - "SD", - "ND", - "MT", - "IL", - "MO", - "KS", - "NE", - "LA", - "AR", - "OK", - "TX", - "NM", - "CO", - "WY", - "ID", - "AZ", - "NV", - "CA", - "HI", - "OR", - "WA", - "AK", - "- ", - "DC" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": "boolean value indicating if data point is seasonally adjusted", - "low_cardinality": true, - "categories": ["False", "True"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "DATETIME", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "error_message": "", - "examples": [ - { - "period_start": "2023-11-01", - "period_end": "2023-11-30", - "period_type": "monthly", - "geo_type": "state", - "property_type": "All Residential", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "2720.0", - "hg_date_updated": "2024-02-16 13:05:50.643409" - }, - { - "period_start": "2023-11-01", - "period_end": "2023-11-30", - "period_type": "monthly", - "geo_type": "state", - "property_type": "Multi-family", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "40.0", - "hg_date_updated": "2023-12-15 13:06:27.635171" - }, - { - "period_start": "2023-11-01", - "period_end": "2023-11-30", - "period_type": "monthly", - "geo_type": "state", - "property_type": "Single-family", - "location_name": "Iowa", - "dh_state_fips": "19", - "dh_state_name": "Iowa", - "dh_state_abbr": "IA", - "dh_county_fips": "-", - "dh_county_name": "-", - "dh_county_fullname": "-", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "2359.0", - "hg_date_updated": "2024-02-16 13:05:50.643409" - } - ], - "last_schema_sync": { - "$date": "2024-04-10T00:00:00.000Z" - }, - "table_schema": "\nCREATE TABLE `redfin_homes_sold` (\n\t`period_start` DATE, \n\t`period_end` DATE, \n\t`period_type` STRING, \n\t`geo_type` STRING, \n\t`property_type` STRING, \n\t`location_name` STRING, \n\t`dh_state_fips` STRING, \n\t`dh_state_name` STRING, \n\t`dh_state_abbr` STRING, \n\t`dh_county_fips` STRING, \n\t`dh_county_name` STRING, \n\t`dh_county_fullname` STRING, \n\t`dh_place_fips` STRING, \n\t`dh_place_name` STRING, \n\t`dh_place_fullname` STRING, \n\t`dh_city_name` STRING, \n\t`dh_city_fullname` STRING, \n\t`dh_neighborhood_id` STRING, \n\t`dh_neighborhood_name` STRING, \n\t`dh_zip_code` STRING, \n\t`is_seasonally_adjusted` BOOL, \n\t`metric_value` FLOAT64, \n\t`hg_date_updated` DATETIME,\n\t);", - "description": "Contains total number of properties sold for specified geo, property type, and time period" - } - ], - "golden_sqls": [ - { - "prompt_text": "what was the number of homes sold in New Mexico in Q1 2021?", - "sql": "SELECT location_name, period_end, SUM(metric_value) FROM redfin_homes_sold WHERE geo_type = 'state' AND location_name='New Mexico' AND property_type = 'All Residential' AND period_start BETWEEN '2021-01-01' AND '2021-03-31' GROUP BY location_name, period_end;" - }, - { - "prompt_text": "what zip code had the highest number of sold properties in Bridgeport county, CT in Oct 2022?", - "sql": "SELECT location_name, metric_value FROM redfin_homes_sold WHERE dh_county_name = 'Bridgeport' AND dh_state_name = 'Connecticut' AND property_type = 'All Residential' AND period_start='2022-10-01' AND geo_type='zip' ORDER BY metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "compare homes sold in spokane vs fort worth since 2022", - "sql": "SELECT period_end, location_name, dh_state_name, metric_value FROM redfin_homes_sold WHERE geo_type='city' AND property_type = 'All Residential' AND period_end >= '2022-01-01' AND ((location_name='Spokane' AND dh_state_name='Washington') OR (location_name = 'Fort Worth' AND dh_state_name='Texas')) ORDER BY period_end, dh_state_name, location_name;" - }, - { - "prompt_text": "houses sold in Yolo county in 2021 broken down by property type", - "sql": "SELECT period_start, property_type, metric_value FROM redfin_homes_sold WHERE geo_type='county' AND location_name='Yolo' AND dh_state_name='California' AND property_type <> 'All Residential' AND period_start BETWEEN '2021-01-01' AND '2021-12-31' ORDER BY period_start ASC, property_type ASC;" - }, - { - "prompt_text": "Which state has the lowest number of houses sold?", - "sql": "SELECT period_end, location_name, metric_value FROM redfin_homes_sold WHERE geo_type='state' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value ASC LIMIT 1;" - }, - { - "prompt_text": "properties sold 99337", - "sql": "SELECT period_start, period_end, metric_value FROM redfin_homes_sold WHERE geo_type='zip' AND location_name = '99337' AND dh_state_name = 'Washington' AND property_type = 'All Residential' ORDER BY period_start DESC LIMIT 1;" - }, - { - "prompt_text": "multi-family homes sold in El Paso texas?", - "sql": "SELECT period_end, metric_value AS homes_sold FROM redfin_homes_sold WHERE geo_type = 'city' AND property_type = 'Multi-family' AND dh_state_name = 'Texas' AND dh_place_name = 'El Paso' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "How does sold properties compare across Erie county and Broward county?", - "sql": "WITH Erie_county_data AS ( SELECT period_end, location_name, metric_value AS homes_sold FROM redfin_homes_sold WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'Pennsylvania' AND dh_county_name = 'Erie' ORDER BY period_end DESC), Broward_county_data AS ( SELECT period_end, location_name, metric_value AS homes_sold FROM redfin_homes_sold WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_county_name = 'Broward' ORDER BY period_end DESC) SELECT erie.period_end, erie.homes_sold AS erie_homes_sold, broward.homes_sold AS broward_homes_sold, (erie.homes_sold - broward.homes_sold) * 100 / broward.homes_sold AS pct_diff FROM Erie_county_data erie JOIN Broward_county_data broward ON erie.period_end = broward.period_end ORDER BY erie.period_end DESC LIMIT 5;" - }, - { - "prompt_text": "In how many cities in Arkansas is number of sold condos higher than townhouses?", - "sql": "WITH DATA AS ( \tSELECT location_name, property_type, metric_value AS homes_sold, period_start FROM redfin_homes_sold WHERE geo_type = 'city' AND dh_state_name = 'Arkansas' AND (property_type = 'Condo/Co-op' OR property_type = 'Townhouse') AND period_start = ( \t\tSELECT max(period_start) FROM redfin_homes_sold WHERE geo_type = 'city' AND dh_state_name = 'Arkansas' ) ) SELECT COUNT(condo.location_name) AS num_cities FROM DATA condo JOIN DATA townhouse ON condo.location_name = townhouse.location_name WHERE condo.property_type = 'Condo/Co-op' AND townhouse.property_type = 'Townhouse' AND condo.homes_sold > townhouse.homes_sold;" - }, - { - "prompt_text": "what is the difference between the ZIP codes with the most houses sold in San Antonio and Carson City?", - "sql": "WITH most_expensive_zip_SA AS ( \tSELECT location_name, metric_value AS homes_sold \tFROM redfin_homes_sold \tWHERE geo_type = 'zip' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Texas' \t AND dh_place_name = 'San Antonio' \tORDER BY period_end DESC, metric_value DESC LIMIT 1), most_expensive_zip_CC AS ( \tSELECT location_name, metric_value AS homes_sold \tFROM redfin_homes_sold \tWHERE geo_type = 'zip' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Nevada' \t AND dh_place_name = 'Carson City' \tORDER BY period_end DESC, metric_value DESC LIMIT 1) SELECT sa.location_name AS SA_most_expensive_zip, sa.homes_sold AS SA_zip_homes_sold, \tCC.location_name AS CC_most_expensive_zip, cc.homes_sold AS CC_zip_homes_sold, \t(sa.homes_sold - cc.homes_sold) * 100 / cc.homes_sold AS pct_diff FROM most_expensive_zip_SA sa, most_expensive_zip_CC cc;" - }, - { - "prompt_text": "How much did condos sold change from Feb 2022 to Feb 2023 in Tuscaloosa AL?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS homes_sold, period_start \tFROM redfin_homes_sold \tWHERE geo_type = 'city' \t AND property_type = 'Condo/Co-op' \t AND dh_state_name = 'Alabama' \t AND dh_place_name = 'Tuscaloosa' \t AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.homes_sold AS new_homes_sold, ld.homes_sold AS old_homes_sold, \t((cd.homes_sold - ld.homes_sold) * 100 / ld.homes_sold) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "Which property type has the highest houses sold in Humboldt County, NV?", - "sql": "SELECT period_end, property_type, metric_value FROM redfin_homes_sold WHERE geo_type = 'county' AND dh_state_name = 'Nevada' AND dh_county_name = 'Humboldt' AND property_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "How much did the number of properties sold change from March 2022 to March 2023 in Graham county?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS homes_sold, period_start \tFROM redfin_homes_sold \tWHERE geo_type = 'county' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Arizona' \t AND dh_county_name = 'Graham' \t AND (period_start = '2023-03-01' OR period_start = '2022-03-01') ) SELECT cd.location_name, cd.homes_sold AS new_homes_sold, ld.homes_sold AS old_homes_sold, \t((cd.homes_sold - ld.homes_sold) * 100 / ld.homes_sold) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01';" - }, - { - "prompt_text": "which is the city with the highest increase in houses sold in Virginia from July 2022 to July 2023?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS homes_sold, period_start \tFROM redfin_homes_sold \tWHERE geo_type = 'city' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Virginia' \t AND (period_start = '2023-07-01' OR period_start = '2022-07-01') ) SELECT cd.location_name, cd.homes_sold AS new_homes_sold, ld.homes_sold AS old_homes_sold, \t((cd.homes_sold - ld.homes_sold) * 100 / ld.homes_sold) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-07-01' AND ld.period_start = '2022-07-01' ORDER BY pct_change DESC LIMIT 1;" - }, - { - "prompt_text": "How many houses were sold for each property type in Columbus, OH?", - "sql": "SELECT property_type, metric_value FROM redfin_homes_sold WHERE geo_type='city' AND dh_state_name = 'Ohio' AND dh_place_name = 'Columbus' AND period_start = (SELECT max(period_start) FROM redfin_homes_sold WHERE geo_type='city' AND dh_state_name = 'Ohio' AND dh_place_name = 'Columbus') ORDER BY property_type ASC;" - }, - { - "prompt_text": "what was the median list price in New Jersey in Q1 2021?", - "sql": "SELECT location_name, period_end, metric_value FROM redfin_median_list_price WHERE geo_type = 'state' AND location_name='New Jersey' AND property_type = 'All Residential' AND period_start BETWEEN '2021-01-01' AND '2021-03-31' ORDER BY period_end;" - }, - { - "prompt_text": "what zip code had the highest list price in Putnam county, FL in Oct 2022?", - "sql": "SELECT location_name, metric_value FROM redfin_median_list_price WHERE dh_county_name = 'Putnam' AND dh_state_name = 'Florida' AND property_type = 'All Residential' AND period_start='2022-10-01' AND geo_type='zip' ORDER BY metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "compare median list price in tacoma vs austin since 2022", - "sql": "SELECT period_end, location_name, dh_state_name, metric_value FROM redfin_median_list_price WHERE geo_type='city' AND property_type = 'All Residential' AND period_end >= '2022-01-01' AND ((location_name='Tacoma' AND dh_state_name='Washington') OR (location_name = 'Austin' AND dh_state_name='Texas')) ORDER BY period_end, dh_state_name, location_name;" - }, - { - "prompt_text": "median list price in Napa county in 2022 broken down by property type", - "sql": "SELECT period_start, property_type, metric_value FROM redfin_median_list_price WHERE geo_type='county' AND location_name='Napa' AND dh_state_name='California' AND property_type <> 'All Residential' AND period_start BETWEEN '2022-01-01' AND '2022-12-31' ORDER BY period_start ASC, property_type ASC;" - }, - { - "prompt_text": "Which state has the lowest median list price?", - "sql": "SELECT period_end, location_name, metric_value FROM redfin_median_list_price WHERE geo_type='state' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value ASC LIMIT 1;" - }, - { - "prompt_text": "median list price 94555", - "sql": "SELECT period_start, period_end, metric_value FROM redfin_median_list_price WHERE geo_type='zip' AND location_name = '94555' AND dh_state_name = 'California' AND property_type = 'All Residential' ORDER BY period_start DESC LIMIT 1;" - }, - { - "prompt_text": "What is the median list price in Houston texas for multi-family homes?", - "sql": "SELECT period_end, metric_value AS median_price FROM redfin_median_list_price WHERE geo_type = 'city' AND property_type = 'Multi-family' AND dh_state_name = 'Texas' AND dh_place_name = 'Houston' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "How does list price compare across Philadelphia county and Sarasota county?", - "sql": "WITH Philadelphia_county_data AS ( SELECT period_end, location_name, metric_value AS median_price FROM redfin_median_list_price WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'Pennsylvania' AND dh_county_name = 'Philadelphia' ORDER BY period_end DESC), Sarasota_county_data AS ( SELECT period_end, location_name, metric_value AS median_price FROM redfin_median_list_price WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_county_name = 'Sarasota' ORDER BY period_end DESC) SELECT philadelphia.period_end, philadelphia.median_price AS philadelphia_median_price, sarasota.median_ppsf AS sarasota_median_price, (philadelphia.median_price - sarasota.median_price) * 100 / sarasota.median_price AS pct_diff FROM Philadelphia_county_data philadelphia JOIN Sarasota_county_data sarasota ON philadelphia.period_end = sarasota.period_end ORDER BY philadelphia.period_end DESC LIMIT 5;" - }, - { - "prompt_text": "In how many cities in Missouri is listing price higher for condos compared to townhouses?", - "sql": "WITH DATA AS ( \tSELECT location_name, property_type, metric_value AS median_price, period_start FROM redfin_median_list_price WHERE geo_type = 'city' AND dh_state_name = 'Missouri' AND (property_type = 'Condo/Co-op' OR property_type = 'Townhouse') AND period_start = ( \t\tSELECT max(period_start) FROM redfin_median_list_price WHERE geo_type = 'city' AND dh_state_name = 'Missouri' ) ) SELECT COUNT(condo.location_name) AS num_cities FROM DATA condo JOIN DATA townhouse ON condo.location_name = townhouse.location_name WHERE condo.property_type = 'Condo/Co-op' AND townhouse.property_type = 'Townhouse' AND condo.median_price > townhouse.median_price;" - }, - { - "prompt_text": "what is the difference between the ZIP codes with the highest list price in Denver and Reno?", - "sql": "WITH most_expensive_zip_Denver AS ( \tSELECT location_name, metric_value AS median_price \tFROM redfin_median_list_price \tWHERE geo_type = 'zip' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Colorado' \t AND dh_place_name = 'Denver' \tORDER BY period_end DESC, metric_value DESC LIMIT 1), most_expensive_zip_Reno AS ( \tSELECT location_name, metric_value AS median_price \tFROM redfin_median_list_price \tWHERE geo_type = 'zip' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Nevada' \t AND dh_place_name = 'Reno' \tORDER BY period_end DESC, metric_value DESC LIMIT 1) SELECT denver.location_name AS Denver_most_expensive_zip, denver.median_price AS denver_zip_median_price, \treno.location_name AS Reno_most_expensive_zip, reno.median_price AS Reno_zip_median_price, \t(denver.median_price - reno.median_price) * 100 / reno.median_price AS pct_diff FROM most_expensive_zip_Denver denver, most_expensive_zip_Reno reno;" - }, - { - "prompt_text": "How much did list price change from Feb 2022 to Feb 2023 in Denver for townhouses?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS median_price, period_start \tFROM redfin_median_list_price \tWHERE geo_type = 'city' \t AND property_type = 'Townhouse' \t AND dh_state_name = 'Colorado' \t AND dh_place_name = 'Denver' \t AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, \t((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "Which property type has the highest listing price in Lincoln County, NV?", - "sql": "SELECT period_end, property_type, metric_value FROM redfin_median_list_price WHERE geo_type = 'county' AND dh_state_name = 'Nevada' AND dh_county_name = 'Lincoln' AND property_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "How much did the list price change from March 2022 to March 2023 in Maricopa county?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS median_price, period_start \tFROM redfin_median_list_price \tWHERE geo_type = 'county' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Arizona' \t AND dh_county_name = 'Maricopa' \t AND (period_start = '2023-03-01' OR period_start = '2022-03-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, \t((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01';" - }, - { - "prompt_text": "which is the city with the highest increase in listing price in Mississippi from July 2022 to July 2023?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS median_price, period_start \tFROM redfin_median_list_price \tWHERE geo_type = 'city' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Mississippi' \t AND (period_start = '2023-07-01' OR period_start = '2022-07-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, \t((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-07-01' AND ld.period_start = '2022-07-01' ORDER BY pct_change DESC LIMIT 1;" - }, - { - "prompt_text": "What is the list price for each property type in San Jose?", - "sql": "SELECT property_type, metric_value FROM redfin_median_list_price WHERE geo_type='city' AND dh_state_name = 'California' AND dh_place_name = 'San Jose' AND period_start = (SELECT max(period_start) FROM redfin_median_list_price WHERE geo_type='city' AND dh_state_name = 'California' AND dh_place_name = 'Sacramento') ORDER BY property_type ASC;" - }, - { - "prompt_text": "what was the median price per square foot in New Hampshire in Q1 2021?", - "sql": "SELECT location_name, period_end, metric_value FROM redfin_median_ppsf WHERE geo_type = 'state' AND location_name='New Hampshire' AND property_type = 'All Residential' AND period_start BETWEEN '2021-01-01' AND '2021-03-31' ORDER BY period_end;" - }, - { - "prompt_text": "what zip code had the highest ppsf in Dade county in Oct 2022?", - "sql": "SELECT location_name, metric_value FROM redfin_median_ppsf WHERE dh_county_name = 'Miami-Dade' AND dh_state_name = 'Florida' AND property_type = 'All Residential' AND period_start='2022-10-01' AND geo_type='zip' ORDER BY metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "compare median ppsf in seattle vs houston since 2022", - "sql": "SELECT period_end, location_name, dh_state_name, metric_value FROM redfin_median_ppsf WHERE geo_type='city' AND property_type = 'All Residential' AND period_end >= '2022-01-01' AND ((location_name='Seattle' AND dh_state_name='Washington') OR (location_name = 'Houston' AND dh_state_name='Texas')) ORDER BY period_end, dh_state_name, location_name;" - }, - { - "prompt_text": "median ppsf in sonoma county in 2022 broken down by property type", - "sql": "SELECT period_start, property_type, metric_value FROM redfin_median_ppsf WHERE geo_type='county' AND location_name='Sonoma' AND dh_state_name='California' AND property_type <> 'All Residential' AND period_start BETWEEN '2022-01-01' AND '2022-12-31' ORDER BY period_start ASC, property_type ASC;" - }, - { - "prompt_text": "Which state has the lowest median price per square foot overall?", - "sql": "SELECT period_end, location_name, metric_value FROM redfin_median_ppsf WHERE geo_type='state' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value ASC LIMIT 1;" - }, - { - "prompt_text": "median price per square foot 15213", - "sql": "SELECT period_start, period_end, metric_value FROM redfin_median_ppsf WHERE geo_type='zip' AND location_name = '15213' AND dh_state_name = 'Pennsylvania' AND property_type = 'All Residential' ORDER BY period_start DESC LIMIT 1;" - }, - { - "prompt_text": "What is the median ppsf in Austin texas for multi-family homes?", - "sql": "SELECT period_end, metric_value AS median_ppsf FROM redfin_median_ppsf WHERE geo_type = 'city' AND property_type = 'Multi-family' AND dh_state_name = 'Texas' AND dh_place_name = 'Austin' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "How does price per sq ft compare across Allegheny county and Dade county?", - "sql": "WITH Allegheny_county_data AS ( SELECT period_end, location_name, metric_value AS median_ppsf FROM redfin_median_ppsf WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'Pennsylvania' AND dh_county_name = 'Allegheny' ORDER BY period_end DESC), Dade_county_data AS ( SELECT period_end, location_name, metric_value AS median_ppsf FROM redfin_median_ppsf WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_county_name = 'Miami-Dade' ORDER BY period_end DESC) SELECT allegheny.period_end, allegheny.median_ppsf AS allegheny_median_ppsf, dade.median_ppsf AS dade_median_ppsf, (allegheny.median_ppsf - dade.median_ppsf) * 100 / dade.median_ppsf AS pct_diff FROM Allegheny_county_data allegheny JOIN Dade_county_data dade ON allegheny.period_end = dade.period_end ORDER BY allegheny.period_end DESC LIMIT 5;" - }, - { - "prompt_text": "In how many cities in Georgia is the price per square foot higher for condos compared to townhouses?", - "sql": "WITH DATA AS ( \tSELECT location_name, property_type, metric_value AS median_ppsf, period_start FROM redfin_median_ppsf WHERE geo_type = 'city' AND dh_state_name = 'Georgia' AND (property_type = 'Condo/Co-op' OR property_type = 'Townhouse') AND period_start = ( \t\tSELECT max(period_start) FROM redfin_median_ppsf WHERE geo_type = 'city' AND dh_state_name = 'Georgia' ) ) SELECT COUNT(condo.location_name) AS num_cities FROM DATA condo JOIN DATA townhouse ON condo.location_name = townhouse.location_name WHERE condo.property_type = 'Condo/Co-op' AND townhouse.property_type = 'Townhouse' AND condo.median_ppsf > townhouse.median_ppsf;" - }, - { - "prompt_text": "what is the difference between the ZIP codes with the highest ppsf in Boulder and Las Vegas?", - "sql": "WITH most_expensive_zip_Boulder AS ( \tSELECT location_name, metric_value AS median_ppsf \tFROM redfin_median_ppsf \tWHERE geo_type = 'zip' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Colorado' \t AND dh_place_name = 'Boulder' \tORDER BY period_end DESC, metric_value DESC LIMIT 1), most_expensive_zip_LV AS ( \tSELECT location_name, metric_value AS median_ppsf \tFROM redfin_median_ppsf \tWHERE geo_type = 'zip' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Nevada' \t AND dh_place_name = 'Las Vegas' \tORDER BY period_end DESC, metric_value DESC LIMIT 1) SELECT boulder.location_name AS Boulder_most_expensive_zip, boulder.median_ppsf AS boulder_zip_median_ppsf, \tlv.location_name AS LV_most_expensive_zip, lv.median_ppsf AS LV_zip_median_ppsf, \t(boulder.median_ppsf - lv.median_ppsf) * 100 / lv.median_ppsf AS pct_diff FROM most_expensive_zip_Boulder boulder, most_expensive_zip_LV lv;" - }, - { - "prompt_text": "How much did ppsf change from Feb 2022 to Feb 2023 in Raleigh for townhouses?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS median_ppsf, period_start \tFROM redfin_median_ppsf \tWHERE geo_type = 'city' \t AND property_type = 'Townhouse' \t AND dh_state_name = 'North Carolina' \t AND dh_place_name = 'Raleigh' \t AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.median_ppsf AS new_median_ppsf, ld.median_ppsf AS old_median_ppsf, \t((cd.median_ppsf - ld.median_ppsf) * 100 / ld.median_ppsf) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "Which property type has the highest price per square foot in Alameda county?", - "sql": "SELECT period_end, property_type, metric_value FROM redfin_median_ppsf WHERE geo_type = 'county' AND dh_state_name = 'California' AND dh_county_name = 'Alameda' AND property_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "How much did ppsf change from March 2022 to March 2023 in Allegheny county?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS median_price, period_start \tFROM redfin_median_ppsf \tWHERE geo_type = 'county' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Pennsylvania' \t AND dh_county_name = 'Allegheny' \t AND (period_start = '2023-03-01' OR period_start = '2022-03-01') ) SELECT cd.location_name, cd.median_ppsf AS new_median_ppsf, ld.median_ppsf AS old_median_ppsf, \t((cd.median_ppsf - ld.median_ppsf) * 100 / ld.median_ppsf) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01';" - }, - { - "prompt_text": "which is the city with the highest increase in the price per sq ft in Oklahoma from July 2022 to July 2023?", - "sql": "WITH DATA AS ( \tSELECT location_name, metric_value AS median_ppsf, period_start \tFROM redfin_median_ppsf \tWHERE geo_type = 'city' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Oklahoma' \t AND (period_start = '2023-07-01' OR period_start = '2022-07-01') ) SELECT cd.location_name, cd.median_ppsf AS new_median_ppsf, ld.median_ppsf AS old_median_ppsf, \t((cd.median_ppsf - ld.median_ppsf) * 100 / ld.median_ppsf) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-07-01' AND ld.period_start = '2022-07-01' ORDER BY pct_change DESC LIMIT 1;" - }, - { - "prompt_text": "What is the price per square foot for each property type in Sacramento?", - "sql": "SELECT property_type, metric_value FROM redfin_median_ppsf WHERE geo_type='city' AND dh_state_name = 'California' AND dh_place_name = 'Sacramento' AND period_start = (SELECT max(period_start) FROM redfin_median_ppsf WHERE geo_type='city' AND dh_state_name = 'California' AND dh_place_name = 'Sacramento') ORDER BY property_type ASC;" - }, - { - "prompt_text": "how did the new listings increased/decreased in New Orleans from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Louisiana' AND dh_place_name = 'New Orleans' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.new_listings AS new_new_listings, ld.new_listings AS old_new_listings, ((cd.new_listings - ld.new_listings) * 100 / ld.new_listings) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01';" - }, - { - "prompt_text": "Which are the top 10 zips with the highest new listings numbers in New York city?", - "sql": "SELECT location_name as zip_code, metric_value as new_listings FROM redfin_new_listings WHERE geo_type = 'zip' AND dh_place_name = 'New York' AND property_type = 'All Residential' AND period_start = (SELECT max(period_start) FROM redfin_new_listings WHERE geo_type = 'zip' AND dh_place_name = 'New York' AND property_type = 'All Residential') ORDER BY metric_value DESC LIMIT 10;" - }, - { - "prompt_text": "what is the proportion of the total number of listings in LA over California?", - "sql": "SELECT la_data.metric_value AS la_inventory, ca_data.metric_value AS ca_inventory, (la_data.metric_value / ca_data.metric_value) * 100 AS la_proportion FROM redfin_inventory la_data INNER JOIN redfin_inventory ca_data ON la_data.dh_state_name = ca_data.dh_state_name AND la_data.property_type = ca_data.property_type AND la_data.period_end = ca_data.period_end WHERE ca_data.geo_type = 'state' AND la_data.geo_type = 'city' AND la_data.dh_state_name = 'California' AND la_data.dh_place_name = 'Los Angeles' AND la_data.property_type = 'All Residential' ORDER BY la_data.period_end DESC LIMIT 1;" - }, - { - "prompt_text": "What are the current listings for single-family homes in LA?", - "sql": "SELECT metric_value AS inventory FROM redfin_inventory WHERE geo_type = 'city' AND dh_state_name = 'California' AND dh_place_name = 'Los Angeles' AND property_type = 'Single-family' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "What are the most popular types of properties (e.g., single-family homes, condos, apartments) in California?", - "sql": "SELECT period_start, property_type, metric_value AS inventory FROM redfin_inventory WHERE geo_type = 'state' AND dh_state_name = 'California' AND property_type <> 'All Residential' AND period_start = (SELECT max(period_start) FROM redfin_inventory WHERE geo_type = 'state' AND dh_state_name = 'California' AND property_type <> 'All Residential') ORDER BY metric_value DESC;" - }, - { - "prompt_text": "which are the 3 states with the lowest median sale prices?", - "sql": "SELECT location_name AS state_name, metric_value AS median_price FROM redfin_median_sale_price WHERE geo_type = 'state' AND property_type = 'All Residential' ORDER BY period_start DESC, metric_value ASC LIMIT 3;" - }, - { - "prompt_text": "what is the difference between the most expensive ZIP Code in NY and Miami?", - "sql": "WITH most_expensive_zip_NY AS (SELECT location_name, metric_value AS median_price FROM redfin_median_sale_price WHERE geo_type = 'zip' AND property_type = 'All Residential' AND dh_state_name = 'New York' AND dh_place_name = 'New York' ORDER BY period_end DESC, metric_value DESC LIMIT 1) , most_expensive_zip_Miami AS ( SELECT location_name, metric_value AS median_price FROM redfin_median_sale_price WHERE geo_type = 'zip' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Miami' ORDER BY period_end DESC, metric_value DESC LIMIT 1 ) SELECT ny.location_name AS NY_most_expensive_zip, ny.median_price AS ny_zip_median_price, miami.location_name AS Miami_most_expensive_zip, miami.median_price AS miami_zip_median_price, (ny.median_price - miami.median_price) * 100 / miami.median_price AS pct_diff FROM most_expensive_zip_NY ny, most_expensive_zip_Miami miami;" - }, - { - "prompt_text": "what is the difference between the ZIP Code with the highest median home sale value in Los Angeles and the LA median?", - "sql": "WITH highest_zip_data AS (SELECT period_end, location_name, metric_value AS median_price FROM redfin_median_sale_price WHERE geo_type = 'zip' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_place_name = 'Los Angeles' ORDER BY period_end DESC, metric_value DESC LIMIT 1) SELECT highest_zip_data.location_name AS highest_zip, highest_zip_data.median_price AS highest_zip_median_price, la_data.metric_value AS la_median_price, (la_data.metric_value - highest_zip_data.median_price) * 100 / highest_zip_data.median_price as pct_diff FROM redfin_median_sale_price la_data INNER JOIN highest_zip_data ON la_data.period_end = highest_zip_data.period_end WHERE la_data.geo_type = 'city' AND la_data.property_type = 'All Residential' AND la_data.dh_state_name = 'California' AND la_data.dh_place_name = 'Los Angeles' ORDER BY la_data.period_end DESC LIMIT 1;" - }, - { - "prompt_text": "which are the top 3 ZIP Codes with the highest property sale prices in Los Angeles?", - "sql": "SELECT location_name, metric_value AS median_price FROM redfin_median_sale_price WHERE geo_type = 'zip' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_place_name = 'Los Angeles' AND period_start = (SELECT max(period_start) FROM redfin_median_sale_price WHERE geo_type = 'zip' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_place_name = 'Los Angeles') ORDER BY metric_value DESC LIMIT 3;" - }, - { - "prompt_text": "how did rent prices change bewteen 2020 and 2022 in Miami?", - "sql": "SELECT period_start, metric_value AS median_price FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Miami' AND period_start BETWEEN '2020-01-01' AND '2022-12-31' ORDER BY period_start DESC;" - }, - { - "prompt_text": "What is the difference between the highest and lowest rent for ZIP codes in Orlando?", - "sql": "WITH all_zips_data AS ( SELECT\tlocation_name, metric_value AS median_price FROM renthub_median_rent WHERE geo_type = 'zip' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Orlando' AND period_end = \t(SELECT max(period_end) FROM renthub_median_rent WHERE geo_type = 'zip' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Orlando' ) ) SELECT azd1.location_name AS highest_zip, azd1.median_price AS highest_rent, azd2.location_name AS lowest_zip, azd2.median_price AS lowest_rent, (azd1.median_price - azd2.median_price) as total_diff FROM all_zips_data azd1, all_zips_data azd2 WHERE azd1.median_price = (SELECT max(median_price) FROM all_zips_data) AND azd2.median_price = (SELECT min(median_price) FROM all_zips_data);" - }, - { - "prompt_text": "Can you provide data on historical property rent prices in San Antonio, Texas from Feb 2022?", - "sql": "SELECT period_start, metric_value AS median_price FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Texas' AND dh_place_name = 'San Antonio' AND period_start >= '2022-02-01' ORDER BY period_end DESC;" - }, - { - "prompt_text": "In which cities in Texas are the median rent prices higher for condos compared to Apartment buildings?", - "sql": "WITH DATA AS (SELECT location_name, property_type, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' and dh_state_name = 'Texas' AND (property_type = 'Condo' OR property_type = 'Apartment Building') AND period_start = (SELECT max(period_start) FROM renthub_median_rent WHERE geo_type = 'city' and dh_state_name = 'Texas') ) SELECT condo.location_name, condo.median_price AS condo_median_price, apartment_buildings.median_price AS apartment_building_median_price FROM DATA condo JOIN DATA apartment_buildings ON condo.location_name = apartment_buildings.location_name WHERE condo.property_type = 'Condo' AND apartment_buildings.property_type = 'Apartment Building' AND condo.median_price > apartment_buildings.median_price;" - }, - { - "prompt_text": "In how many cities in Nevada are the median rent prices higher for condos compared to Apartment buildings?", - "sql": "WITH DATA AS (SELECT location_name, property_type, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' and dh_state_name = 'Nevada' AND (property_type = 'Condo' OR property_type = 'Apartment Building') AND period_start = (SELECT max(period_start) FROM renthub_median_rent WHERE geo_type = 'city' and dh_state_name = 'Nevada') ) SELECT COUNT(condo.location_name) AS num_cities FROM DATA condo JOIN DATA apartment_buildings ON condo.location_name = apartment_buildings.location_name WHERE condo.property_type = 'Condo' AND apartment_buildings.property_type = 'Apartment Building' AND condo.median_price > apartment_buildings.median_price;" - }, - { - "prompt_text": "In how many cities in Texas are the median rent prices higher for Townhouses compared to Condos?", - "sql": "WITH DATA AS (SELECT location_name, property_type, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' and dh_state_name = 'Texas' AND (property_type = 'Townhouse' OR property_type = 'Condo') AND period_start = (SELECT max(period_start) FROM renthub_median_rent WHERE geo_type = 'city' and dh_state_name = 'Texas') ) SELECT COUNT(townhouse.location_name) AS num_cities FROM DATA townhouse JOIN DATA condo ON townhouse.location_name = condo.location_name WHERE townhouse.property_type = 'Townhouse' AND condo.property_type = 'Condo' AND townhouse.median_price > condo.median_price;" - }, - { - "prompt_text": "In how many cities in California are the median sale prices higher for single family compared to Townhouses?", - "sql": "WITH DATA AS (SELECT location_name, property_type, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'city' and dh_state_name = 'California' AND (property_type = 'Single-family' OR property_type = 'Townhouse') AND period_start = (SELECT max(period_start) FROM redfin_median_sale_price WHERE geo_type = 'city' and dh_state_name = 'California') ) SELECT COUNT(single_family.location_name) AS num_cities FROM DATA single_family JOIN DATA townhouse ON single_family.location_name = townhouse.location_name WHERE single_family.property_type = 'Single-family' AND townhouse.property_type = 'Townhouse' AND single_family.median_price > townhouse.median_price;" - }, - { - "prompt_text": "Which city showed the highest total increase in new listings over the past three months for real estate for townhouse in Ohio?", - "sql": "WITH date_range AS (SELECT max(period_start) AS new_date, (max(period_start) - interval '3 months')::date AS old_date FROM redfin_median_sale_price WHERE geo_type = 'city' AND property_type = 'Townhouse' AND dh_state_name = 'Ohio'), DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'Townhouse' AND dh_state_name = 'Ohio' AND (period_start = (SELECT new_date FROM date_range) OR period_start = (SELECT old_date FROM date_range)) ) SELECT cd.location_name, cd.new_listings AS new_new_listings, ld.new_listings AS old_new_listings, (cd.new_listings - ld.new_listings) AS total_increase FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = (SELECT new_date FROM date_range) AND ld.period_start = (SELECT old_date FROM date_range) ORDER BY total_increase DESC LIMIT 1;" - }, - { - "prompt_text": "Which zip showed the highest total increase in real estate inventory over the past month for single-family in Nevada?", - "sql": "WITH date_range AS (SELECT max(period_start) AS new_date, (max(period_start) - interval '1 months')::date AS old_date FROM redfin_median_sale_price WHERE geo_type = 'zip' AND property_type = 'Single-family' AND dh_state_name = 'Nevada'), DATA AS (SELECT location_name, metric_value AS inventory, period_start FROM redfin_inventory WHERE geo_type = 'zip' AND property_type = 'Single-family' AND dh_state_name = 'Nevada' AND (period_start = (SELECT new_date FROM date_range) OR period_start = (SELECT old_date FROM date_range)) ) SELECT cd.location_name, cd.inventory AS new_inventory, ld.inventory AS old_inventory, (cd.inventory - ld.inventory) AS total_increase FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = (SELECT new_date FROM date_range) AND ld.period_start = (SELECT old_date FROM date_range) ORDER BY total_increase DESC LIMIT 1;" - }, - { - "prompt_text": "Which county showed the highest total increase in median sale price over the past year for Multi-family in Florida?", - "sql": "WITH date_range AS (SELECT max(period_start) AS new_date, (max(period_start) - interval '12 months')::date AS old_date FROM redfin_median_sale_price WHERE geo_type = 'county' AND property_type = 'Multi-family' AND dh_state_name = 'Florida'), DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'county' AND property_type = 'Multi-family' AND dh_state_name = 'Florida' AND (period_start = (SELECT new_date FROM date_range) OR period_start = (SELECT old_date FROM date_range)) ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, (cd.median_price - ld.median_price) AS total_increase FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = (SELECT new_date FROM date_range) AND ld.period_start = (SELECT old_date FROM date_range) ORDER BY total_increase DESC LIMIT 1;" - }, - { - "prompt_text": "Which city showed the highest total increase in median rent price for condo in Texas from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'Condo' AND dh_state_name = 'Texas' AND (period_start = '2023-03-01' OR period_start = '2022-03-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, (cd.median_price - ld.median_price) AS total_increase FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01' ORDER BY total_increase DESC LIMIT 1;" - }, - { - "prompt_text": "Did new listings in real estate increase/decrease in San Antonio for Single-family from Feb 2022 to Feb 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'Single-family' AND dh_state_name = 'Texas' AND dh_place_name = 'San Antonio' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.new_listings AS new_new_listings, ld.new_listings AS old_new_listings, ((cd.new_listings - ld.new_listings) * 100 / ld.new_listings) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "Did inventory of real estate increase/decrease in Las Vegas for Townhouse from Feb 2022 to Feb 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS inventory, period_start FROM redfin_inventory WHERE geo_type = 'city' AND property_type = 'Townhouse' AND dh_state_name = 'Nevada' AND dh_place_name = 'Las Vegas' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.inventory AS new_inventory, ld.inventory AS old_inventory, ((cd.inventory - ld.inventory) * 100 / ld.inventory) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "Did median rent price increase/decrease in Sacramento for House from Feb 2022 to Feb 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'House' AND dh_state_name = 'California' AND dh_place_name = 'Sacramento' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "Did median sale price increase/decrease in Orlando for Single-family from Feb 2022 to Feb 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'city' AND property_type = 'Single-family' AND dh_state_name = 'Florida' AND dh_place_name = 'Orlando' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "Which property type had the highest new listings number in Queens county?", - "sql": "SELECT\tperiod_end, property_type, \t\tmetric_value AS new_listings FROM \tredfin_new_listings WHERE \tgeo_type = 'county' AND\t\tdh_state_name = 'New York' AND \tdh_county_fullname = 'Queens County' AND \tproperty_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which property type had the highest inventory of real estate in Nevada?", - "sql": "SELECT\tperiod_end, property_type, \t\tmetric_value AS inventory FROM \tredfin_inventory WHERE \tgeo_type = 'state' AND\t\tdh_state_name = 'Nevada' AND \tproperty_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which property type had the highest median rent price in Dade county?", - "sql": "SELECT period_end, property_type, metric_value AS median_price FROM renthub_median_rent WHERE geo_type = 'county' AND dh_state_name = 'Florida' AND dh_county_name = 'Miami-Dade' AND \tproperty_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which property type had the highest median sale price in Florida?", - "sql": "SELECT period_end, \t property_type, metric_value AS median_price FROM redfin_median_sale_price WHERE geo_type = 'state' AND dh_state_name = 'Florida' AND \tproperty_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "How much did real estate new listings number change from Feb 2022 to Feb 2023 in Queens county for Townhouse?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'county' AND property_type = 'Townhouse' AND dh_state_name = 'New York' AND dh_county_name = 'Queens' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, \t cd.new_listings AS new_new_listings, \t ld.new_listings AS old_new_listings, ((cd.new_listings - ld.new_listings) * 100 / ld.new_listings) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "How much did real estate inventory change from Feb 2022 to Feb 2023 in Illinois for Multi-family?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS inventory, period_start FROM redfin_inventory WHERE geo_type = 'state' AND property_type = 'Multi-family' AND dh_state_name = 'Illinois' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, \t cd.inventory AS new_inventory, ld.inventory AS old_inventory, ((cd.inventory - ld.inventory) * 100 / ld.inventory) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "How much did median sale price change from Feb 2022 to Feb 2023 in North Carolina for Single-family?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'state' AND property_type = 'Single-family' AND dh_state_name = 'North Carolina' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "How much did median rent price change from Feb 2022 to Feb 2023 in Miami city for Condo?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'Condo' AND dh_state_name = 'Florida' AND dh_place_name = 'Miami' AND (period_start = '2023-02-01' OR period_start = '2022-02-01') ) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-02-01' AND ld.period_start = '2022-02-01';" - }, - { - "prompt_text": "How many new listings are there in San antonio texas for Townhouse?", - "sql": "SELECT period_end, metric_value AS new_listings FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'Townhouse' AND dh_state_name = 'Texas' AND dh_place_name = 'San Antonio' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "What is the total number of listings in San Francisco for Single-family?", - "sql": "SELECT period_end, metric_value AS inventory FROM redfin_inventory WHERE geo_type = 'city' AND property_type = 'Single-family' AND dh_state_name = 'California' AND dh_place_name = 'San Francisco' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "What is the median sale price in Orlando for Multi-family?", - "sql": "SELECT period_end, metric_value AS median_price FROM redfin_median_sale_price WHERE geo_type = 'city' AND property_type = 'Multi-family' AND dh_state_name = 'Florida' AND dh_place_name = 'Orlando' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "What is the median rent price in Dade county for Apartment Building?", - "sql": "SELECT period_end, metric_value AS median_price, FROM renthub_median_rent WHERE geo_type = 'county' AND property_type = 'Apartment Building' AND dh_state_name = 'Florida' AND dh_county_name = 'Miami-Dade' ORDER BY period_end DESC LIMIT 1;" - }, - { - "prompt_text": "What's the percent change in new listings in real estate for San Francisco from Feb 2023 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_place_name = 'San Francisco' AND (period_start = '2023-03-01' OR period_start = '2023-02-01')) SELECT cd.location_name, \t cd.new_listings AS new_new_listings, ld.new_listings AS old_new_listings, ((cd.new_listings - ld.new_listings) * 100 / ld.new_listings) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2023-02-01';" - }, - { - "prompt_text": "What's the percent change in inventory of real estatea for Orlando from Feb 2023 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS inventory, period_start FROM redfin_inventory WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Orlando' AND (period_start = '2023-03-01' OR period_start = '2023-02-01')) SELECT cd.location_name, \t cd.inventory AS new_inventory, ld.inventory AS old_inventory, ((cd.inventory - ld.inventory) * 100 / ld.inventory) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2023-02-01';" - }, - { - "prompt_text": "What's the percent change in median rent price for Queens county from June 2023 to July 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'New York' AND dh_county_name = 'Queens' AND (period_start = '2023-07-01' OR period_start = '2023-06-01')) SELECT cd.location_name, \t cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-07-01' AND ld.period_start = '2023-06-01';" - }, - { - "prompt_text": "What's the percent change in median sale price for Angeles county from Feb 2023 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_place_name = 'Los Angeles' AND (period_start = '2023-03-01' OR period_start = '2023-02-01')) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2023-02-01';" - }, - { - "prompt_text": "How does the new listings in real estate compare across Chicago and San Francisco?", - "sql": "WITH Chicago_city_data AS (SELECT period_end, location_name, metric_value AS new_listings FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Illinois' AND dh_place_name = 'Chicago' ORDER BY period_end DESC), San_Francisco_city_data AS (SELECT period_end, location_name, metric_value AS new_listings FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_place_name = 'San Francisco' ORDER BY period_end DESC) SELECT chicago.period_end, chicago.new_listings AS chicago_new_listings, sf.new_listings AS sf_new_listings, (chicago.new_listings - sf.new_listings) * 100 / sf.new_listings AS pct_diff FROM Chicago_city_data chicago JOIN San_Francisco_city_data sf ON chicago.period_end = sf.period_end ORDER BY chicago.period_end DESC LIMIT 5;" - }, - { - "prompt_text": "How does the inventory of real estate compare across Miami city and Orlando?", - "sql": "WITH Miami_city_data AS (SELECT period_end, location_name, metric_value AS inventory FROM redfin_inventory WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Miami' ORDER BY period_end DESC), Orlando_city_data AS (SELECT period_end, location_name, metric_value AS inventory FROM redfin_inventory WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Orlando' ORDER BY period_end DESC) SELECT miami.period_end, miami.inventory AS miami_inventory, orlando.inventory AS orlando_inventory, (miami.inventory - orlando.inventory) * 100 / orlando.inventory AS pct_diff FROM Miami_city_data miami JOIN Orlando_city_data orlando ON miami.period_end = orlando.period_end ORDER BY miami.period_end DESC LIMIT 5;" - }, - { - "prompt_text": "How does the median rent price compare across Los Angeles county and Queens county?", - "sql": "WITH Los_Angeles_county_data AS (SELECT period_end, location_name, metric_value AS median_price FROM renthub_median_rent WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'New York' AND dh_county_name = 'Queens' ORDER BY period_end DESC), Queens_county_data AS (SELECT period_end, location_name, metric_value AS median_price FROM renthub_median_rent WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_county_name = 'Los Angeles' ORDER BY period_end DESC) SELECT la.period_end, la.median_price AS la_median_price, queens.median_price AS queens_median_price, (la.median_price - queens.median_price) * 100 / queens.median_price AS pct_diff FROM Los_Angeles_county_data la JOIN Queens_county_data queens ON la.period_end = queens.period_end ORDER BY la.period_end DESC LIMIT 5;" - }, - { - "prompt_text": "How does the median sale price compare across Dade county and Los Angeles county?", - "sql": "WITH Dade_county_data AS ( \tSELECT period_end, \t\tlocation_name, \t\tmetric_value AS median_price \tFROM redfin_median_sale_price \tWHERE geo_type = 'county' \t AND property_type = 'All Residential' \t AND dh_state_name = 'Florida' \t AND dh_county_name = 'Miami-Dade' \tORDER BY period_end DESC), Los_Angeles_county_data AS ( \tSELECT period_end, \t\tlocation_name, \t\tmetric_value AS median_price \tFROM redfin_median_sale_price \tWHERE geo_type = 'county' \t AND property_type = 'All Residential' \t AND dh_state_name = 'California' \t AND dh_county_name = 'Los Angeles' \tORDER BY period_end DESC) SELECT dade.period_end, \tdade.median_price AS dade_median_price, \tla.median_price AS la_median_price, \t(dade.median_price - la.median_price) * 100 / la.median_price AS pct_diff FROM Dade_county_data dade JOIN Los_Angeles_county_data la ON dade.period_end = la.period_end ORDER BY dade.period_end DESC LIMIT 5;" - }, - { - "prompt_text": "Which property type had the highest new listings number in Queens county?", - "sql": "SELECT period_end, property_type, metric_value FROM redfin_new_listings WHERE geo_type = 'county' AND dh_state_name = 'New York' AND dh_county_name = 'Queens' AND property_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which property type had the highest inventory of real estate in Los Angeles county?", - "sql": "SELECT period_end, property_type, metric_value FROM redfin_inventory WHERE geo_type = 'county' AND dh_state_name = 'California' AND dh_county_name = 'Los Angeles' AND property_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which property type had the highest median rent price in Dade county?", - "sql": "SELECT period_end, property_type, metric_value FROM renthub_median_rent WHERE geo_type = 'county' AND dh_state_name = 'Florida' AND dh_county_name = 'Miami-Dade' AND property_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which property type had the highest median sale price in Miami city?", - "sql": "SELECT period_end, property_type, metric_value FROM redfin_median_sale_price WHERE geo_type = 'city' AND dh_state_name = 'Florida' AND dh_place_name = 'Miami' AND property_type <> 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "How much did real estate new listings number change from March 2022 to March 2023 in Queens county?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'New York' AND dh_county_name = 'Queens' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.new_listings AS new_new_listings, ld.new_listings AS old_new_listings, ((cd.new_listings - ld.new_listings) * 100 / ld.new_listings) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01';" - }, - { - "prompt_text": "How much did real estate inventory change from March 2022 to March 2023 in Los Angeles county?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS inventory, period_start FROM redfin_inventory WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'California' AND dh_county_name = 'Los Angeles' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.inventory AS new_inventory, ld.inventory AS old_inventory, ((cd.inventory - ld.inventory) * 100 / ld.inventory) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01';" - }, - { - "prompt_text": "How much did median sale price change from March 2022 to March 2023 in Dade county?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'county' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_county_name = 'Miami-Dade' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01';" - }, - { - "prompt_text": "How much did median rent price change from July 2022 to July 2023 in Miami city?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Florida' AND dh_place_name = 'Miami' AND (period_start = '2023-07-01' OR period_start = '2022-07-01')) SELECT cd.location_name, \t cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-07-01' AND ld.period_start = '2022-07-01';" - }, - { - "prompt_text": "which is the city with the highest decrease in the number of new listings of Real Estate in Ohio from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Ohio' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.new_listings AS new_new_listings, ld.new_listings AS old_new_listings, ((cd.new_listings - ld.new_listings) * 100 / ld.new_listings) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01' ORDER BY pct_change ASC LIMIT 1;" - }, - { - "prompt_text": "which is the city with the highest decrease in the inventory of Real Estate in North Carolina from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS inventory, period_start FROM redfin_inventory WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'North Carolina' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.inventory AS new_inventory, ld.inventory AS old_inventory, ((cd.inventory - ld.inventory) * 100 / ld.inventory) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01' ORDER BY pct_change ASC LIMIT 1;" - }, - { - "prompt_text": "which is the city with the highest decrease in the median sale price in Texas from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Texas' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01' ORDER BY pct_change ASC LIMIT 1;" - }, - { - "prompt_text": "which is the city with the highest decrease in the median rent price in Texas from July 2022 to July 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Texas' AND (period_start = '2023-07-01' OR period_start = '2022-07-01')) SELECT cd.location_name, \t cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-07-01' AND ld.period_start = '2022-07-01' ORDER BY pct_change ASC LIMIT 1;" - }, - { - "prompt_text": "which is the city with the highest increase in the number of new listings of Real Estate in Texas from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS new_listings, period_start FROM redfin_new_listings WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Texas' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, \t cd.new_listings AS new_new_listings, ld.new_listings AS old_new_listings, ((cd.new_listings - ld.new_listings) * 100 / ld.new_listings) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01' ORDER BY pct_change DESC LIMIT 1;" - }, - { - "prompt_text": "which is the city with the highest increase in the inventory of Real Estate in Illinois from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS inventory, period_start FROM redfin_inventory WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Illinois' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, cd.inventory AS new_inventory, ld.inventory AS old_inventory, ((cd.inventory - ld.inventory) * 100 / ld.inventory) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01' ORDER BY pct_change DESC LIMIT 1;" - }, - { - "prompt_text": "which is the city with the highest increase in the median sale price in North Carolina from March 2022 to March 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM redfin_median_sale_price WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'North Carolina' AND (period_start = '2023-03-01' OR period_start = '2022-03-01')) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-03-01' AND ld.period_start = '2022-03-01' ORDER BY pct_change DESC LIMIT 1;" - }, - { - "prompt_text": "which is the city with the highest increase in the median rent price in Texas from July 2022 to July 2023?", - "sql": "WITH DATA AS (SELECT location_name, metric_value AS median_price, period_start FROM renthub_median_rent WHERE geo_type = 'city' AND property_type = 'All Residential' AND dh_state_name = 'Texas' AND (period_start = '2023-07-01' OR period_start = '2022-07-01')) SELECT cd.location_name, cd.median_price AS new_median_price, ld.median_price AS old_median_price, ((cd.median_price - ld.median_price) * 100 / ld.median_price) AS pct_change FROM DATA cd JOIN DATA ld ON cd.location_name = ld.location_name WHERE cd.period_start = '2023-07-01' AND ld.period_start = '2022-07-01' ORDER BY pct_change DESC LIMIT 1;" - }, - { - "prompt_text": "Which city has the lowest number of new listings overall in Ohio?", - "sql": "SELECT period_end, \t location_name, metric_value FROM redfin_new_listings WHERE geo_type='city' AND dh_state_name = 'Ohio' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value ASC LIMIT 1;" - }, - { - "prompt_text": "Which state has the lowest inventory overall?", - "sql": "SELECT period_end, \t location_name, metric_value FROM redfin_inventory WHERE geo_type='state' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value ASC LIMIT 1;" - }, - { - "prompt_text": "Which city has the lowest median rent price in Orange county?", - "sql": "SELECT period_end, \t location_name, metric_value FROM renthub_median_rent WHERE geo_type='city' AND dh_state_name = 'California' AND dh_county_name = 'Orange' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value ASC LIMIT 1;" - }, - { - "prompt_text": "Which county has the lowest median sale price in Florida?", - "sql": "SELECT period_end, \t location_name, metric_value FROM redfin_median_sale_price WHERE geo_type='county' AND dh_state_name = 'Florida' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value ASC LIMIT 1;" - }, - { - "prompt_text": "Which State has the largest number of inventory overall?", - "sql": "SELECT period_end, \t location_name, metric_value FROM redfin_inventory WHERE geo_type='state' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which ZIP Code has the largest inventory overall in Chicago?", - "sql": "SELECT period_end, \t location_name, metric_value FROM redfin_inventory WHERE geo_type='zip' AND dh_state_name='Illinois' AND dh_place_name = 'Chicago' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which county has the highest median rent price overall in Florida?", - "sql": "SELECT period_end, \t location_name, metric_value FROM renthub_median_rent WHERE geo_type='county' AND dh_state_name='Florida' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "Which city has the highest median sale price overall in Orange County, California?", - "sql": "SELECT period_end, \t location_name, metric_value FROM redfin_median_sale_price WHERE geo_type='city' AND dh_county_name= 'Orange' AND dh_state_name='California' AND property_type = 'All Residential' ORDER BY period_end DESC, metric_value DESC LIMIT 1;" - }, - { - "prompt_text": "How many new listings are there for each property type in Orange county?", - "sql": "SELECT property_type, metric_value FROM redfin_inventory WHERE geo_type='county' AND dh_state_name='California' AND dh_county_name='Orange' AND property_type <> 'All Residential' AND period_start = (SELECT max(period_start) FROM redfin_inventory WHERE geo_type='county' AND dh_state_name='California' AND dh_county_name='Orange' AND property_type <> 'All Residential') ORDER BY metric_value DESC;" - }, - { - "prompt_text": "What is the total number of listings for each property type in New York city?", - "sql": "SELECT property_type, metric_value FROM redfin_inventory WHERE geo_type='city' AND dh_state_name='New York' AND dh_place_name='New York' AND property_type <> 'All Residential' AND period_start = (SELECT max(period_start) FROM redfin_inventory WHERE geo_type='city' AND dh_state_name='New York' AND dh_place_name='New York' AND property_type <> 'All Residential') ORDER BY metric_value DESC;" - }, - { - "prompt_text": "What is the median sale price for each property type in California state?", - "sql": "SELECT property_type, metric_value FROM renthub_median_rent WHERE geo_type='state' AND dh_state_name = 'California' AND period_start = (SELECT max(period_start) FROM renthub_median_rent WHERE geo_type='state' AND dh_state_name = 'California') ORDER BY property_type ASC;" - }, - { - "prompt_text": "What is the median rent price for each property type in Los angeles city?", - "sql": "SELECT property_type, metric_value FROM renthub_median_rent WHERE geo_type='city' AND dh_state_name = 'California' AND dh_place_name = 'Los Angeles' AND period_start = (SELECT max(period_start) FROM renthub_median_rent WHERE geo_type='city' AND dh_state_name = 'California' AND dh_place_name = 'Los Angeles') ORDER BY property_type ASC;" - }, - { - "prompt_text": "rents in santa monica 2021 till jan 2023", - "sql": "SELECT period_start, period_end, metric_value FROM renthub_median_rent WHERE geo_type = 'city' AND location_name = 'Santa Monica' AND dh_state_name = 'California' AND property_type = 'All Residential' AND period_start BETWEEN '2021-01-01' AND '2023-01-31' ORDER BY period_start;" - }, - { - "prompt_text": "how many homes were sold in orange county in 2022 broken down by property type", - "sql": "SELECT property_type, SUM(metric_value) FROM redfin_homes_sold rhs WHERE geo_type='county' AND location_name='Orange' AND dh_state_name='California' AND property_type <> 'All Residential' AND period_end BETWEEN '2022-01-01' AND '2022-12-31' GROUP BY property_type;" - }, - { - "prompt_text": "average home price 90405", - "sql": "SELECT period_start, period_end, metric_value FROM redfin_median_list_price rmlp WHERE geo_type='zip' AND location_name = '90405' AND dh_state_name = 'California' AND property_type = 'All Residential' ORDER BY period_start DESC LIMIT 1;" - }, - { - "prompt_text": "compare home prices in los angeles vs austin since 2022", - "sql": "SELECT period_end, location_name, dh_state_name, metric_value FROM redfin_median_sale_price WHERE geo_type='city' AND property_type = 'All Residential' AND period_end >= '2022-01-01' AND ((location_name='Los Angeles' AND dh_state_name='California') \t OR (location_name = 'Austin' AND dh_state_name='Texas')) ORDER BY period_end, dh_state_name, location_name;" - }, - { - "prompt_text": "Did property prices increase or descrease in the US in 2020?", - "sql": "SELECT period_start, metric_value FROM redfin_median_list_price rmlp WHERE geo_type ='national' AND property_type = 'All Residential' AND is_seasonally_adjusted = False AND period_start BETWEEN '2020-1-1' AND '2020-12-31' ORDER BY period_start;" - }, - { - "prompt_text": "How many townhomes have been sold in Austin, TX so far in 2023?", - "sql": "SELECT dh_state_name, location_name, sum(metric_value) as townhomes_sold FROM redfin_homes_sold rhs WHERE geo_type='city' AND dh_state_name = 'Texas' AND location_name ='Austin' AND property_type='Townhouse' AND period_start >= '2023-01-1' GROUP BY location_name, dh_state_name;" - }, - { - "prompt_text": "what was the median home sale price in Califronia in Q1 2021?", - "sql": "SELECT location_name, \t period_end, metric_value FROM redfin_median_sale_price rmsp WHERE geo_type = 'state' AND location_name='California' AND property_type = 'All Residential' AND period_start BETWEEN '2021-01-01' AND '2021-03-31' ORDER BY period_end;" - }, - { - "prompt_text": "what was the most expensive zip code to rent in Los Angeles county in May 2022?", - "sql": "SELECT location_name, metric_value FROM renthub_median_rent WHERE dh_county_name = 'Los Angeles' AND dh_state_name = 'California' AND property_type = 'All Residential' AND period_start='2022-05-01' AND geo_type='zip' ORDER BY metric_value DESC LIMIT 1;" - } - ], - "finetunings": [], - "created_at": { "$date": "2024-04-10T00:00:00.000Z" } - } - } - } - } - ] - } } ] } diff --git a/services/enterprise/database/scripts/initial_setup.py b/services/enterprise/database/scripts/initial_setup.py deleted file mode 100644 index aeb79486..00000000 --- a/services/enterprise/database/scripts/initial_setup.py +++ /dev/null @@ -1,149 +0,0 @@ -import json -from datetime import datetime - -import pymongo -from bson.objectid import ObjectId -from pymongo.errors import DuplicateKeyError - -import config -from modules.key.models.requests import KeyGenerationRequest -from modules.key.service import KeyService -from utils.encrypt import FernetEncrypt - - -def insert_or_update(data_store, collection: str, document: dict) -> str: - id = ObjectId(document["_id"]) - try: - document["_id"] = id - data_store[collection].insert_one(document) - except DuplicateKeyError: - document.pop("_id", None) - data_store[collection].update_one({"_id": ObjectId(id)}, {"$set": document}) - return str(id) - - -if __name__ == "__main__": - data_store = pymongo.MongoClient(config.db_settings.mongodb_uri)[ - config.db_settings.mongodb_db_name - ] - - fernet_encrypt = FernetEncrypt() - organization_id = ObjectId("65847ee5c2f29b08592c2402") - user_id = ObjectId("65847ee5c2f29b08592c2403") - db_connection_id = ObjectId("65847ee5c2f29b08592c2401") - finetuning_id = ObjectId("659c57d1d648d1d3a6d96373") - api_key = "dh-016e428d9f0c1c42458fcf4f5b407584a777b2fbf8d453670c2b8fc877511035" - user_email = "postmanapitest@dataherald.com" - initial_credits = 600 - - insert_or_update( - data_store, - "database_connections", - { - "_id": db_connection_id, - "alias": "snowflake local test", - "use_ssh": False, - "connection_uri": fernet_encrypt.encrypt( - "snowflake://Leo:Dat31642099.00@ksxgmup-qrb65970/v2_real_estate/public" - ), - "ssh_settings": None, - "created_at": datetime.now(), - "metadata": {"dh_internal": {"organization_id": str(organization_id)}}, - }, - ) - - print(f"DB connection: {db_connection_id}") - - insert_or_update( - data_store, - "organizations", - { - "_id": organization_id, - "name": "Organization 1", - "owner": str(user_id), - "confidence_threshold": 1, - "invoice_details": { - "plan": "CREDIT_ONLY", - "billing_cycle_anchor": 1708719407, - "spending_limit": 1000, - "hard_spending_limit": 10000, - "available_credits": initial_credits, - "stripe_customer_id": "cus_PcJnlZg6LgqmkH", - "stripe_subscription_id": "sub_1On5ApEohyIdoJ6S2VKhBaBk", - "stripe_subscription_status": "active", - }, - "created_at": datetime.now(), - }, - ) - - print(f"Organization created: {organization_id}") - - insert_or_update( - data_store, - "users", - { - "_id": user_id, - "email": user_email, - "organization_id": str(organization_id), - "created_at": datetime.now(), - "role": None, - }, - ) - - print(f"User created: {user_id}") - - insert_or_update( - data_store, - "credits", - { - "_id": ObjectId("659c57d1d648d1d3a6d96374"), - "organization_id": str(organization_id), - "amount": initial_credits, - "status": "RECORDED", - "description": "Initial credits", - "created_at": datetime.now(), - }, - ) - - print("Initial credits created") - - insert_or_update( - data_store, - "finetunings", - { - "_id": finetuning_id, - "alias": "Postman test", - "db_connection_id": str(db_connection_id), - "status": "SUCCEEDED", - "error": "", - "base_llm": { - "model_provider": "", - "model_name": "gpt-3.5-turbo-1106", - "model_parameters": {}, - }, - "finetuning_file_id": "file-DCovtOj6OZ54DfmYoMMyod39", - "finetuning_job_id": "ftjob-ZyojRxCWvyki1O4v2mz4YYpn", - "model_id": "ft:gpt-3.5-turbo-1106:dataherald::8dUNOq9W", - "created_at": datetime.now(), - "golden_sqls": [], - "metadata": {"dh_internal": {"organization_id": str(organization_id)}}, - }, - ) - - print(f"Finetuning created: {finetuning_id}") - - with open("database/scripts/table_descriptions.json") as jsonfile: - table_descriptions = json.loads(jsonfile.read()) - for table_description in table_descriptions: - table_description["created_at"] = datetime.now() - table_description["last_schema_sync"] = datetime.now() - table_description_id = insert_or_update( - data_store, "table_descriptions", table_description - ) - print(f"Table description created: {table_description_id}") - - key_service = KeyService() - key = key_service.add_key( - KeyGenerationRequest(name="Test key"), str(organization_id), api_key - ) - print(f"Key created: {key}") diff --git a/services/enterprise/database/scripts/table_descriptions.json b/services/enterprise/database/scripts/table_descriptions.json deleted file mode 100644 index dc380a6a..00000000 --- a/services/enterprise/database/scripts/table_descriptions.json +++ /dev/null @@ -1,3638 +0,0 @@ -[ - { - "_id": "65c3bcd39083745908e19ead", - "db_connection_id": "65847ee5c2f29b08592c2401", - "table_name": "renthub_median_rent", - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": true, - "categories": [ - "2022-05-01", - "2022-07-01", - "2022-01-01", - "2021-06-01", - "2022-09-01", - "2022-03-01", - "2021-10-01", - "2021-11-01", - "2022-04-01", - "2023-02-01", - "2022-12-01", - "2021-08-01", - "2021-03-01", - "2021-09-01", - "2022-11-01", - "2021-01-01", - "2023-06-01", - "2020-10-01", - "2022-02-01", - "2021-04-01", - "2022-06-01", - "2022-10-01", - "2021-05-01", - "2022-08-01", - "2023-05-01", - "2021-12-01", - "2020-12-01", - "2020-11-01", - "2021-02-01", - "2021-07-01", - "2023-03-01", - "2023-01-01", - "2023-04-01" - ], - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": true, - "categories": [ - "2021-03-31", - "2022-06-30", - "2022-09-30", - "2023-02-28", - "2021-11-30", - "2023-01-31", - "2023-06-30", - "2021-05-31", - "2021-12-31", - "2022-02-28", - "2021-06-30", - "2023-04-30", - "2020-10-31", - "2020-11-30", - "2022-07-31", - "2021-01-31", - "2020-12-31", - "2022-10-31", - "2022-11-30", - "2023-03-31", - "2022-03-31", - "2022-12-31", - "2021-04-30", - "2021-08-31", - "2021-09-30", - "2022-05-31", - "2023-05-31", - "2021-10-31", - "2022-08-31", - "2022-01-31", - "2021-02-28", - "2022-04-30", - "2021-07-31" - ], - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "neighborhood", - "state", - "county", - "national", - "city", - "zip" - ], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Townhouse", - "Duplex", - "Rent", - "Condo", - "Apartment", - "Single-family house", - "Multi-family house", - "Single-family", - "Unknown", - "All Residential", - "House", - "Multi-family", - "Apartment Building", - "Other" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "17", - "04", - "34", - "21", - "56", - "01", - "48", - "44", - "19", - "02", - "53", - "29", - "-", - "23", - "15", - "25", - "51", - "55", - "46", - "26", - "16", - "06", - "36", - "39", - "22", - "45", - "27", - "05", - "49", - "50", - "72", - "32", - "13", - "28", - "20", - "40", - "30", - "08", - "09", - "18", - "31", - "78", - "12", - "24", - "54", - "41", - "37", - "47", - "11", - "38", - "42", - "10", - "35", - "33" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "New York", - "Nevada", - "Virginia", - "Tennessee", - "Indiana", - "Oklahoma", - "Mississippi", - "District of Columbia", - "Kansas", - "Colorado", - "Delaware", - "Utah", - "Texas", - "Massachusetts", - "North Carolina", - "South Carolina", - "Georgia", - "Arizona", - "South Dakota", - "Wyoming", - "Alaska", - "New Mexico", - "Montana", - "Vermont", - "-", - "Pennsylvania", - "Maryland", - "Wisconsin", - "Nebraska", - "Connecticut", - "Louisiana", - "New Jersey", - "Rhode Island", - "Idaho", - "Arkansas", - "California", - "Missouri", - "Minnesota", - "Puerto Rico", - "Maine", - "Michigan", - "Florida", - "New Hampshire", - "Illinois", - "Washington", - "Hawaii", - "North Dakota", - "Ohio", - "Alabama", - "Iowa", - "Kentucky", - "Oregon", - "West Virginia", - "U.S. Virgin Islands" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "NY", - "NH", - "DE", - "NC", - "CT", - "PR", - "AL", - "MO", - "NJ", - "NV", - "WI", - "AR", - "NM", - "MA", - "TX", - "LA", - "UT", - "PA", - "WY", - "VT", - "HI", - "MN", - "RI", - "- ", - "KY", - "ME", - "CA", - "FL", - "OK", - "KS", - "GA", - "AZ", - "IL", - "MS", - "MT", - "ID", - "ND", - "SD", - "WV", - "VI", - "OH", - "WA", - "OR", - "TN", - "VA", - "MD", - "IA", - "SC", - "CO", - "MI", - "IN", - "NE", - "DC", - "AK" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP_NTZ", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo_xmin", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__schema_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__ingested_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__loaded_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": true, - "categories": [ - "1688676582949", - "1688676446225", - "1688675734055", - "1688675718113", - "1688675777854", - "1688676217447", - "1688675794496", - "1688745960451", - "1688675746412", - "1688676086826", - "1688677550100", - "1688676398321", - "1688676266158", - "1688676608850", - "1688675764547" - ], - "foreign_key": null - }, - { - "name": "__hevo__marked_deleted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "examples": [ - { - "period_start": "2021-04-01", - "period_end": "2021-04-30", - "period_type": "monthly", - "geo_type": "city", - "property_type": "Condo", - "location_name": "Burbank", - "dh_state_fips": "06", - "dh_state_name": "California", - "dh_state_abbr": "CA", - "dh_county_fips": "037", - "dh_county_name": "Los Angeles", - "dh_county_fullname": "Los Angeles County", - "dh_place_fips": "08954", - "dh_place_name": "Burbank", - "dh_place_fullname": "Burbank city", - "dh_city_name": "Burbank", - "dh_city_fullname": "Burbank city", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "1950.0", - "hg_date_updated": "2023-05-31 12:20:01.893000", - "__hevo_xmin": "170174564", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688675665383", - "__hevo__loaded_at": "1688676086826", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2022-04-01", - "period_end": "2022-04-30", - "period_type": "monthly", - "geo_type": "neighborhood", - "property_type": "Condo", - "location_name": "West End", - "dh_state_fips": "09", - "dh_state_name": "Connecticut", - "dh_state_abbr": "CT", - "dh_county_fips": "003", - "dh_county_name": "Hartford", - "dh_county_fullname": "Hartford County", - "dh_place_fips": "37070", - "dh_place_name": "Hartford", - "dh_place_fullname": "Hartford town", - "dh_city_name": "Hartford", - "dh_city_fullname": "Hartford town", - "dh_neighborhood_id": "268797", - "dh_neighborhood_name": "West End", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "1050.0", - "hg_date_updated": "2023-05-30 14:56:16.111000", - "__hevo_xmin": "170033607", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688675665383", - "__hevo__loaded_at": "1688676086826", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2022-05-01", - "period_end": "2022-05-31", - "period_type": "monthly", - "geo_type": "neighborhood", - "property_type": "Apartment Building", - "location_name": "Downtown", - "dh_state_fips": "09", - "dh_state_name": "Connecticut", - "dh_state_abbr": "CT", - "dh_county_fips": "001", - "dh_county_name": "Fairfield", - "dh_county_fullname": "Fairfield County", - "dh_place_fips": "73070", - "dh_place_name": "Stamford", - "dh_place_fullname": "Stamford town", - "dh_city_name": "Stamford", - "dh_city_fullname": "Stamford town", - "dh_neighborhood_id": "273494", - "dh_neighborhood_name": "Downtown", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "2700.0", - "hg_date_updated": "2023-05-30 14:56:16.111000", - "__hevo_xmin": "170033607", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688675665383", - "__hevo__loaded_at": "1688676086826", - "__hevo__marked_deleted": "False" - } - ], - "status": "SCANNED", - "created_at": "2024-02-07T17:24:35.370Z", - "metadata": { - "dh_internal": { - "organization_id": "65847ee5c2f29b08592c2402" - } - }, - "error_message": "", - "last_schema_sync": "2024-02-07T17:28:38.611Z", - "table_schema": "\nCREATE TABLE renthub_median_rent (\n\tperiod_start DATE, \n\tperiod_end DATE, \n\tperiod_type VARCHAR(16777216), \n\tgeo_type VARCHAR(16777216), \n\tproperty_type VARCHAR(16777216), \n\tlocation_name VARCHAR(16777216), \n\tdh_state_fips VARCHAR(16777216), \n\tdh_state_name VARCHAR(16777216), \n\tdh_state_abbr VARCHAR(16777216), \n\tdh_county_fips VARCHAR(16777216), \n\tdh_county_name VARCHAR(16777216), \n\tdh_county_fullname VARCHAR(16777216), \n\tdh_place_fips VARCHAR(16777216), \n\tdh_place_name VARCHAR(16777216), \n\tdh_place_fullname VARCHAR(16777216), \n\tdh_city_name VARCHAR(16777216), \n\tdh_city_fullname VARCHAR(16777216), \n\tdh_neighborhood_id VARCHAR(16777216), \n\tdh_neighborhood_name VARCHAR(16777216), \n\tdh_zip_code VARCHAR(16777216), \n\tis_seasonally_adjusted BOOLEAN, \n\tmetric_value FLOAT, \n\thg_date_updated TIMESTAMP_NTZ, \n\t__hevo_xmin DECIMAL(38, 0), \n\t__hevo__schema_name VARCHAR(16777216), \n\t__hevo__ingested_at DECIMAL(38, 0), \n\t__hevo__loaded_at DECIMAL(38, 0), \n\t__hevo__marked_deleted BOOLEAN\n)" - }, - { - "_id": "65c3bcd39083745908e19eac", - "db_connection_id": "65847ee5c2f29b08592c2401", - "table_name": "redfin_new_listings", - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["quarterly", "monthly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["zip", "city", "state", "county", "national"], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Single-family", - "Single unit", - "Condo/Co-op", - "Townhouse", - "All Residential", - "Multi-family" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "24", - "12", - "54", - "34", - "17", - "21", - "19", - "04", - "44", - "48", - "01", - "02", - "29", - "23", - "15", - "53", - "-", - "26", - "55", - "51", - "25", - "16", - "46", - "13", - "20", - "28", - "30", - "32", - "40", - "09", - "31", - "08", - "18", - "41", - "42", - "47", - "37", - "33", - "11", - "10", - "35", - "39", - "45", - "36", - "06", - "22", - "49", - "05", - "27", - "50" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "New York", - "Virginia", - "Indiana", - "Tennessee", - "Nevada", - "Oklahoma", - "Massachusetts", - "Georgia", - "Vermont", - "Alaska", - "New Mexico", - "Arizona", - "North Carolina", - "South Dakota", - "Montana", - "South Carolina", - "-", - "Texas", - "Utah", - "Florida", - "Hawaii", - "Washington", - "Illinois", - "Michigan", - "New Hampshire", - "Maine", - "Louisiana", - "New Jersey", - "Pennsylvania", - "Wisconsin", - "Connecticut", - "Nebraska", - "Maryland", - "Rhode Island", - "Idaho", - "Arkansas", - "Ohio", - "Kentucky", - "Oregon", - "West Virginia", - "Alabama", - "Iowa", - "Minnesota", - "California", - "Missouri", - "Colorado", - "Delaware", - "Kansas", - "Mississippi", - "District of Columbia" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "NY", - "NH", - "DE", - "NV", - "NJ", - "AR", - "WI", - "NM", - "TX", - "UT", - "MA", - "LA", - "ME", - "KY", - "NC", - "CT", - "AL", - "MO", - "AZ", - "FL", - "ID", - "GA", - "CA", - "OH", - "WA", - "MS", - "MT", - "IL", - "WV", - "SD", - "KS", - "OK", - "PA", - "HI", - "RI", - "MN", - "VT", - "- ", - "VA", - "TN", - "CO", - "IN", - "MI", - "SC", - "MD", - "IA", - "OR", - "DC", - "NE", - "AK" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": true, - "categories": ["True", "False"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP_NTZ", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo_xmin", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__schema_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__ingested_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": true, - "categories": ["1688679382125", "1688675668325", "1688682195721"], - "foreign_key": null - }, - { - "name": "__hevo__loaded_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__marked_deleted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "examples": [ - { - "period_start": "2018-12-01", - "period_end": "2018-12-31", - "period_type": "monthly", - "geo_type": "city", - "property_type": "All Residential", - "location_name": "Cabot", - "dh_state_fips": "05", - "dh_state_name": "Arkansas", - "dh_state_abbr": "AR", - "dh_county_fips": "085", - "dh_county_name": "Lonoke", - "dh_county_fullname": "Lonoke County", - "dh_place_fips": "10300", - "dh_place_name": "Cabot", - "dh_place_fullname": "Cabot city", - "dh_city_name": "Cabot", - "dh_city_fullname": "Cabot city", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "36.0", - "hg_date_updated": "2023-04-28 23:45:25.978000", - "__hevo_xmin": "164119973", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688675668325", - "__hevo__loaded_at": "1688677615652", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2017-11-01", - "period_end": "2017-11-30", - "period_type": "monthly", - "geo_type": "city", - "property_type": "All Residential", - "location_name": "Riverside", - "dh_state_fips": "36", - "dh_state_name": "New York", - "dh_state_abbr": "NY", - "dh_county_fips": "101", - "dh_county_name": "Steuben", - "dh_county_fullname": "Steuben County", - "dh_place_fips": "62061", - "dh_place_name": "Riverside", - "dh_place_fullname": "Riverside village", - "dh_city_name": "Riverside", - "dh_city_fullname": "Riverside village", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "3.0", - "hg_date_updated": "2023-04-28 23:45:25.978000", - "__hevo_xmin": "164119973", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688675668325", - "__hevo__loaded_at": "1688677615652", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2021-09-01", - "period_end": "2021-09-30", - "period_type": "monthly", - "geo_type": "city", - "property_type": "All Residential", - "location_name": "Madison", - "dh_state_fips": "34", - "dh_state_name": "New Jersey", - "dh_state_abbr": "NJ", - "dh_county_fips": "027", - "dh_county_name": "Morris", - "dh_county_fullname": "Morris County", - "dh_place_fips": "42510", - "dh_place_name": "Madison", - "dh_place_fullname": "Madison borough", - "dh_city_name": "Madison", - "dh_city_fullname": "Madison borough", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "22.0", - "hg_date_updated": "2023-04-28 23:45:25.978000", - "__hevo_xmin": "164119973", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1688675668325", - "__hevo__loaded_at": "1688677615652", - "__hevo__marked_deleted": "False" - } - ], - "status": "SCANNED", - "created_at": "2024-02-07T17:24:35.369Z", - "metadata": { - "dh_internal": { - "organization_id": "65847ee5c2f29b08592c2402" - } - }, - "error_message": "", - "last_schema_sync": "2024-02-07T17:28:14.240Z", - "table_schema": "\nCREATE TABLE redfin_new_listings (\n\tperiod_start DATE, \n\tperiod_end DATE, \n\tperiod_type VARCHAR(16777216), \n\tgeo_type VARCHAR(16777216), \n\tproperty_type VARCHAR(16777216), \n\tlocation_name VARCHAR(16777216), \n\tdh_state_fips VARCHAR(16777216), \n\tdh_state_name VARCHAR(16777216), \n\tdh_state_abbr VARCHAR(16777216), \n\tdh_county_fips VARCHAR(16777216), \n\tdh_county_name VARCHAR(16777216), \n\tdh_county_fullname VARCHAR(16777216), \n\tdh_place_fips VARCHAR(16777216), \n\tdh_place_name VARCHAR(16777216), \n\tdh_place_fullname VARCHAR(16777216), \n\tdh_city_name VARCHAR(16777216), \n\tdh_city_fullname VARCHAR(16777216), \n\tdh_zip_code VARCHAR(16777216), \n\tis_seasonally_adjusted BOOLEAN, \n\tmetric_value FLOAT, \n\thg_date_updated TIMESTAMP_NTZ, \n\t__hevo_xmin DECIMAL(38, 0), \n\t__hevo__schema_name VARCHAR(16777216), \n\t__hevo__ingested_at DECIMAL(38, 0), \n\t__hevo__loaded_at DECIMAL(38, 0), \n\t__hevo__marked_deleted BOOLEAN\n)" - }, - { - "_id": "65c3bcd39083745908e19eab", - "db_connection_id": "65847ee5c2f29b08592c2401", - "table_name": "redfin_median_sale_price", - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["county", "national", "state", "zip", "city"], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Condo/Co-op", - "All Residential", - "Multi-family", - "Single-family", - "Single unit", - "Townhouse" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "12", - "24", - "54", - "06", - "27", - "49", - "39", - "05", - "45", - "22", - "36", - "50", - "29", - "53", - "15", - "23", - "-", - "26", - "51", - "55", - "25", - "16", - "46", - "17", - "21", - "34", - "04", - "01", - "48", - "19", - "44", - "02", - "40", - "13", - "28", - "30", - "20", - "32", - "18", - "09", - "08", - "31", - "42", - "47", - "37", - "10", - "35", - "11", - "33", - "41" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "New York", - "Virginia", - "Indiana", - "Nevada", - "Oklahoma", - "Tennessee", - "Colorado", - "District of Columbia", - "Kansas", - "Mississippi", - "Delaware", - "Arkansas", - "New Jersey", - "Nebraska", - "Pennsylvania", - "Louisiana", - "Wisconsin", - "Maryland", - "Connecticut", - "Idaho", - "Rhode Island", - "Alabama", - "Ohio", - "Kentucky", - "Oregon", - "Iowa", - "West Virginia", - "Texas", - "Utah", - "Massachusetts", - "New Mexico", - "Georgia", - "Arizona", - "Montana", - "South Dakota", - "North Carolina", - "South Carolina", - "Vermont", - "Alaska", - "-", - "Minnesota", - "California", - "Missouri", - "Michigan", - "Florida", - "Hawaii", - "Washington", - "Illinois", - "Maine", - "New Hampshire" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "PA", - "VT", - "HI", - "MN", - "RI", - "- ", - "NH", - "NY", - "DE", - "AR", - "NJ", - "NV", - "WI", - "NM", - "UT", - "LA", - "TX", - "MA", - "NC", - "CT", - "AL", - "MO", - "ME", - "KY", - "SC", - "CO", - "MI", - "AK", - "MD", - "TN", - "IN", - "VA", - "OR", - "IA", - "NE", - "DC", - "CA", - "AZ", - "OH", - "GA", - "ID", - "WA", - "MS", - "MT", - "FL", - "SD", - "IL", - "WV", - "KS", - "OK" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": true, - "categories": ["True", "False"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP_NTZ", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo_xmin", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__schema_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__ingested_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": true, - "categories": [ - "1689351760663", - "1689347821476", - "1689335183045", - "1689331616204" - ], - "foreign_key": null - }, - { - "name": "__hevo__loaded_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": true, - "categories": [ - "1689339665071", - "1689332473638", - "1689350856640", - "1689354224072", - "1689336040672" - ], - "foreign_key": null - }, - { - "name": "__hevo__marked_deleted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "examples": [ - { - "period_start": "2012-06-01", - "period_end": "2012-08-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "All Residential", - "location_name": "45403", - "dh_state_fips": "39", - "dh_state_name": "Ohio", - "dh_state_abbr": "OH", - "dh_county_fips": "113", - "dh_county_name": "Montgomery", - "dh_county_fullname": "Montgomery County", - "dh_place_fips": "21000", - "dh_place_name": "Dayton", - "dh_place_fullname": "Dayton city", - "dh_city_name": "Dayton", - "dh_city_fullname": "Dayton city", - "dh_zip_code": "45403", - "is_seasonally_adjusted": "False", - "metric_value": "18000.0", - "hg_date_updated": "2023-04-29 03:54:01.403000", - "__hevo_xmin": "164145417", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1689347821476", - "__hevo__loaded_at": "1689354224072", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2016-08-01", - "period_end": "2016-10-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Townhouse", - "location_name": "33433", - "dh_state_fips": "12", - "dh_state_name": "Florida", - "dh_state_abbr": "FL", - "dh_county_fips": "099", - "dh_county_name": "Palm Beach", - "dh_county_fullname": "Palm Beach County", - "dh_place_fips": "07300", - "dh_place_name": "Boca Raton", - "dh_place_fullname": "Boca Raton city", - "dh_city_name": "Boca Raton", - "dh_city_fullname": "Boca Raton city", - "dh_zip_code": "33433", - "is_seasonally_adjusted": "False", - "metric_value": "236500.0", - "hg_date_updated": "2023-04-29 03:54:23.385000", - "__hevo_xmin": "164145483", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1689347821476", - "__hevo__loaded_at": "1689354224072", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2014-05-01", - "period_end": "2014-07-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "All Residential", - "location_name": "08096", - "dh_state_fips": "34", - "dh_state_name": "New Jersey", - "dh_state_abbr": "NJ", - "dh_county_fips": "015", - "dh_county_name": "Gloucester", - "dh_county_fullname": "Gloucester County", - "dh_place_fips": "-", - "dh_place_name": "-", - "dh_place_fullname": "-", - "dh_city_name": "-", - "dh_city_fullname": "-", - "dh_zip_code": "08096", - "is_seasonally_adjusted": "False", - "metric_value": "168000.0", - "hg_date_updated": "2023-04-29 03:53:52.568000", - "__hevo_xmin": "164145395", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1689347821476", - "__hevo__loaded_at": "1689354224072", - "__hevo__marked_deleted": "False" - } - ], - "status": "SCANNED", - "created_at": "2024-02-07T17:24:35.367Z", - "metadata": { - "dh_internal": { - "organization_id": "65847ee5c2f29b08592c2402" - } - }, - "error_message": "", - "last_schema_sync": "2024-02-07T17:27:40.160Z", - "table_schema": "\nCREATE TABLE redfin_median_sale_price (\n\tperiod_start DATE, \n\tperiod_end DATE, \n\tperiod_type VARCHAR(16777216), \n\tgeo_type VARCHAR(16777216), \n\tproperty_type VARCHAR(16777216), \n\tlocation_name VARCHAR(16777216), \n\tdh_state_fips VARCHAR(16777216), \n\tdh_state_name VARCHAR(16777216), \n\tdh_state_abbr VARCHAR(16777216), \n\tdh_county_fips VARCHAR(16777216), \n\tdh_county_name VARCHAR(16777216), \n\tdh_county_fullname VARCHAR(16777216), \n\tdh_place_fips VARCHAR(16777216), \n\tdh_place_name VARCHAR(16777216), \n\tdh_place_fullname VARCHAR(16777216), \n\tdh_city_name VARCHAR(16777216), \n\tdh_city_fullname VARCHAR(16777216), \n\tdh_zip_code VARCHAR(16777216), \n\tis_seasonally_adjusted BOOLEAN, \n\tmetric_value FLOAT, \n\thg_date_updated TIMESTAMP_NTZ, \n\t__hevo_xmin DECIMAL(38, 0), \n\t__hevo__schema_name VARCHAR(16777216), \n\t__hevo__ingested_at DECIMAL(38, 0), \n\t__hevo__loaded_at DECIMAL(38, 0), \n\t__hevo__marked_deleted BOOLEAN\n)" - }, - { - "_id": "65c3bcd39083745908e19eaa", - "db_connection_id": "65847ee5c2f29b08592c2401", - "table_name": "redfin_median_ppsf", - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["quarterly", "monthly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["county", "national", "state", "zip", "city"], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Multi-family", - "All Residential", - "Single-family", - "Single unit", - "Townhouse", - "Condo/Co-op" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "24", - "12", - "54", - "06", - "45", - "39", - "27", - "22", - "05", - "49", - "36", - "50", - "19", - "34", - "04", - "44", - "17", - "48", - "01", - "02", - "21", - "30", - "32", - "20", - "40", - "28", - "13", - "37", - "47", - "10", - "42", - "35", - "11", - "38", - "33", - "41", - "18", - "08", - "09", - "31", - "29", - "53", - "23", - "15", - "-", - "25", - "55", - "26", - "51", - "16", - "46" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Tennessee", - "New York", - "Virginia", - "Oklahoma", - "Indiana", - "Nevada", - "Colorado", - "Delaware", - "District of Columbia", - "Kansas", - "Mississippi", - "Texas", - "Utah", - "Massachusetts", - "New Mexico", - "Georgia", - "Alaska", - "South Carolina", - "Arizona", - "Montana", - "North Carolina", - "South Dakota", - "Vermont", - "-", - "Minnesota", - "Missouri", - "California", - "Pennsylvania", - "Wisconsin", - "New Jersey", - "Connecticut", - "Louisiana", - "Idaho", - "Rhode Island", - "Maryland", - "Nebraska", - "Arkansas", - "Maine", - "Washington", - "Michigan", - "New Hampshire", - "Florida", - "Illinois", - "Hawaii", - "North Dakota", - "Ohio", - "Iowa", - "Oregon", - "Alabama", - "West Virginia", - "Kentucky" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "NY", - "NH", - "DE", - "PA", - "VT", - "HI", - "MN", - "RI", - "- ", - "NJ", - "WI", - "AR", - "NV", - "NM", - "NC", - "CT", - "AL", - "MO", - "MA", - "TX", - "LA", - "UT", - "SC", - "MI", - "MD", - "TN", - "VA", - "CO", - "IN", - "IA", - "NE", - "OR", - "AK", - "DC", - "CA", - "MT", - "KS", - "WA", - "ID", - "MS", - "AZ", - "GA", - "FL", - "IL", - "WV", - "SD", - "ND", - "OH", - "OK", - "KY", - "ME" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": true, - "categories": ["True", "False"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP_NTZ", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo_xmin", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__schema_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__ingested_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__marked_deleted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "examples": [ - { - "period_start": "2017-08-01", - "period_end": "2017-10-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Multi-family", - "location_name": "18015", - "dh_state_fips": "42", - "dh_state_name": "Pennsylvania", - "dh_state_abbr": "PA", - "dh_county_fips": "095", - "dh_county_name": "Northampton", - "dh_county_fullname": "Northampton County", - "dh_place_fips": "06088", - "dh_place_name": "Bethlehem", - "dh_place_fullname": "Bethlehem city", - "dh_city_name": "Bethlehem", - "dh_city_fullname": "Bethlehem city", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "18015", - "is_seasonally_adjusted": "False", - "metric_value": "60.69803", - "hg_date_updated": "2023-08-22 07:58:01.701000", - "__hevo_xmin": "None", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1696000326934", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2012-12-01", - "period_end": "2013-02-28", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Single-family", - "location_name": "48857", - "dh_state_fips": "26", - "dh_state_name": "Michigan", - "dh_state_abbr": "MI", - "dh_county_fips": "155", - "dh_county_name": "Shiawassee", - "dh_county_fullname": "Shiawassee County", - "dh_place_fips": "55560", - "dh_place_name": "Morrice", - "dh_place_fullname": "Morrice village", - "dh_city_name": "Morrice", - "dh_city_fullname": "Morrice village", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "48857", - "is_seasonally_adjusted": "False", - "metric_value": "76.72144", - "hg_date_updated": "2023-08-22 07:58:12.387000", - "__hevo_xmin": "None", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1696000400531", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2022-06-01", - "period_end": "2022-08-31", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Condo/Co-op", - "location_name": "02460", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "017", - "dh_county_name": "Middlesex", - "dh_county_fullname": "Middlesex County", - "dh_place_fips": "45560", - "dh_place_name": "Newton", - "dh_place_fullname": "Newton city", - "dh_city_name": "Newton", - "dh_city_fullname": "Newton city", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "02460", - "is_seasonally_adjusted": "False", - "metric_value": "583.5668", - "hg_date_updated": "2023-08-22 07:58:01.701000", - "__hevo_xmin": "None", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1696000326940", - "__hevo__marked_deleted": "False" - } - ], - "status": "SCANNED", - "created_at": "2024-02-07T17:24:35.365Z", - "metadata": { - "dh_internal": { - "organization_id": "65847ee5c2f29b08592c2402" - } - }, - "error_message": "", - "last_schema_sync": "2024-02-07T17:27:06.638Z", - "table_schema": "\nCREATE TABLE redfin_median_ppsf (\n\tperiod_start DATE, \n\tperiod_end DATE, \n\tperiod_type VARCHAR(16777216), \n\tgeo_type VARCHAR(16777216), \n\tproperty_type VARCHAR(16777216), \n\tlocation_name VARCHAR(16777216), \n\tdh_state_fips VARCHAR(16777216), \n\tdh_state_name VARCHAR(16777216), \n\tdh_state_abbr VARCHAR(16777216), \n\tdh_county_fips VARCHAR(16777216), \n\tdh_county_name VARCHAR(16777216), \n\tdh_county_fullname VARCHAR(16777216), \n\tdh_place_fips VARCHAR(16777216), \n\tdh_place_name VARCHAR(16777216), \n\tdh_place_fullname VARCHAR(16777216), \n\tdh_city_name VARCHAR(16777216), \n\tdh_city_fullname VARCHAR(16777216), \n\tdh_neighborhood_id VARCHAR(16777216), \n\tdh_neighborhood_name VARCHAR(16777216), \n\tdh_zip_code VARCHAR(16777216), \n\tis_seasonally_adjusted BOOLEAN, \n\tmetric_value FLOAT, \n\thg_date_updated TIMESTAMP_NTZ, \n\t__hevo_xmin DECIMAL(38, 0), \n\t__hevo__schema_name VARCHAR(16777216), \n\t__hevo__ingested_at DECIMAL(38, 0), \n\t__hevo__marked_deleted BOOLEAN\n)" - }, - { - "_id": "65c3bcd39083745908e19ea9", - "db_connection_id": "65847ee5c2f29b08592c2401", - "table_name": "redfin_median_list_price", - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["state", "county", "national", "zip", "city"], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Condo/Co-op", - "Single-family", - "Single unit", - "All Residential", - "Multi-family", - "Townhouse" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "29", - "53", - "23", - "-", - "15", - "48", - "44", - "17", - "34", - "04", - "02", - "56", - "21", - "19", - "01", - "12", - "54", - "24", - "09", - "08", - "18", - "31", - "37", - "33", - "35", - "42", - "47", - "11", - "38", - "41", - "10", - "36", - "45", - "39", - "27", - "06", - "22", - "49", - "05", - "50", - "13", - "28", - "20", - "32", - "30", - "40", - "16", - "25", - "26", - "46", - "51", - "55" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Oklahoma", - "New York", - "Indiana", - "Virginia", - "Tennessee", - "Nevada", - "Wisconsin", - "Connecticut", - "Pennsylvania", - "Louisiana", - "New Jersey", - "Nebraska", - "Maryland", - "Arkansas", - "Rhode Island", - "Idaho", - "Kentucky", - "Alabama", - "Oregon", - "Ohio", - "Iowa", - "West Virginia", - "Massachusetts", - "Arizona", - "New Mexico", - "Vermont", - "Georgia", - "Wyoming", - "-", - "North Carolina", - "South Dakota", - "Alaska", - "Montana", - "South Carolina", - "Colorado", - "District of Columbia", - "Delaware", - "Mississippi", - "Kansas", - "Texas", - "Utah", - "Illinois", - "Florida", - "Michigan", - "Washington", - "New Hampshire", - "North Dakota", - "Hawaii", - "Maine", - "California", - "Minnesota", - "Missouri" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "NY", - "NH", - "DE", - "SC", - "IA", - "OR", - "MD", - "NE", - "MI", - "CO", - "IN", - "TN", - "VA", - "AK", - "DC", - "LA", - "MA", - "TX", - "UT", - "OH", - "FL", - "CA", - "GA", - "WA", - "IL", - "AZ", - "WV", - "MT", - "ID", - "SD", - "MS", - "ND", - "OK", - "KS", - "NJ", - "NV", - "WI", - "AR", - "NM", - "KY", - "ME", - "CT", - "MO", - "AL", - "NC", - "HI", - "MN", - "PA", - "VT", - "RI", - "- ", - "WY" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": true, - "categories": ["True", "False"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP_NTZ", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "examples": [ - { - "period_start": "2023-10-01", - "period_end": "2023-10-31", - "period_type": "monthly", - "geo_type": "city", - "property_type": "Multi-family", - "location_name": "Marinette", - "dh_state_fips": "55", - "dh_state_name": "Wisconsin", - "dh_state_abbr": "WI", - "dh_county_fips": "075", - "dh_county_name": "Marinette", - "dh_county_fullname": "Marinette County", - "dh_place_fips": "49300", - "dh_place_name": "Marinette", - "dh_place_fullname": "Marinette city", - "dh_city_name": "Marinette", - "dh_city_fullname": "Marinette city", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "124900.0", - "hg_date_updated": "2023-11-24 13:16:23.468487" - }, - { - "period_start": "2023-10-01", - "period_end": "2023-10-31", - "period_type": "monthly", - "geo_type": "city", - "property_type": "Single-family", - "location_name": "Eureka", - "dh_state_fips": "17", - "dh_state_name": "Illinois", - "dh_state_abbr": "IL", - "dh_county_fips": "203", - "dh_county_name": "Woodford", - "dh_county_fullname": "Woodford County", - "dh_place_fips": "24543", - "dh_place_name": "Eureka", - "dh_place_fullname": "Eureka city", - "dh_city_name": "Eureka", - "dh_city_fullname": "Eureka city", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "195000.0", - "hg_date_updated": "2023-11-24 13:14:37.708509" - }, - { - "period_start": "2023-10-01", - "period_end": "2023-10-31", - "period_type": "monthly", - "geo_type": "city", - "property_type": "Townhouse", - "location_name": "Lawrence", - "dh_state_fips": "25", - "dh_state_name": "Massachusetts", - "dh_state_abbr": "MA", - "dh_county_fips": "009", - "dh_county_name": "Essex", - "dh_county_fullname": "Essex County", - "dh_place_fips": "34550", - "dh_place_name": "Lawrence", - "dh_place_fullname": "Lawrence city", - "dh_city_name": "Lawrence", - "dh_city_fullname": "Lawrence city", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "409900.0", - "hg_date_updated": "2023-11-24 13:15:57.301469" - } - ], - "status": "SCANNED", - "created_at": "2024-02-07T17:24:35.363Z", - "metadata": { - "dh_internal": { - "organization_id": "65847ee5c2f29b08592c2402" - } - }, - "error_message": "", - "last_schema_sync": "2024-02-07T17:26:35.660Z", - "table_schema": "\nCREATE TABLE redfin_median_list_price (\n\tperiod_start DATE, \n\tperiod_end DATE, \n\tperiod_type VARCHAR(16777216), \n\tgeo_type VARCHAR(16777216), \n\tproperty_type VARCHAR(16777216), \n\tlocation_name VARCHAR(16777216), \n\tdh_state_fips VARCHAR(16777216), \n\tdh_state_name VARCHAR(16777216), \n\tdh_state_abbr VARCHAR(16777216), \n\tdh_county_fips VARCHAR(16777216), \n\tdh_county_name VARCHAR(16777216), \n\tdh_county_fullname VARCHAR(16777216), \n\tdh_place_fips VARCHAR(16777216), \n\tdh_place_name VARCHAR(16777216), \n\tdh_place_fullname VARCHAR(16777216), \n\tdh_city_name VARCHAR(16777216), \n\tdh_city_fullname VARCHAR(16777216), \n\tdh_neighborhood_id VARCHAR(16777216), \n\tdh_neighborhood_name VARCHAR(16777216), \n\tdh_zip_code VARCHAR(16777216), \n\tis_seasonally_adjusted BOOLEAN, \n\tmetric_value FLOAT, \n\thg_date_updated TIMESTAMP_NTZ\n)" - }, - { - "_id": "65c3bcd39083745908e19ea8", - "db_connection_id": "65847ee5c2f29b08592c2401", - "table_name": "redfin_inventory", - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["monthly", "quarterly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["county", "national", "state", "zip", "city"], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Condo/Co-op", - "Single-family", - "Single unit", - "Multi-family", - "All Residential", - "Townhouse" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "12", - "24", - "54", - "48", - "04", - "34", - "02", - "44", - "17", - "19", - "21", - "01", - "13", - "30", - "20", - "32", - "40", - "28", - "09", - "08", - "18", - "31", - "50", - "39", - "49", - "45", - "06", - "22", - "36", - "27", - "05", - "26", - "25", - "51", - "55", - "46", - "16", - "29", - "53", - "23", - "15", - "-", - "37", - "42", - "47", - "10", - "35", - "11", - "33", - "41" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "New York", - "Tennessee", - "Virginia", - "Indiana", - "Nevada", - "Oklahoma", - "Louisiana", - "Pennsylvania", - "New Jersey", - "Connecticut", - "Wisconsin", - "Nebraska", - "Rhode Island", - "Maryland", - "Arkansas", - "Idaho", - "Delaware", - "Colorado", - "Kansas", - "District of Columbia", - "Mississippi", - "Alabama", - "Kentucky", - "Oregon", - "Ohio", - "West Virginia", - "Iowa", - "Minnesota", - "California", - "Missouri", - "South Carolina", - "Massachusetts", - "Arizona", - "Georgia", - "Vermont", - "Alaska", - "New Mexico", - "North Carolina", - "Montana", - "South Dakota", - "-", - "Florida", - "New Hampshire", - "Washington", - "Hawaii", - "Illinois", - "Michigan", - "Maine", - "Utah", - "Texas" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "NY", - "NH", - "DE", - "PA", - "VT", - "HI", - "RI", - "MN", - "- ", - "CT", - "NC", - "AL", - "MO", - "NM", - "WI", - "NJ", - "AR", - "NV", - "FL", - "AZ", - "IL", - "CA", - "OH", - "GA", - "WV", - "WA", - "ID", - "MS", - "MT", - "SD", - "OK", - "KS", - "KY", - "ME", - "TN", - "SC", - "MI", - "VA", - "NE", - "CO", - "IA", - "IN", - "MD", - "OR", - "AK", - "DC", - "TX", - "MA", - "UT", - "LA" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": true, - "categories": ["True", "False"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP_NTZ", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo_xmin", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__schema_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__ingested_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": true, - "categories": [ - "1689347312196", - "1689341214540", - "1689344792593", - "1689293163676" - ], - "foreign_key": null - }, - { - "name": "__hevo__loaded_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": true, - "categories": [ - "1689296657026", - "1689350838964", - "1689300213553", - "1689346879402", - "1689343371049" - ], - "foreign_key": null - }, - { - "name": "__hevo__marked_deleted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "examples": [ - { - "period_start": "2018-11-01", - "period_end": "2018-11-30", - "period_type": "monthly", - "geo_type": "city", - "property_type": "Single-family", - "location_name": "Converse", - "dh_state_fips": "45", - "dh_state_name": "South Carolina", - "dh_state_abbr": "SC", - "dh_county_fips": "083", - "dh_county_name": "Spartanburg", - "dh_county_fullname": "Spartanburg County", - "dh_place_fips": "16360", - "dh_place_name": "Converse", - "dh_place_fullname": "Converse CDP", - "dh_city_name": "Converse", - "dh_city_fullname": "Converse CDP", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "2.0", - "hg_date_updated": "2023-05-01 16:13:00.339000", - "__hevo_xmin": "164813931", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1689341214540", - "__hevo__loaded_at": "1689343371049", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2017-03-01", - "period_end": "2017-03-31", - "period_type": "monthly", - "geo_type": "city", - "property_type": "Single-family", - "location_name": "New York Mills", - "dh_state_fips": "27", - "dh_state_name": "Minnesota", - "dh_state_abbr": "MN", - "dh_county_fips": "111", - "dh_county_name": "Otter Tail", - "dh_county_fullname": "Otter Tail County", - "dh_place_fips": "46060", - "dh_place_name": "New York Mills", - "dh_place_fullname": "New York Mills city", - "dh_city_name": "New York Mills", - "dh_city_fullname": "New York Mills city", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "8.0", - "hg_date_updated": "2023-05-01 16:13:00.339000", - "__hevo_xmin": "164813931", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1689341214540", - "__hevo__loaded_at": "1689343371049", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2020-06-01", - "period_end": "2020-06-30", - "period_type": "monthly", - "geo_type": "city", - "property_type": "Single-family", - "location_name": "Springdale", - "dh_state_fips": "45", - "dh_state_name": "South Carolina", - "dh_state_abbr": "SC", - "dh_county_fips": "057", - "dh_county_name": "Lancaster", - "dh_county_fullname": "Lancaster County", - "dh_place_fips": "68380", - "dh_place_name": "Springdale", - "dh_place_fullname": "Springdale CDP", - "dh_city_name": "Springdale", - "dh_city_fullname": "Springdale CDP", - "dh_zip_code": "-", - "is_seasonally_adjusted": "False", - "metric_value": "4.0", - "hg_date_updated": "2023-05-01 16:13:00.339000", - "__hevo_xmin": "164813931", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1689341214540", - "__hevo__loaded_at": "1689343371049", - "__hevo__marked_deleted": "False" - } - ], - "status": "SCANNED", - "created_at": "2024-02-07T17:24:35.358Z", - "metadata": { - "dh_internal": { - "organization_id": "65847ee5c2f29b08592c2402" - } - }, - "error_message": "", - "last_schema_sync": "2024-02-07T17:26:04.073Z", - "table_schema": "\nCREATE TABLE redfin_inventory (\n\tperiod_start DATE, \n\tperiod_end DATE, \n\tperiod_type VARCHAR(16777216), \n\tgeo_type VARCHAR(16777216), \n\tproperty_type VARCHAR(16777216), \n\tlocation_name VARCHAR(16777216), \n\tdh_state_fips VARCHAR(16777216), \n\tdh_state_name VARCHAR(16777216), \n\tdh_state_abbr VARCHAR(16777216), \n\tdh_county_fips VARCHAR(16777216), \n\tdh_county_name VARCHAR(16777216), \n\tdh_county_fullname VARCHAR(16777216), \n\tdh_place_fips VARCHAR(16777216), \n\tdh_place_name VARCHAR(16777216), \n\tdh_place_fullname VARCHAR(16777216), \n\tdh_city_name VARCHAR(16777216), \n\tdh_city_fullname VARCHAR(16777216), \n\tdh_zip_code VARCHAR(16777216), \n\tis_seasonally_adjusted BOOLEAN, \n\tmetric_value FLOAT, \n\thg_date_updated TIMESTAMP_NTZ, \n\t__hevo_xmin DECIMAL(38, 0), \n\t__hevo__schema_name VARCHAR(16777216), \n\t__hevo__ingested_at DECIMAL(38, 0), \n\t__hevo__loaded_at DECIMAL(38, 0), \n\t__hevo__marked_deleted BOOLEAN\n)" - }, - { - "_id": "65c3bcd39083745908e19ea7", - "db_connection_id": "65847ee5c2f29b08592c2401", - "table_name": "redfin_homes_sold", - "columns": [ - { - "name": "period_start", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_end", - "is_primary_key": false, - "data_type": "DATE", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "period_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["quarterly", "monthly"], - "foreign_key": null - }, - { - "name": "geo_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": ["county", "national", "city", "zip", "state"], - "foreign_key": null - }, - { - "name": "property_type", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Condo/Co-op", - "Single-family", - "Single unit", - "Townhouse", - "All Residential", - "Multi-family" - ], - "foreign_key": null - }, - { - "name": "location_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_state_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "06", - "39", - "36", - "22", - "49", - "27", - "45", - "05", - "50", - "28", - "30", - "32", - "20", - "13", - "40", - "15", - "29", - "53", - "23", - "-", - "08", - "31", - "09", - "18", - "17", - "04", - "34", - "48", - "44", - "02", - "19", - "01", - "21", - "55", - "25", - "26", - "16", - "51", - "46", - "54", - "12", - "24", - "41", - "37", - "10", - "47", - "42", - "11", - "38", - "33", - "35" - ], - "foreign_key": null - }, - { - "name": "dh_state_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "Colorado", - "Kansas", - "Mississippi", - "Delaware", - "District of Columbia", - "Utah", - "Texas", - "New York", - "Virginia", - "Tennessee", - "Indiana", - "Oklahoma", - "Nevada", - "Minnesota", - "California", - "Missouri", - "Illinois", - "Florida", - "Washington", - "New Hampshire", - "Hawaii", - "Michigan", - "Maine", - "North Dakota", - "Kentucky", - "Ohio", - "Iowa", - "Alabama", - "West Virginia", - "Oregon", - "Connecticut", - "Pennsylvania", - "Wisconsin", - "New Jersey", - "Nebraska", - "Louisiana", - "Idaho", - "Rhode Island", - "Arkansas", - "Maryland", - "Massachusetts", - "Vermont", - "New Mexico", - "Georgia", - "Alaska", - "South Carolina", - "Arizona", - "South Dakota", - "Montana", - "North Carolina", - "-" - ], - "foreign_key": null - }, - { - "name": "dh_state_abbr", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": true, - "categories": [ - "NH", - "NY", - "DE", - "VT", - "PA", - "MN", - "RI", - "HI", - "- ", - "NJ", - "WI", - "NV", - "AR", - "NM", - "AL", - "NC", - "CT", - "MO", - "UT", - "TX", - "LA", - "MA", - "CA", - "FL", - "IL", - "OH", - "AZ", - "WA", - "GA", - "WV", - "MT", - "SD", - "MS", - "ID", - "ND", - "KS", - "OK", - "CO", - "SC", - "VA", - "MI", - "MD", - "IA", - "IN", - "TN", - "OR", - "NE", - "AK", - "DC", - "ME", - "KY" - ], - "foreign_key": null - }, - { - "name": "dh_county_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_county_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fips", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_place_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_city_fullname", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_id", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_neighborhood_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "dh_zip_code", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "is_seasonally_adjusted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": true, - "categories": ["True", "False"], - "foreign_key": null - }, - { - "name": "metric_value", - "is_primary_key": false, - "data_type": "FLOAT", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "hg_date_updated", - "is_primary_key": false, - "data_type": "TIMESTAMP_NTZ", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo_xmin", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__schema_name", - "is_primary_key": false, - "data_type": "VARCHAR(16777216)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__ingested_at", - "is_primary_key": false, - "data_type": "DECIMAL(38, 0)", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - }, - { - "name": "__hevo__marked_deleted", - "is_primary_key": false, - "data_type": "BOOLEAN", - "description": null, - "low_cardinality": false, - "categories": null, - "foreign_key": null - } - ], - "examples": [ - { - "period_start": "2013-07-01", - "period_end": "2013-09-30", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Single-family", - "location_name": "95948", - "dh_state_fips": "06", - "dh_state_name": "California", - "dh_state_abbr": "CA", - "dh_county_fips": "007", - "dh_county_name": "Butte", - "dh_county_fullname": "Butte County", - "dh_place_fips": "31260", - "dh_place_name": "Gridley", - "dh_place_fullname": "Gridley city", - "dh_city_name": "Gridley", - "dh_city_fullname": "Gridley city", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "95948", - "is_seasonally_adjusted": "False", - "metric_value": "6.0", - "hg_date_updated": "2023-08-28 22:51:52.206000", - "__hevo_xmin": "None", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1696045411759", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2018-04-01", - "period_end": "2018-06-30", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "Condo/Co-op", - "location_name": "80504", - "dh_state_fips": "08", - "dh_state_name": "Colorado", - "dh_state_abbr": "CO", - "dh_county_fips": "013", - "dh_county_name": "Boulder", - "dh_county_fullname": "Boulder County", - "dh_place_fips": "26600", - "dh_place_name": "Firestone", - "dh_place_fullname": "Firestone town", - "dh_city_name": "Firestone", - "dh_city_fullname": "Firestone town", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "80504", - "is_seasonally_adjusted": "False", - "metric_value": "15.0", - "hg_date_updated": "2023-08-28 22:50:54.613000", - "__hevo_xmin": "None", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1696044856976", - "__hevo__marked_deleted": "False" - }, - { - "period_start": "2013-07-01", - "period_end": "2013-09-30", - "period_type": "quarterly", - "geo_type": "zip", - "property_type": "All Residential", - "location_name": "33570", - "dh_state_fips": "12", - "dh_state_name": "Florida", - "dh_state_abbr": "FL", - "dh_county_fips": "057", - "dh_county_name": "Hillsborough", - "dh_county_fullname": "Hillsborough County", - "dh_place_fips": "62275", - "dh_place_name": "Ruskin", - "dh_place_fullname": "Ruskin CDP", - "dh_city_name": "Ruskin", - "dh_city_fullname": "Ruskin CDP", - "dh_neighborhood_id": "-", - "dh_neighborhood_name": "-", - "dh_zip_code": "33570", - "is_seasonally_adjusted": "False", - "metric_value": "119.0", - "hg_date_updated": "2023-08-28 22:52:12.809000", - "__hevo_xmin": "None", - "__hevo__schema_name": "public", - "__hevo__ingested_at": "1696045604526", - "__hevo__marked_deleted": "False" - } - ], - "status": "SCANNED", - "created_at": "2024-02-07T17:24:35.349Z", - "metadata": { - "dh_internal": { - "organization_id": "65847ee5c2f29b08592c2402" - } - }, - "error_message": "", - "last_schema_sync": "2024-02-07T17:25:26.982Z", - "table_schema": "\nCREATE TABLE redfin_homes_sold (\n\tperiod_start DATE, \n\tperiod_end DATE, \n\tperiod_type VARCHAR(16777216), \n\tgeo_type VARCHAR(16777216), \n\tproperty_type VARCHAR(16777216), \n\tlocation_name VARCHAR(16777216), \n\tdh_state_fips VARCHAR(16777216), \n\tdh_state_name VARCHAR(16777216), \n\tdh_state_abbr VARCHAR(16777216), \n\tdh_county_fips VARCHAR(16777216), \n\tdh_county_name VARCHAR(16777216), \n\tdh_county_fullname VARCHAR(16777216), \n\tdh_place_fips VARCHAR(16777216), \n\tdh_place_name VARCHAR(16777216), \n\tdh_place_fullname VARCHAR(16777216), \n\tdh_city_name VARCHAR(16777216), \n\tdh_city_fullname VARCHAR(16777216), \n\tdh_neighborhood_id VARCHAR(16777216), \n\tdh_neighborhood_name VARCHAR(16777216), \n\tdh_zip_code VARCHAR(16777216), \n\tis_seasonally_adjusted BOOLEAN, \n\tmetric_value FLOAT, \n\thg_date_updated TIMESTAMP_NTZ, \n\t__hevo_xmin DECIMAL(38, 0), \n\t__hevo__schema_name VARCHAR(16777216), \n\t__hevo__ingested_at DECIMAL(38, 0), \n\t__hevo__marked_deleted BOOLEAN\n)" - } -] From b539eff255efbe3d3e0d895e3c8995cd2b446182 Mon Sep 17 00:00:00 2001 From: Juan Valacco <97040903+jvalacco-dataherald@users.noreply.github.com> Date: Sat, 18 May 2024 20:32:13 -0300 Subject: [PATCH 8/8] final updates and fixes to env vars and docker compose local development --- README.md | 2 +- run.sh => docker-run.sh | 10 ++++--- services/admin-console/dev.Dockerfile | 4 +++ services/admin-console/docker-compose.yml | 4 +-- services/admin-console/src/config.ts | 3 ++- services/engine/README.md | 2 +- services/engine/docker-compose.yml | 2 ++ services/engine/docs/quickstart.rst | 2 +- services/enterprise/.env.example | 4 +-- services/enterprise/config.py | 2 +- .../database/migrations/liquibase.properties | 2 +- services/enterprise/docker-compose.yml | 1 + services/slackbot/.env.example | 2 +- services/slackbot/docker-compose.yml | 26 +++++++++---------- 14 files changed, 38 insertions(+), 28 deletions(-) rename run.sh => docker-run.sh (68%) diff --git a/README.md b/README.md index f6caf2f3..6bd0e9f7 100755 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Each component in the `/services` directory has its own `docker-compose.yml` fil Run the script to start all services: ```bash -sh run.sh +sh docker-run.sh ``` ## Contributing diff --git a/run.sh b/docker-run.sh similarity index 68% rename from run.sh rename to docker-run.sh index e6ff39ff..d7ee97b5 100644 --- a/run.sh +++ b/docker-run.sh @@ -1,8 +1,10 @@ #!/bin/bash +# Create Docker network docker network create dataherald_network -docker-compose -p dataherald -f services/engine/docker-compose.yml up --build -d; -docker-compose -p dataherald -f services/enterprise/docker-compose.yml up --build -d; -docker-compose -p dataherald -f services/slackbot/docker-compose.yml up --build -d; -docker-compose -p dataherald -f services/admin-console/docker-compose.yml up --build -d; \ No newline at end of file +# Bring up services with Docker Compose +docker-compose -p dataherald -f services/engine/docker-compose.yml up --build -d +docker-compose -p dataherald -f services/enterprise/docker-compose.yml up --build -d +docker-compose -p dataherald -f services/slackbot/docker-compose.yml up --build -d +docker-compose -p dataherald -f services/admin-console/docker-compose.yml up --build -d \ No newline at end of file diff --git a/services/admin-console/dev.Dockerfile b/services/admin-console/dev.Dockerfile index 2cbffed0..9aed10d1 100644 --- a/services/admin-console/dev.Dockerfile +++ b/services/admin-console/dev.Dockerfile @@ -14,6 +14,10 @@ COPY . . # Uncomment the following line to disable telemetry at run time ENV NEXT_TELEMETRY_DISABLED 1 +# Docker network URL for the API -- used for nextjs server side API calls inside the docker network +# The browser needs to access the API from the exposed port in the docker host (i.e.: localhost:3001) +ENV DOCKER_API_URL='http://api:3001' + # Note: Don't expose ports here, Compose will handle that for us # Start Next.js in development mode based on the preferred package manager diff --git a/services/admin-console/docker-compose.yml b/services/admin-console/docker-compose.yml index 7a8a1909..95277ccb 100644 --- a/services/admin-console/docker-compose.yml +++ b/services/admin-console/docker-compose.yml @@ -1,6 +1,6 @@ services: next-app: - container_name: next-app + container_name: console build: context: . dockerfile: dev.Dockerfile @@ -9,9 +9,9 @@ services: volumes: - ./src:/app/src - ./public:/app/public - restart: always ports: - 3000:3000 + restart: always networks: - dataherald_network networks: diff --git a/services/admin-console/src/config.ts b/services/admin-console/src/config.ts index d36a41eb..6f368cd3 100644 --- a/services/admin-console/src/config.ts +++ b/services/admin-console/src/config.ts @@ -1,4 +1,5 @@ -export const API_URL = process.env.NEXT_PUBLIC_API_URL +const isServer = typeof window === 'undefined'; +export const API_URL = isServer ? process.env.DOCKER_API_URL || process.env.NEXT_PUBLIC_API_URL : process.env.NEXT_PUBLIC_API_URL; export const AUTH = { hostname: process.env.AUTH0_BASE_URL, cliendId: process.env.AUTH0_CLIENT_ID, diff --git a/services/engine/README.md b/services/engine/README.md index 36edc18e..457d22f3 100644 --- a/services/engine/README.md +++ b/services/engine/README.md @@ -140,7 +140,7 @@ It should look like this: ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 72aa8df0d589 dataherald-app "uvicorn dataherald.…" 7 seconds ago Up 6 seconds 0.0.0.0:80->80/tcp dataherald-app-1 -6595d145b0d7 mongo:latest "docker-entrypoint.s…" 19 hours ago Up 6 seconds 0.0.0.0:27017->27017/tcp dataherald-mongodb-1 +6595d145b0d7 mongo:latest "docker-entrypoint.s…" 19 hours ago Up 6 seconds 0.0.0.0:27017->27017/tcp mongodb ``` 6. In your browser visit [http://localhost/docs](http://localhost/docs) diff --git a/services/engine/docker-compose.yml b/services/engine/docker-compose.yml index b97181e1..20a71f27 100644 --- a/services/engine/docker-compose.yml +++ b/services/engine/docker-compose.yml @@ -1,5 +1,6 @@ services: engine: + container_name: engine build: context: . dockerfile: Dockerfile @@ -18,6 +19,7 @@ services: - dataherald_network env_file: .env mongodb: + container_name: mongodb image: mongo:latest restart: always ports: diff --git a/services/engine/docs/quickstart.rst b/services/engine/docs/quickstart.rst index e0698dba..33e1ac81 100644 --- a/services/engine/docs/quickstart.rst +++ b/services/engine/docs/quickstart.rst @@ -61,7 +61,7 @@ Starting Docker CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 72aa8df0d589 dataherald-app "uvicorn dataherald.…" 7 seconds ago Up 6 seconds 0.0.0.0:80->80/tcp dataherald-app-1 - 6595d145b0d7 mongo:latest "docker-entrypoint.s…" 19 hours ago Up 6 seconds 0.0.0.0:27017->27017/tcp dataherald-mongodb-1 + 6595d145b0d7 mongo:latest "docker-entrypoint.s…" 19 hours ago Up 6 seconds 0.0.0.0:27017->27017/tcp mongodb #. You can also verify the engine is running by navigating to the Swagger-UI from your browser at ``_ diff --git a/services/enterprise/.env.example b/services/enterprise/.env.example index bee144b8..11aca32e 100644 --- a/services/enterprise/.env.example +++ b/services/enterprise/.env.example @@ -1,4 +1,4 @@ -ENGINE_URL=http://{DOCKER_CONTAINER_APP_NAME:PORT}/api/v1 # example: http://dataherald-engine-1/api/v1 (port 80 by default) +ENGINE_URL=http://{DOCKER_CONTAINER_NAME:PORT}/api/v1 # example: http://engine/api/v1 (port 80 by default) MONGODB_DB_NAME= MONGODB_URI= @@ -9,7 +9,7 @@ AUTH0_DISABED=False API_KEY_SALT= -DEFAULT_K2_TIMEOUT=120 +DEFAULT_ENGINE_TIMEOUT=120 S3_AWS_ACCESS_KEY_ID= S3_AWS_SECRET_ACCESS_KEY= diff --git a/services/enterprise/config.py b/services/enterprise/config.py index 03e53198..1836608e 100644 --- a/services/enterprise/config.py +++ b/services/enterprise/config.py @@ -27,7 +27,7 @@ class Settings(BaseSettings): load_dotenv() engine_url: str = os.environ.get("ENGINE_URL") - default_engine_timeout: int = os.environ.get("DEFAULT_K2_TIMEOUT") + default_engine_timeout: int = os.environ.get("DEFAULT_ENGINE_TIMEOUT") encrypt_key: str = os.environ.get("ENCRYPT_KEY") api_key_salt: str = os.environ.get("API_KEY_SALT") diff --git a/services/enterprise/database/migrations/liquibase.properties b/services/enterprise/database/migrations/liquibase.properties index df880700..ca2e9ec5 100644 --- a/services/enterprise/database/migrations/liquibase.properties +++ b/services/enterprise/database/migrations/liquibase.properties @@ -23,7 +23,7 @@ changeLogFile=changelog.json #### Enter the Target database 'url' information #### -liquibase.command.url= mongodb://dataherald-mongodb-1:27017/dataherald +liquibase.command.url= mongodb://mongodb:27017/dataherald # Enter the username for your Target database. liquibase.command.username: admin diff --git a/services/enterprise/docker-compose.yml b/services/enterprise/docker-compose.yml index 1bbe8a1c..2a09737a 100644 --- a/services/enterprise/docker-compose.yml +++ b/services/enterprise/docker-compose.yml @@ -1,5 +1,6 @@ services: api: + container_name: api build: context: . dockerfile: Dockerfile diff --git a/services/slackbot/.env.example b/services/slackbot/.env.example index d320fede..c71c419d 100644 --- a/services/slackbot/.env.example +++ b/services/slackbot/.env.example @@ -21,5 +21,5 @@ AUTH0_CLIENT_ID='{yourClientId}' AUTH0_CLIENT_SECRET='{yourClientSecret}' -API_URL=http://{DOCKER_CONTAINER_APP_NAME:PORT}/api/v1 # example: http://dataherald-api-1:3001 +API_URL=http://{DOCKER_CONTAINER_NAME:PORT} # example: http://api:3001 PORT=3000 \ No newline at end of file diff --git a/services/slackbot/docker-compose.yml b/services/slackbot/docker-compose.yml index 6bc2954f..2fd3bd03 100644 --- a/services/slackbot/docker-compose.yml +++ b/services/slackbot/docker-compose.yml @@ -1,15 +1,15 @@ services: - slackbot: - build: . - working_dir: /app - ports: - - "3005:3005" - volumes: - - .:/app - - /app/node_modules - networks: - - dataherald_network + slackbot: + container_name: slackbot + build: . + working_dir: /app + ports: + - '3005:3005' + volumes: + - .:/app + - /app/node_modules + networks: + - dataherald_network networks: - dataherald_network: - external: true - + dataherald_network: + external: true