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: add support for struct in client executor - extractRowArrayValue #11228

Open
harshachinta opened this issue Dec 5, 2024 · 0 comments
Assignees
Labels
api: spanner Issues related to the Spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release. triage me I really want to be triaged.

Comments

@harshachinta
Copy link
Contributor

harshachinta commented Dec 5, 2024

The extractRowArrayValue in executor converts a single column's array value at given index i to executor value.
However, the current methid lacks conversion when the type is TYPECODE_STRUCT.

func extractRowArrayValue(row *spanner.Row, i int, t *sppb.Type) (*executorpb.Value, error) {

b/382335717
The systests failed with the below error

ABORTED: RandomBatchTransactions (workid: Writes-auto-1733354544808703-184) failed: ABORTED: INVALID_ARGUMENT: Execution failed for batch partition, Failed action: database_path: 	 "projects/spanner-cloud-systest/instances/cloud-systest0/databases/read_write_test" execute_partition { partition { cloud { cloud_partition: "\376\026\235\n\000\376\026\230AAeMGCkgu1tMiWfkcmWr9vrj__ReDkWrgi_78TXrybZ2wxPpd-BoeThAJWw-QdactF0bWA8IS4aUqaLq3yq4cF_w-acMGAH5-3GXBlDkQ9ath3NFGeRtZj28x1dBb96I3azzxYYp1z33WfzihkF_4WaYFW2VX58LQymm2953Huz3N_cuFH9m7KVCd2LH1YuBeBojhaJqn-rL9Nkb06IAtaJXe3HEbkW8tvIjXJbw3KVPvyvljSA5Eilizt7q_HUH-wjdPNyUqgVC3YSOEHyjpGMqGKm5ZUE5BDR6E94YDS1haLhhPE_ZB0eM4oelQ46fwhJ...[Action Truncated]:  spanner: code = "InvalidArgument", desc = "extractRowArrayValue: unable to extract value: type STRUCT not supported"
Transaction Writes-auto-1733354544808703-184/137534 @1733355445173947 (2024/12/04-15:37:25.173947-08:00)  schema_generation=3  dma_ctx=no concurrency=batch=1733355445173947:
  Read log scopes: [Folders(5,0q*)..Folders(5,0q*)]
Query: 
SET sql_version 1;
BIND p0 false;
BIND p1 NUMERIC "-24418225444244624169241243163.783041211";
SELECT
  projectscan_6.a_2 AS expr0_7,
  COALESCE(ARRAY< STRUCT< int64_f INT64 > >[], projectscan_6.a_5) AS expr1_10
FROM
  (
    SELECT
      (CAST(@p1 AS STRING) IN (
        SELECT
          SAFE_CAST(JSON_VALUE('{"array":[null,3.974676704235172e+307],"bool":true,"null":null,"number_float":1.1206932170878527e+307,"number_integer":-7917485124678447281,"number_unsigned":16839281082195424947,"object":{"array":[-9006197925947932233],"string":"RQ3eN2PEG:RxD6NSD6XXghNyUNbhK5rQAnS"},"string":"l3HUGxIykZQGt7snzfsGVg2DQPDO7i4nssqwp4nNQGojS0GTVg"}',
            "$.object.string") AS STRING) AS a_4
        FROM
          (
            SELECT
              1
          ) AS singlerowscan_3
        WHERE
          @p0
      )) AS a_2,
      ARRAY< STRUCT< int64_f INT64 > >[STRUCT< int64_f INT64 > (-6524593091844119782), STRUCT< int64_f INT64 >
      (-101546339316740543), STRUCT< int64_f INT64 > (1496238184691556105), STRUCT< int64_f INT64 > (-3132155766874334742)] AS a_5
    FROM
      (
        SELECT
          1
      ) AS singlerowscan_1
    WHERE
      true
  ) AS projectscan_6;
To debug this, you may want to replay the batch transaction with the following command, adding a watch table and keys for the rows that differ:
RUN: spanner/automatic_build/systest/fetch_and_run_driver.sh systest_1204_14_702859027 read_write --systest_id=cloudclientquickgo-ra-1204-14 --spanner_systest_label=cloudclientquickgo --spanner_systest_cell=ra --systest_port=0 --client_mdb_group=spanner-test --systest_extra_command_arg=--spanner_test_profile=systest:group=system,binary=read_write_worker,script=read_write,label=cloudclientquickgo --systest_extra_command_arg=--spandex_enable_systestable_query_features --systest_extra_command_arg=--spanner_systest_prob_partition_hint=0.8 --cloud  replaybatchtransaction projects/spanner-cloud-systest/instances/cloud-systest0/databases/read_write_test readonly 1733355445173947 3 Writes-auto-1733354544808703-184 137534 [<watch table> <watch keys>]
=== Source Location Trace: ===
spanner/systest/handlers/read_write.cc:3152
 [type.googleapis.com/util.ErrorSpacePayload='storage_systest::SYSTEST_FAILED']


@harshachinta harshachinta added the triage me I really want to be triaged. label Dec 5, 2024
@harshachinta harshachinta self-assigned this Dec 5, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Dec 5, 2024
@harshachinta harshachinta added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed api: spanner Issues related to the Spanner API. labels Dec 5, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Dec 5, 2024
@harshachinta harshachinta changed the title spanner: add support for struct in extractRowArrayValue spanner: add support for struct in client executor - extractRowArrayValue Dec 21, 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. priority: p2 Moderately-important priority. Fix may not be included in next release. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant