Run a query and get total rows
Stay organized with collections
Save and categorize content based on your preferences.
Run a query and also get the total rows from the query.
Code sample
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis page demonstrates how to run a query and retrieve the total number of rows returned by that query using Java and Python.\u003c/p\u003e\n"],["\u003cp\u003eBoth Java and Python examples use the BigQuery client libraries to interact with the BigQuery service and execute the provided query.\u003c/p\u003e\n"],["\u003cp\u003eThe examples require setting up Application Default Credentials for authentication to BigQuery.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code samples query a public dataset, specifically \u003ccode\u003ebigquery-public-data.usa_names.usa_1910_2013\u003c/code\u003e, to find names in the state of Texas (TX), limited to the first 100.\u003c/p\u003e\n"],["\u003cp\u003eAfter running a query, the code prints the total number of rows resulting from the query execution in the terminal.\u003c/p\u003e\n"]]],[],null,[]]