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

[Aggregates] [Windowing] COVAR_POP uses COVAR_SAMP implementation #168

Open
ohaibbq opened this issue Feb 13, 2024 · 0 comments
Open

[Aggregates] [Windowing] COVAR_POP uses COVAR_SAMP implementation #168

ohaibbq opened this issue Feb 13, 2024 · 0 comments

Comments

@ohaibbq
Copy link
Contributor

ohaibbq commented Feb 13, 2024

Currently these functions return the same value. The population value needs to be updated to actually calculate population covariance.

		{
			name: "covar_pop window",
			query: `
SELECT COVAR_POP(y, x) FROM
  UNNEST([STRUCT(1.0 AS y, 1.0 AS x),
      (2.0, 6.0),
      (9.0, 3.0),
      (2.0, 6.0),
      (9.0, 3.0)])
`,
			expectedRows: [][]interface{}{
				// TODO(goccy/go-zetasqlite#): Use population covariance instead of sample covariance
				//expected output: {-1.6800000000000002},
				{-2.1},
				
			},
		},
@ohaibbq ohaibbq changed the title [Windowing] COVAR_POP uses COVAR_SAMP implementation [Aggregates] [Windowing] COVAR_POP uses COVAR_SAMP implementation Feb 13, 2024
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

No branches or pull requests

1 participant