{"record":{"id":"fae9fa2673dc02eb","repo":"prestodb/presto","slug":"not-supported-fae9fa","errorCode":"NOT_SUPPORTED","errorMessage":"Views are not enabled. You can enable views by setting 'bigquery.views-enabled' to true. Notice additional cost may occur.","messagePattern":"Views are not enabled\\. You can enable views by setting 'bigquery\\.views-enabled' to true\\. Notice additional cost may occur\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/ReadSessionCreator.java","lineNumber":114,"sourceCode":"                            .build());\n\n            return readSession;\n        }\n    }\n\n    TableInfo getActualTable(\n            TableInfo table,\n            ImmutableList<String> requiredColumns,\n            String[] filters)\n    {\n        TableDefinition tableDefinition = table.getDefinition();\n        TableDefinition.Type tableType = tableDefinition.getType();\n        if (TableDefinition.Type.TABLE == tableType) {\n            return table;\n        }\n        if (TableDefinition.Type.VIEW == tableType) {\n            if (!config.viewsEnabled) {\n                throw new PrestoException(NOT_SUPPORTED,\n                        \"Views are not enabled. You can enable views by setting 'bigquery.views-enabled' to true. Notice additional cost may occur.\");\n            }\n            // get it from the view\n            String querySql = bigQueryClient.createSql(table.getTableId(), requiredColumns);\n            log.debug(\"querySql is %s\", querySql);\n            try {\n                return destinationTableCache.get(querySql, new DestinationTableBuilder(bigQueryClient, config, querySql, table.getTableId()));\n            }\n            catch (ExecutionException e) {\n                throw new PrestoException(BigQueryErrorCode.BIGQUERY_VIEW_DESTINATION_TABLE_CREATION_FAILED, \"Error creating destination table\", e);\n            }\n        }\n        else {\n            // not regular table or a view\n            throw new PrestoException(NOT_SUPPORTED, format(\"Table type '%s' of table '%s.%s' is not supported\",\n                    tableType, table.getTableId().getDataset(), table.getTableId().getTable()));\n        }\n    }","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/ReadSessionCreator.java#L96-L132","documentation":"ReadSessionCreator.getActualTable only supports reading views when config.viewsEnabled is true; otherwise encountering a BigQuery VIEW table type throws NOT_SUPPORTED with instructions to enable 'bigquery.views-enabled'. The connector reads views by materializing them into destination tables, which incurs extra cost, hence the opt-in.","triggerScenarios":"Querying a BigQuery view (or a table whose type resolves to VIEW) while the catalog config does not set bigquery.views-enabled=true.","commonSituations":"Users selecting from views without knowing the connector treats views specially; default catalog config; migrating workloads that previously used views.","solutions":["Set bigquery.views-enabled=true in the catalog properties file and restart/reload the connector","Query the underlying base tables directly instead of the view","Materialize the view yourself as a table in BigQuery","Confirm you are querying the intended catalog (a non-BigQuery catalog may support views natively)"],"exampleFix":"// before (bigquery.properties)\n# views not configured\n// after\nbigquery.views-enabled=true","handlingStrategy":"validation","validationCode":"// check table type and config before querying a view\nTableInfo table = bigQueryClient.getTable(tableId);\nboolean viewsEnabled = Boolean.parseBoolean(catalogProperties.getProperty(\"bigquery.views-enabled\", \"false\"));\nif (table.getDefinition().getType() == TableDefinition.Type.VIEW && !viewsEnabled) {\n    throw new IllegalStateException(\"Enable bigquery.views-enabled=true to query views\");\n}","typeGuard":"boolean isQueryableTable(TableDefinition def, boolean viewsEnabled) {\n    return def.getType() == TableDefinition.Type.TABLE\n        || (def.getType() == TableDefinition.Type.VIEW && viewsEnabled);\n}","tryCatchPattern":"try {\n    return query.execute();\n} catch (PrestoException e) {\n    if (e.getErrorCode() == NOT_SUPPORTED && e.getMessage().contains(\"views-enabled\")) {\n        // guide user: set bigquery.views-enabled=true or query base tables\n    }\n    throw e;\n}","preventionTips":["Set bigquery.views-enabled=true up front if views are expected","Inventory datasets for views before onboarding the connector","Prefer querying base tables to avoid materialization costs","Validate catalog config in deployment checks"],"tags":["bigquery","views","configuration","not-supported"],"backgroundTag":"views-not-enabled","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}