[PLUGIN-1948] Handle unsupported BigQuery table types gracefully in PartitionedBigQueryInputFormat#1610
Conversation
itsankit-google
left a comment
There was a problem hiding this comment.
Before this change : #1583
Did the BQ source work for other types like SNAPSHOT?
No, BQ source did not work for types like SNAPSHOT because inside |
Can you please run a pipeline and attach evidence of failure with an older version of plugin before that change? |
e7690e2 to
e5cce38
Compare
e5cce38 to
6073d65
Compare
Thanks for pointing this out! Before #1583, the BQ source did work for types like I have moved the With this updated approach:
Process:
|
|
Please do remember to cherry-pick this change and release 0.24.x in hub so that backward compatibility is restored. |


Problem:
PR #1607 fixed the initial
ClassCastExceptionthat occurred when incorrectly assuming all BigQuery tables are standard tables. However, the code still blindly casts theTableDefinitionto aStandardTableDefinitioninsideprocessQuerybefore passing it togenerateQuery.Solution:
This follow-up PR refactors
PartitionedBigQueryInputFormat.javato restore backward compatibility and improve type safety:processQueryand passes the genericTableDefinitiontogenerateQuery.StandardTableDefinitioncast insidegenerateQuery, after checking if any query modifiers (filters, limits, order by, partitions) are present.null, allowing other types likeSNAPSHOTandMODELtables to be read directly without crashing.instanceofand throws a descriptive error instead of aClassCastException.Testing