Reference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::Job::ScriptStatistics.
Represents statistics for a child job of a script.
Inherits
Object
Example
require"google/cloud/bigquery"bigquery=Google::Cloud::Bigquery.newmulti_statement_sql=<<~SQL--Declareavariabletoholdnamesasanarray.DECLAREtop_namesARRAY<STRING>;--Buildanarrayofthetop100namesfromtheyear2017.SETtop_names=(SELECTARRAY_AGG(nameORDERBYnumberDESCLIMIT100)FROM`bigquery-public-data.usa_names.usa_1910_current`WHEREyear=2017);--WhichnamesappearaswordsinShakespeare's plays? SELECT name AS shakespeare_name FROM UNNEST(top_names) AS name WHERE name IN ( SELECT word FROM `bigquery-public-data.samples.shakespeare` );SQLjob = bigquery.query_job multi_statement_sqljob.wait_until_done!child_jobs = bigquery.jobs parent_job: jobchild_jobs.each do |child_job| script_statistics = child_job.script_statistics puts script_statistics.evaluation_kind script_statistics.stack_frames.each do |stack_frame| puts stack_frame.text endend
Methods
#evaluation_kind
defevaluation_kind()->String
Indicates the type of child job. Possible values include STATEMENT and
EXPRESSION.
Stack trace where the
current evaluation happened. Shows line/column/procedure name of each frame on the stack at the point where
the current evaluation happened. The leaf frame is first, the primary script is last.
[[["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"]],["Last updated 2025-09-09 UTC."],[],[],null,["# BigQuery API - Class Google::Cloud::Bigquery::Job::ScriptStatistics (v1.56.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.56.0 (latest)](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.55.0](/ruby/docs/reference/google-cloud-bigquery/1.55.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.54.0](/ruby/docs/reference/google-cloud-bigquery/1.54.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.53.0](/ruby/docs/reference/google-cloud-bigquery/1.53.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.52.1](/ruby/docs/reference/google-cloud-bigquery/1.52.1/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.51.1](/ruby/docs/reference/google-cloud-bigquery/1.51.1/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.50.0](/ruby/docs/reference/google-cloud-bigquery/1.50.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.49.1](/ruby/docs/reference/google-cloud-bigquery/1.49.1/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.48.1](/ruby/docs/reference/google-cloud-bigquery/1.48.1/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.47.0](/ruby/docs/reference/google-cloud-bigquery/1.47.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.46.1](/ruby/docs/reference/google-cloud-bigquery/1.46.1/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.45.0](/ruby/docs/reference/google-cloud-bigquery/1.45.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.44.2](/ruby/docs/reference/google-cloud-bigquery/1.44.2/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.43.1](/ruby/docs/reference/google-cloud-bigquery/1.43.1/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.42.0](/ruby/docs/reference/google-cloud-bigquery/1.42.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.41.0](/ruby/docs/reference/google-cloud-bigquery/1.41.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.40.0](/ruby/docs/reference/google-cloud-bigquery/1.40.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.39.0](/ruby/docs/reference/google-cloud-bigquery/1.39.0/Google-Cloud-Bigquery-Job-ScriptStatistics)\n- [1.38.1](/ruby/docs/reference/google-cloud-bigquery/1.38.1/Google-Cloud-Bigquery-Job-ScriptStatistics) \nReference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::Job::ScriptStatistics.\n\nRepresents statistics for a child job of a script. \n\nInherits\n--------\n\n- Object\n\nExample\n-------\n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\n\nmulti_statement_sql = \u003c\u003c~SQL\n -- Declare a variable to hold names as an array.\n DECLARE top_names ARRAY\u003cSTRING\u003e;\n -- Build an array of the top 100 names from the year 2017.\n SET top_names = (\n SELECT ARRAY_AGG(name ORDER BY number DESC LIMIT 100)\n FROM `bigquery-public-data.usa_names.usa_1910_current`\n WHERE year = 2017\n );\n -- Which names appear as words in Shakespeare's plays?\n SELECT\n name AS shakespeare_name\n FROM UNNEST(top_names) AS name\n WHERE name IN (\n SELECT word\n FROM `bigquery-public-data.samples.shakespeare`\n );\nSQL\n\njob = bigquery.query_job multi_statement_sql\n\njob.wait_until_done!\n\nchild_jobs = bigquery.jobs parent_job: job\n\nchild_jobs.each do |child_job|\n script_statistics = child_job.script_statistics\n puts script_statistics.evaluation_kind\n script_statistics.stack_frames.each do |stack_frame|\n puts stack_frame.text\n end\nend\n```\n\nMethods\n-------\n\n### #evaluation_kind\n\n def evaluation_kind() -\u003e String\n\nIndicates the type of child job. Possible values include `STATEMENT` and\n`EXPRESSION`. \n**Returns**\n\n- (String) --- the current value of evaluation_kind\n\n### #stack_frames\n\n def stack_frames() -\u003e Array\u003cGoogle::Cloud::Bigquery::Job::ScriptStackFrame\u003e\n\nStack trace where the\ncurrent evaluation happened. Shows line/column/procedure name of each frame on the stack at the point where\nthe current evaluation happened. The leaf frame is first, the primary script is last. \n**Returns**\n\n- (Array\\\u003c[Google::Cloud::Bigquery::Job::ScriptStackFrame](./Google-Cloud-Bigquery-Job-ScriptStackFrame)\\\u003e) --- the current value of stack_frames"]]