-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement example, start building new bootstrap tool
- Loading branch information
Showing
8 changed files
with
121 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
schema_name: quickflix | ||
|
||
vdbes: | ||
- name: order_flow | ||
tables: | ||
- name: tickets | ||
writable: true | ||
- name: customers | ||
writable: true | ||
max_staleness_ms: 0 | ||
query_interface: SQL_POSTGRESQL | ||
|
||
- name: transform | ||
tables: | ||
- name: tickets | ||
- name: customers | ||
- name: sales_history | ||
writable: true | ||
max_staleness_ms: 3600000 # 1 hour | ||
query_interface: SQL_AWS_REDSHIFT | ||
|
||
- name: analysis | ||
tables: | ||
- name: sales_history | ||
max_staleness_ms: 0 | ||
query_interface: SQL_AWS_REDSHIFT | ||
|
||
tables: | ||
- name: tickets | ||
columns: | ||
- name: t_customer_id | ||
type: INT_64 | ||
- name: t_movie_id | ||
type: INT_64 | ||
|
||
- name: customers | ||
columns: | ||
- name: c_customer_id | ||
type: INT_64 | ||
- name: c_name | ||
type: STRING | ||
|
||
- name: sales_history | ||
columns: | ||
- name: sh_customer_id | ||
type: INT_64 | ||
- name: sh_movie_id | ||
type: INT_64 | ||
- name: sh_name | ||
type: STRING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def register_admin_action(subparser) -> None: | ||
parser = subparser.add_parser( | ||
"bootstrap_vdbes", help="Set up a new virtual infrastructure on BRAD." | ||
) | ||
parser.add_argument( | ||
"--physical-config-file", | ||
type=str, | ||
required=True, | ||
help="Path to BRAD's physical configuration file.", | ||
) | ||
parser.add_argument( | ||
"--vdbe-file", | ||
type=str, | ||
required=True, | ||
help="Path to the virtual infrastructure definition to boostrap.", | ||
) | ||
parser.set_defaults(admin_action=bootstrap_vdbes) | ||
|
||
|
||
# This method is called by `brad.exec.admin.main`. | ||
def bootstrap_vdbes(_args) -> None: | ||
logger.info("Running VDBE boostrap.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import enum | ||
|
||
from pydantic import BaseModel | ||
from typing import Set | ||
|
||
# This class contains Python definitions | ||
|
||
|
||
class QueryInterface(enum.Enum): | ||
SqlPostgresql = "SQL_POSTGRESQL" | ||
SqlMysql = "SQL_MYSQL" | ||
SqlAwsRedshift = "AWS_REDSHIFT" | ||
SqlAwsAthena = "AWS_ATHENA" | ||
|
||
|
||
class VirtualTable(BaseModel): | ||
name: str | ||
writable: bool | ||
|
||
|
||
class VirtualEngine(BaseModel): | ||
name: str | ||
query_interface: QueryInterface | ||
max_staleness_ms: int | ||
tables: Set[VirtualTable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters