I have created a Google Sheets spreadsheet with two worksheets, called Sheet1
and Sheet2
:
https://docs.google.com/spreadsheets/d/1P1WH7cwVD
Looks like the command you used to query from an temporary external table definition was not referring to the external table.
If you change the command to the following, it should work as expected:
bq query --external_table_definition="Sheet2::/tmp/google_sheets_sheet2_tabledef.json" --format=csv --use_legacy_sql=false 'SELECT * FROM Sheet2
' 2>/dev/null