Syntax error: Expected keyword MODULE or keyword PROTO
This is what BigQuery says when the first word of your query is import. It means you pasted code from another language into a SQL editor, and IMPORT happens to be a real GoogleSQL keyword.
Syntax error: Expected keyword MODULE or keyword PROTO but got identifier "sqlite3" at [1:8]
What BigQuery means
The column in the message, 8, is where sqlite3 starts. It points at the word that was not MODULE, not at the problem.
You pasted something that is not SQL, and it started with the word import.
GoogleSQL’s grammar has an IMPORT MODULE and an IMPORT PROTO statement, so import at the start of a statement is read as one of those. The next word has to be MODULE or PROTO. It was sqlite3, and that is what the message reports.
BigQuery does not actually run either form. IMPORT MODULE foo gets past the parser and then fails with Statement not supported: ImportStatement at [1:1]. The grammar knows the statement, the service does not implement it. That is enough for import to be treated as a statement keyword and to produce this message.
Nobody hits this writing SQL.
The fix
The query box wants SQL. If you were running Python, you want the BigQuery client library or BigQuery DataFrames, not the query editor:
from google.cloud import bigquery
client = bigquery.Client()
rows = client.query("SELECT 1").result()
If you meant to run the SQL that was further down in what you copied, copy only that part.
Why other languages get another error
import lands on this message because the grammar has a statement that starts with it. First words that match no statement form are just identifiers, so you get Unexpected identifier instead:
def main():
pass
Syntax error: Unexpected identifier "def" at [1:1]
const x = 1;
Syntax error: Unexpected identifier "const" at [1:1]
In Querylab.io
Querylab.io marks this in the editor as you type, with the message “Unsupported statement: import” on the word import itself. No request goes to BigQuery.