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

Support ARRAY types #13

Open
apstndb opened this issue Jul 26, 2022 · 1 comment
Open

Support ARRAY types #13

apstndb opened this issue Jul 26, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@apstndb
Copy link
Contributor

apstndb commented Jul 26, 2022

splanter seems to support all Cloud Spanner table column types except ARRAY types.
Ideally, ARRAY types should be supported.

Schama

CREATE TABLE AllTypes (
                     ID STRING(MAX) NOT NULL,
                     BoolValue BOOL,
                     Int64Value INT64,
                     Float64Value FLOAT64,
                     TimestampValue TIMESTAMP,
                     DateValue DATE,
                     StringValue STRING(MAX),
                     BytesValue BYTES(MAX),
                     NumericValue NUMERIC,
                     JSONValue JSON,
                     StringArray ARRAY<STRING(MAX)>,
) PRIMARY KEY(ID);

YAML

---
# Values are need to be encoded as documented.
# https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#google.spanner.v1.TypeCode
- ID: "All_Type_Values"
  BoolValue: true
  BytesValue: "aG9nZQ==" # base64("hoge")
  DateValue: "2022-04-01"
  Float64Value: 3.14159
  Int64Value: 42
  JSONValue: '{"test": 1}'
  NumericValue: "-12345678901234567890123456789.123456789"
  StringValue: "FooBar"
  TimestampValue: "2022-04-01T00:00:00Z"
  # failed to load data to spanner tables: failed to insert records: spanner: code = "InvalidArgument", desc = "client doesn't support type []interface {}"exit status 1
  # StringArray:
  #   - "Foo"
  #   - "Bar"

In this case, it seems to need []interface{}-to-[]string conversion(using INFORMATION_SCHEMA or use reflection?). ARRAY<INT64>, ARRAY<TIMESTAMP>, etc are also should be supported

@110y 110y added the enhancement New feature or request label Jul 26, 2022
uji added a commit to uji/splanter that referenced this issue Dec 6, 2023
issue: kauche#13

support types

- ARRAY<STRING(MAX)>
- ARRAY<Bool>
- ARRAY<INT64>
- ARRAY<FLOAT64>
- ARRAY<TIMESTAMP>
- ARRAY<DATE>
- ARRAY<BYTES(MAX)>
- ARRAY<NUMERIC>
- ARRAY<JSON>
@uji
Copy link
Contributor

uji commented Dec 6, 2023

@110y
I tried to support ARRAY types.
I've created a Pull Request and would appreciate a review if you'd like.
#21

uji added a commit to uji/splanter that referenced this issue Jan 14, 2024
issue: kauche#13

support types

- ARRAY<STRING(MAX)>
- ARRAY<Bool>
- ARRAY<INT64>
- ARRAY<FLOAT64>
- ARRAY<TIMESTAMP>
- ARRAY<DATE>
- ARRAY<BYTES(MAX)>
- ARRAY<NUMERIC>
- ARRAY<JSON>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants