Listar modelos usando o streaming
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Lista todos os modelos existentes no conjunto de dados usando o método de streaming.
Exemplo de código
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis code sample demonstrates how to list all existing models within a specified dataset using the streaming method.\u003c/p\u003e\n"],["\u003cp\u003eThe sample utilizes the BigQuery Node.js client library for interacting with Google Cloud's BigQuery service.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication is required via Application Default Credentials, as detailed in the documentation.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetModelsStream()\u003c/code\u003e method is used to retrieve model information, with each model's metadata being logged to the console.\u003c/p\u003e\n"],["\u003cp\u003eThe provided sample can be used to discover all existing models in a BigQuery dataset, making it easier to work with them.\u003c/p\u003e\n"]]],[],null,["# List models using streaming\n\nLists all existing models in the dataset using streaming.\n\nCode sample\n-----------\n\n### Node.js\n\n\nBefore trying this sample, follow the Node.js setup instructions in the\n[BigQuery quickstart using\nclient libraries](/bigquery/docs/quickstarts/quickstart-client-libraries).\n\n\nFor more information, see the\n[BigQuery Node.js API\nreference documentation](https://googleapis.dev/nodejs/bigquery/latest/index.html).\n\n\nTo authenticate to BigQuery, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for client libraries](/bigquery/docs/authentication#client-libs).\n\n\n // Import the Google Cloud client library\n const {BigQuery} = require('https://cloud.google.com/nodejs/docs/reference/bigquery/latest/overview.html');\n const bigquery = new https://cloud.google.com/nodejs/docs/reference/bigquery/latest/bigquery/bigquery.html();\n\n async function listModels() {\n // Lists all existing models in the dataset using streaming method.\n\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // const datasetId = \"my_dataset\";\n\n const dataset = bigquery.dataset(datasetId);\n\n dataset\n .https://cloud.google.com/nodejs/docs/reference/bigquery/latest/bigquery/dataset.html()\n .on('error', console.error)\n .on('data', model =\u003e {\n console.log(https://cloud.google.com/nodejs/docs/reference/bigquery/latest/bigquery/dataset.html.metadata);\n })\n .on('end', () =\u003e {\n console.log('All models have been retrieved.');\n });\n }\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=bigquery)."]]