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

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

Open
3 tasks done
siljamardla opened this issue Nov 30, 2024 · 1 comment
Open
3 tasks done

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

siljamardla opened this issue Nov 30, 2024 · 1 comment
Labels
enhancement New feature or request linear 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 (#1555). 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

SL-3384

@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
@plypaul
Copy link
Contributor

plypaul commented Jan 25, 2025

Currently thinking that a common --quiet flag would be most appropriate. Is this for a scripting use case?

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

No branches or pull requests

3 participants