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

May I kindly ask you to support View? #95

Open
dulao5 opened this issue May 2, 2022 · 1 comment
Open

May I kindly ask you to support View? #95

dulao5 opened this issue May 2, 2022 · 1 comment

Comments

@dulao5
Copy link

dulao5 commented May 2, 2022

Objective

I want to aggregate the results of a Table Join with a view and process the query results using newHoge_Decoder.

Problem

The comment in internal.TypeLoader.LoadTable says "LoadTable loads a schema table/view definition."

yo/internal/loader.go

Lines 88 to 89 in f04de87

// LoadTable loads a schema table/view definition.
func (tl *TypeLoader) LoadTable(args *ArgType) (map[string]*Type, error) {

But actually when processing a View, I get the following error.

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
go.mercari.io/yo/internal.(*TypeLoader).loadPrimaryKeys(0xc0001c1890?, 0xc000916200)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/internal/loader.go:179 +0x212
go.mercari.io/yo/internal.(*TypeLoader).LoadTable(0xc0001c1890, 0x1ecc660)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/internal/loader.go:133 +0x1a5
go.mercari.io/yo/internal.(*TypeLoader).LoadSchema(0x0?, 0xc00034b220?)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/internal/loader.go:72 +0x27
go.mercari.io/yo/cmd.glob..func5(0x1ebeec0?, {0xc00034b220?, 0x5?, 0x5?})
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/cmd/root.go:83 +0x21f
github.com/spf13/cobra.(*Command).execute(0x1ebeec0, {0xc0001a8130, 0x5, 0x5})
	go/1.18.1/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x1ebeec0)
	go/1.18.1/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	go/1.18.1/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
go.mercari.io/yo/cmd.Execute(...)
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/cmd/root.go:110
main.main()
	go/1.18.1/pkg/mod/go.mercari.io/yo@v0.5.2/main.go:30 +0x25
@kazegusuri
Copy link
Collaborator

Oh I didn't notice view feature was supported in Spanner. It seems the comment is derived from xo. Yo does not support view for now. I will definitely support view soon.

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

2 participants