Skip to content

Materialized view reporting as the wrong type #76

@pgcamus

Description

@pgcamus

What happened?

Materialized views created in the emulator are reporting the wrong type.

$ bq --format=json show pg_test.mv | jq .
{
  "creationTime": "1774467014",
  "id": "camus-unittest:pg_test.mv",
  "kind": "bigquery#table",
  "lastModifiedTime": "1774467014",
  "materializedView": {
    "query": "select 1"
  },
  "selfLink": "http://0.0.0.0:9050/bigquery/v2/projects/camus-unittest/datasets/pg_test/tables/mv",
  "tableReference": {
    "datasetId": "pg_test",
    "projectId": "camus-unittest",
    "tableId": "mv"
  },
  "type": "TABLE"
}

You can see that there is a materializedView field set to a SQL query, but the table field still says TABLE.

What did you expect to happen?

The table field should report MATERIALIZED_VIEW.

How can we reproduce it (as minimally and precisely as possible)?

Create a new dataset with a new materialized view and then show it.

$ bq mk -d pg_test
Dataset 'camus-unittest:pg_test' successfully created.

$ bq mk -t --materialized_view='select 1' pg_test.mv
Materialized View 'camus-unittest:pg_test.mv' successfully created.

$ bq --format=json show pg_test.mv | jq .
{
  "creationTime": "1774467014",
  "id": "camus-unittest:pg_test.mv",
  "kind": "bigquery#table",
  "lastModifiedTime": "1774467014",
  "materializedView": {
    "query": "select 1"
  },
  "selfLink": "http://0.0.0.0:9050/bigquery/v2/projects/camus-unittest/datasets/pg_test/tables/mv",
  "tableReference": {
    "datasetId": "pg_test",
    "projectId": "camus-unittest",
    "tableId": "mv"
  },
  "type": "TABLE"
}

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions