Skip to content

Commit 8d18d63

Browse files
authored
Merge pull request #1607 from data-integrations/fix-plugin-1948
[PLUGIN-1948] Fix ClassCastException in BigQuery source plugin for table definition
2 parents e5a08fc + 9eafb1f commit 8d18d63

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/io/cdap/plugin/gcp/bigquery/source/PartitionedBigQueryInputFormat.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.api.services.bigquery.model.TableReference;
2525
import com.google.cloud.bigquery.RangePartitioning;
2626
import com.google.cloud.bigquery.StandardTableDefinition;
27+
import com.google.cloud.bigquery.TableDefinition;
2728
import com.google.cloud.bigquery.TableDefinition.Type;
2829
import com.google.cloud.bigquery.TimePartitioning;
2930
import com.google.cloud.hadoop.io.bigquery.AbstractBigQueryInputFormat;
@@ -146,7 +147,7 @@ private void processQuery(JobContext context) throws IOException, InterruptedExc
146147
readTimeout);
147148
Type type = Objects.requireNonNull(bigQueryTable).getDefinition().getType();
148149
Boolean isPartitionFilterRequired = bigQueryTable.getRequirePartitionFilter();
149-
StandardTableDefinition tableDefinition = Objects.requireNonNull(bigQueryTable).getDefinition();
150+
TableDefinition tableDefinition = Objects.requireNonNull(bigQueryTable).getDefinition();
150151

151152
String query;
152153
if (type == Type.VIEW || type == Type.MATERIALIZED_VIEW || type == Type.EXTERNAL) {
@@ -156,7 +157,7 @@ private void processQuery(JobContext context) throws IOException, InterruptedExc
156157
query = generateQuery(partitionFromDate, partitionToDate, filter, datasetProjectId,
157158
datasetId,
158159
tableName, limit, orderBy,
159-
isPartitionFilterRequired, tableDefinition);
160+
isPartitionFilterRequired, (StandardTableDefinition) tableDefinition);
160161
}
161162

162163
if (query != null) {

0 commit comments

Comments
 (0)