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

Export fixes #3193

Closed
wants to merge 3 commits into from
Closed

Export fixes #3193

wants to merge 3 commits into from

Conversation

pjain1
Copy link
Member

@pjain1 pjain1 commented Oct 7, 2023

Fixes #3178 and #3177

@nishantmonu51 nishantmonu51 added the Type:Bug Something isn't working label Oct 9, 2023
Comment on lines +28 to +29
type forExportKey struct{}

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we pass this as an explicit parameter or property instead? Context values are similar to reflection, best only to use them if truly necessary

colName, err := metricsViewDimensionToSafeColumn(mv, q.DimensionName)
if err != nil {
return "", nil, err
}

selectCols := []string{colName}
for _, m := range ms {
expr := fmt.Sprintf(`%s as %s`, m.Expression, safeName(m.Name))
expr := fmt.Sprintf(`%s as %s`, m.Expression, safeName(q.measureNameToLabel[m.Name]))
Copy link
Contributor

Choose a reason for hiding this comment

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

Measure labels are not guaranteed to be unique. They can't be used inside the query for ordering/filtering/etc.

They should only be used at the export stage or in the query passed to COPY TO (where DuckDB will add numbers to disambiguate).

Comment on lines +348 to +351
safeName(q.measureNameToLabel[m.Name]),
safeName(q.measureNameToLabel[m.Name]+"__previous"),
safeName(q.measureNameToLabel[m.Name]+"__delta_abs"),
safeName(q.measureNameToLabel[m.Name]+"__delta_rel"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do human-friendly formatting like Label (prev), Label (Δ), Label (Δ%)

@begelundmuller begelundmuller removed the Type:Bug Something isn't working label Oct 9, 2023
@nishantmonu51
Copy link
Collaborator

@pjain1 : Do we still need these fixes ? Lets get the comments & conflicts resolved or close the PR if its not required anymore.

@begelundmuller
Copy link
Contributor

Closing since the limit issue was fixed in another PR, and the headers issue will be addressed in a separate PR

@pjain1 pjain1 deleted the export_fixes branch February 12, 2024 11:09
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.

Exported dimension table should not be limited to 100 rows
3 participants