Skip to content

Commit 729f6aa

Browse files
committed
fix return tables add getViewNames
1 parent f14bd22 commit 729f6aa

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Schema/Bigquery/BigquerySchemaReflection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Google\Cloud\BigQuery\BigQueryClient;
88
use Keboola\TableBackendUtils\Escaping\Bigquery\BigqueryQuote;
9+
use Keboola\TableBackendUtils\ReflectionException;
910
use Keboola\TableBackendUtils\Schema\SchemaReflectionInterface;
1011
use Keboola\TableBackendUtils\TableNotExistsReflectionException;
1112
use LogicException;
@@ -33,7 +34,7 @@ public function getTablesNames(): array
3334
}
3435
$query = $this->bqClient->query(
3536
sprintf(
36-
'SELECT * FROM %s.INFORMATION_SCHEMA.TABLES;',
37+
'SELECT * FROM %s.INFORMATION_SCHEMA.TABLES WHERE `table_type` != \'VIEW\';',
3738
BigqueryQuote::quoteSingleIdentifier($this->datasetName),
3839
)
3940
);
@@ -72,7 +73,7 @@ public function getViewsNames(): array
7273
{
7374
$isDatasetExist = $this->bqClient->dataset($this->datasetName)->exists();
7475
if ($isDatasetExist === false) {
75-
throw new TableNotExistsReflectionException(sprintf('Dataset "%s" not found', $this->datasetName));
76+
throw new ReflectionException(sprintf('Dataset "%s" not found', $this->datasetName));
7677
}
7778
$query = $this->bqClient->query(
7879
sprintf(

0 commit comments

Comments
 (0)