0

In the cloud console, I created a new Cloud Spanner View called StudentView which left joined my Student table and a ClassEnrollment table. The update seemed to work as I could see the new View created.

I then looked at my Students table and I got the error:

Cannot read properties of null (reading 'join').

View screenshot of error

1

The Students table showed no data even though it is populated. I subsequently deleted the StudentView:

DROP VIEW StudentView;

The result is still the same and the Student table displays nothing but the error stated above - even though the StudentView has been dropped.

I have also tried replacing the StudentView View so it does not contain null values, but the error persists.

I am assuming the error refers to the View that I created. If that is not the case, please could you point me in the right direction.

Any idea how to go about this problem?

vimuth
  • 5,064
  • 33
  • 79
  • 116
  • Would you mind sharing the DDL of your tables and the view (or any subset of it that is enough to reproduce the problem)? I've just tried the same with two simple tables and a view without running into the same problem. – Knut Olav Løite Aug 30 '22 at 12:12
  • Thanks for your response. This is the View Schema: `CREATE OR REPLACE VIEW StudentView SQL SECURITY INVOKER AS SELECT` `CAST(Students.studentId AS STRING) AS id, ` `CAST(Students.GivenName AS STRING) || " " || CAST(Students.FamilyName AS STRING) AS Name, ` `CAST(Students.PhoneNumber AS JSON) AS PhoneNumber,` `CAST(Students.Email AS STRING) AS Email ` `From Students LEFT OUTER JOIN ClassEnrollments ON Students.studentId = ClassEnrollments.studentId` Sorry about the format of this - SO comments are very limited. – Stinkybadger Aug 30 '22 at 13:01
  • The minimal reproducible Students Table is as follows: – Stinkybadger Aug 30 '22 at 13:06
  • `CREATE TABLE Students ( studentId STRING(MAX) NOT NULL, PhoneNumber JSON NOT NULL, Email STRING(50), GivenName STRING(100) NOT NULL, FamilyName STRING(100) NOT NULL, ) PRIMARY KEY(studentId);` – Stinkybadger Aug 30 '22 at 13:08
  • Sorry, I'm still not able to reproduce it. I think that the best next step for you would be to report an issue if this problem persists. – Knut Olav Løite Aug 30 '22 at 16:15
  • All good, it's actually solved now. Turned my laptop off for a while and launched again and it showed. Good old faithful on/off. Thank you for your help :) – Stinkybadger Aug 30 '22 at 17:34

1 Answers1

0

There was a short-lived bug in the Cloud Spanner UI that was active around the time you asked this question (2022-08-30). Assuming you can see Students now, and StudentView doesn't appear in the UI anymore, the bug probably affected you too. Nothing you're doing wrong, just unlucky timing.

If you ever suspect there's a problem with the Cloud Spanner UI, you can list and query DBs with gcloud spanner .... In this case gcloud should have continued to work while the UI was down.

c24t
  • 81
  • 3