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

Mv rows export #7081

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Mv rows export #7081

wants to merge 9 commits into from

Conversation

pjain1
Copy link
Member

@pjain1 pjain1 commented Apr 6, 2025

Fixes https://github.com/rilldata/rill-private-issues/issues/1342

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@pjain1 pjain1 requested a review from begelundmuller April 7, 2025 08:45
Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Also needs to update the MetricsViewRows RPC to use the metricsview package (to fix the original bug)
  2. Can you also add some tests in runtime/resolvers/testdata for the rows logic? Especially to check the measure filter support that was originally reported. I.e. have tests like:
...
tests:
- name: metrics rows with a measure-based filter
  resolver: metrics
  properties:
    metrics_view: foo
    rows: true
    ...

@pjain1
Copy link
Member Author

pjain1 commented Apr 9, 2025

Also needs to update the MetricsViewRows RPC to use the metricsview package (to fix the original bug)

I thought UI can switch to mv agg API and we can deprecate rows API

@pjain1 pjain1 requested a review from begelundmuller April 10, 2025 07:30
require.Equal(t, []string{"2022-01-01T14:49:50.459Z", "", "msn.com", "2", "4", "2", "cars", "", "1", "iphone"}, rows[1][2:])
require.Equal(t, []string{"2022-01-02T11:58:12.475Z", "Yahoo", "yahoo.com", "2", "4", "1", "cars", "1", "1"}, rows[2][2:])
require.Equal(t, []string{"timestamp", "publisher", "domain", "bid_price", "volume", "impressions", "ad words", "clicks", "numeric_dim", "device"}, rows[0][1:])
require.Equal(t, []string{"1/1/22 14:49", "", "msn.com", "2", "4", "2", "cars", "", "1", "iphone"}, rows[1][1:])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metricsview_rows export marshals values before writing like

func convertToXLSXValue(pbvalue *structpb.Value) (interface{}, error) {
	switch pbvalue.GetKind().(type) {
	case *structpb.Value_StructValue:
		bts, err := protojson.Marshal(pbvalue)
		if err != nil {
			return "", err
		}

		return string(bts), nil
	case *structpb.Value_NullValue:
		return "", nil
	default:
		return pbvalue.AsInterface(), nil
	}
}

however mv agg export does not thats why the date format is of excel format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants