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

[Feature] Add a --sql option to MF queries #1554

Open
3 tasks done
siljamardla opened this issue Nov 30, 2024 · 0 comments
Open
3 tasks done

[Feature] Add a --sql option to MF queries #1554

siljamardla opened this issue Nov 30, 2024 · 0 comments
Labels
enhancement New feature or request triage Tasks that need to be triaged

Comments

@siljamardla
Copy link

siljamardla commented Nov 30, 2024

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing metricflow functionality, rather than a Big Idea better suited to a discussion

Describe the feature

There's an option to write the outcome of a MetricFlow query to csv, something like this:

mf query --saved-query my_saved_query --csv tmp_my_saved_query_output.csv

The output file is pure CSV, no ⠋ Initiating query… stuff in the beginning.

Similarly, I'd like to output the --explain version of the query to a separate file, pure SQL, no ⠋ Initiating query… stuff.

mf query --saved-query my_saved_query --explain --sql tmp_my_saved_query_output.sql

Describe alternatives you've considered

At the moment, my only option is to push the command output to a file, something like this:

mf query --saved-query my_saved_query --csv tmp_my_saved_query_output.csv

which prints everything to the file, including the ⠋ Initiating query… stuff that I then need to clean up from the file. The longer the query takes the more lines of ⠋ Initiating query… I get in the output. In some cases, this is thousands of lines (I just recently timed a saved query of 80 metrics, it took 4m10s).

Who will this benefit?

Everyone

@siljamardla siljamardla added enhancement New feature or request triage Tasks that need to be triaged labels Nov 30, 2024
@siljamardla siljamardla changed the title [Feature] Add a --sql option to MF queries [Feature] Add a --sql option to MF queries Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Tasks that need to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant