Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#14043 - Fix metadata backup memory profile #14378

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ingestion/src/metadata/cli/db_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ def get_hash_column_name(engine: Engine, table_name: str) -> Optional[str]:

def run_query_iter(engine: Engine, query: str) -> Iterable[Row]:
"""Return a generator of rows, one row at a time, with a limit of 100 in-mem rows"""

for row in engine.execute(text(query)).yield_per(100):
yield row
with engine.connect() as conn:
result = conn.execution_options(
stream_results=True, max_row_buffer=100
).execute(text(query))
for row in result:
yield row


def dump_json(tables: List[str], engine: Engine, output: Path) -> None:
Expand Down
5 changes: 1 addition & 4 deletions ingestion/src/metadata/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,9 @@ def metadata(args=None):
contains_args = vars(get_parser(args))
metadata_workflow = contains_args.get("command")
config_file = contains_args.get("config")
path = None
if config_file:
path = Path(config_file).expanduser()
else:
raise ValueError(
"Could not load config file! Please specify the config path with `-c` or `--config`."
)
if contains_args.get("debug"):
set_loggers_level(logging.DEBUG)
elif contains_args.get("log_level"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ with read only access to the repository. You can follow these steps from the Git
The GitHub credentials are completely optional. Just note that without them, we won't be able to ingest metadata
out of LookML Views, including their lineage to the source databases.

Moreover, Looker lineage only supports LookML views configured with `sql_table_name` and `derived_table` in plain SQL.
We do not yet support liquid variables.

{% /note %}

## Metadata Ingestion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ with read only access to the repository. You can follow these steps from the Git
The GitHub credentials are completely optional. Just note that without them, we won't be able to ingest metadata
out of LookML Views, including their lineage to the source databases.

Moreover, Looker lineage only supports LookML views configured with `sql_table_name` and `derived_table` in plain SQL.
We do not yet support liquid variables.

{% /note %}

### Python Requirements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ with read only access to the repository. You can follow these steps from the Git
The GitHub credentials are completely optional. Just note that without them, we won't be able to ingest metadata
out of LookML Views, including their lineage to the source databases.

Moreover, Looker lineage only supports LookML views configured with `sql_table_name` and `derived_table` in plain SQL.
We do not yet support liquid variables.

{% /note %}

## Metadata Ingestion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ with read only access to the repository. You can follow these steps from the Git
The GitHub credentials are completely optional. Just note that without them, we won't be able to ingest metadata
out of LookML Views, including their lineage to the source databases.

Moreover, Looker lineage only supports LookML views configured with `sql_table_name` and `derived_table` in plain SQL.
We do not yet support liquid variables.

{% /note %}

### Python Requirements
Expand Down
Loading