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

spanner: parser should allow JSON_VALUE_ARRAY columns #9556

Closed
wwidner-ch opened this issue Mar 12, 2024 · 0 comments · Fixed by #9557
Closed

spanner: parser should allow JSON_VALUE_ARRAY columns #9556

wwidner-ch opened this issue Mar 12, 2024 · 0 comments · Fixed by #9557
Assignees
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.

Comments

@wwidner-ch
Copy link

Client

spanner

Environment

e.g. Alpine Docker on GKE

Go Environment

$ go version
go version go1.21.5 darwin/arm64

$ go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/weswidner/Library/Caches/go-build'
GOENV='/Users/weswidner/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/weswidner/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/weswidner/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.21.5/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.21.5/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/weswidner/code/deproot/src/github.com/CyberhavenInc/dataflow/backend/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/yp/hj3tmk457zz3mt4pby42vmgm0000gn/T/go-build3120587149=/tmp/go-build -gno-record-gcc-switches -fno-common'

Code

e.g.

package main

import (
	"cloud.google.com/go/spanner/spansql"
)

func main() {
	_, err := spansql.ParseDDL("testfile.sql", `ALTER TABLE testtable ADD COLUMN IF NOT EXISTS testcolumn ARRAY<STRING(MAX)> AS (JSON_VALUE_ARRAY(edge, "$.some.json.path")) STORED;`)
	if err != nil {
		panic(err)
	}
}

Expected behavior

Statement with JSON_VALUE_ARRAY should parse without error

Actual behavior

panic: testfile.sql:1.97: got "(" while expecting ")"

Additional context

The funcNames slice in keywords.go needs to be extended to include the JSON extractors listed here.

@wwidner-ch wwidner-ch added the triage me I really want to be triaged. label Mar 12, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants